"use strict";

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

test('error.cause method', () => {
  const inputCode = `try{
  await fetch(item);
}catch (error){
  throw new Error("An error occured while fetching item",{
    cause:error,
  });
}`;
  const outputCode = `try {
  await fetch(item);
} catch (error) {
  throw new Error("An error occured while fetching item", {
    cause: error
  });
}`;
  expect(convertCode(inputCode)).toBe(outputCode);
});