"use strict";

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

test('string.replaceAll method', () => {
  const inputCode = `let text = "I love cats. Cats are very easy to love. Cats are very popular."
text = text.replaceAll("Cats","Dogs");
text = text.replaceAll(/cats/g,"dogs");
`;
  const outputCode = `let text = "I love cats. Cats are very easy to love. Cats are very popular.";
text = text.replaceAll("Cats", "Dogs");
text = text.replaceAll(/cats/g, "dogs");`;
  expect(convertCode(inputCode)).toBe(outputCode);
});