"use strict";

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

test('default values as params', () => {
  const inputCode = `function myFunction(x, y = 10) {
  return x + y;
}
myFunction(5);`;
  const outputCode = `function myFunction(x) {
  let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
  return x + y;
}
myFunction(5);`;
  expect(convertCode(inputCode)).toBe(outputCode);
});