chainAsync update: last function shouldn't get 'next' as argument
Confident that my tests pass, but _30.js won't update.
This commit is contained in:
@ -5,18 +5,30 @@ test('chainAsync is a Function', () => {
|
||||
expect(chainAsync).toBeInstanceOf(Function);
|
||||
});
|
||||
|
||||
let incrementer = 0
|
||||
test('Calls all functions in an array', () => {
|
||||
chainAsync([
|
||||
next => {
|
||||
incrementer += 1
|
||||
next();
|
||||
},
|
||||
next => {
|
||||
incrementer += 1
|
||||
next();
|
||||
},
|
||||
next => {
|
||||
expect(incrementer).toEqual(2);
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
||||
test('Last function does not receive "next" argument', () => {
|
||||
chainAsync([
|
||||
next => {
|
||||
next();
|
||||
},
|
||||
next => {
|
||||
(() => {
|
||||
next();
|
||||
})();
|
||||
},
|
||||
next => {
|
||||
expect(true).toBeTruthy();
|
||||
expect(next).toBe(null);
|
||||
}
|
||||
]);
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user