"use strict";

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

test('promise.any method', () => {
  const inputCode = `const promise1 = new Promise(resolve => setTimeout(resolve, 100, 'quick'));
const promise2 = new Promise(resolve => setTimeout(resolve, 500, 'slow'));
const promises = [promise1, promise2];Promise.any(promises).then(value => console.log(value));`;
  const outputCode = `const promise1 = new Promise(resolve => setTimeout(resolve, 100, 'quick'));
const promise2 = new Promise(resolve => setTimeout(resolve, 500, 'slow'));
const promises = [promise1, promise2];
Promise.any(promises).then(value => console.log(value));`;
  expect(convertCode(inputCode)).toBe(outputCode);
});