"use strict";

const {
  convertCode
} = require('../utilities');

test('Promises', () => {
  const inputCode = `const myPromise = new Promise(function(myResolve, myReject) {
  myResolve();
  myReject(); 
});
myPromise.then(
  function(value) { /* code if successful */ },
  function(error) { /* code if some error */ }
);`;
  const outputCode = `const myPromise = new Promise(function (myResolve, myReject) {
  myResolve();
  myReject();
});
myPromise.then(function (value) {/* code if successful */}, function (error) {/* code if some error */});`;
  expect(convertCode(inputCode)).toBe(outputCode);
});