"use strict";

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

test('Object entries', () => {
  const inputCode = `const fruits = ["Banana", "Orange", "Apple", "Mango"];
const f = fruits.entries();`;
  const outputCode = `const fruits = ["Banana", "Orange", "Apple", "Mango"];
const f = fruits.entries();`;
  expect(convertCode(inputCode)).toBe(outputCode);
});
test('Import from named exports', () => {
  const inputCode = 'import { name, age } from "./person.js"; ';
  const outputCode = 'import { name, age } from "./person.js";';
  expect(convertCode(inputCode)).toBe(outputCode);
});
test('Import from default exports', () => {
  const inputCode = 'import message from "./message.js"; ';
  const outputCode = 'import message from "./message.js";';
  expect(convertCode(inputCode)).toBe(outputCode);
});
test('super method', () => {
  const inputCode = `let obj = {
  say() {
    return "Hello";
  },
};

let obj2 = {
  say() {
    return super.say() + "World!";
  },
};`;
  const outputCode = `let obj = {
  say() {
    return "Hello";
  }
};
let obj2 = {
  say() {
    return super.say() + "World!";
  }
};`;
  expect(convertCode(inputCode)).toBe(outputCode);
});