"use strict";

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

test('promise.finally', () => {
  const inputCode = `function doSomething() {
  doSomething1()
  .then(doSomething2)
  .catch(err => {
    console.log(err);
  })
  .finally(() => {
     console.log("completed");
  });
}`;
  const outputCode = `function doSomething() {
  doSomething1().then(doSomething2).catch(err => {
    console.log(err);
  }).finally(() => {
    console.log("completed");
  });
}`;
  expect(convertCode(inputCode)).toBe(outputCode);
});