* chore: make aware eslint that we use jest By setting up the jest environment, we no longer need to declare the 'test' global in the configuration. * chore: don't need to import expect, it's a jest environment global * chore: don't need to import expect when creating undefined test
16 lines
424 B
JavaScript
16 lines
424 B
JavaScript
const {pipeAsyncFunctions} = require('./_30s.js');
|
|
|
|
test('pipeAsyncFunctions is a Function', () => {
|
|
expect(pipeAsyncFunctions).toBeInstanceOf(Function);
|
|
});
|
|
test('pipeAsyncFunctions result should be 15', () => {
|
|
expect(
|
|
pipeAsyncFunctions(
|
|
x => x + 1,
|
|
x => new Promise(resolve => setTimeout(() => resolve(x + 2), 0)),
|
|
x => x + 3,
|
|
async x => (await x) + 4
|
|
)(5)
|
|
).resolves.toBe(15);
|
|
});
|