describe('ES6Achieve._Promise tests', () => {
const _Promise = ES6Achieve._Promise;
test('_Promise should work fine', () => {
const result1 = new _Promise((resolve) => {
setTimeout(() => {
resolve(1);
}, 0);
});
result1.then((value) => {
expect(value).toBe(1);
return value + 1;
}).then((value) => {
expect(value).toBe(2);
});
const result2 = new _Promise((resolve) => {
resolve(100);
});
result2.then((value) => {
expect(value).toBe(100);
return value / 5;
}).then((value) => {
expect(value).toBe(20);
});
});
});