Skip to content

Commit

Permalink
add test for default value
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Nov 26, 2019
1 parent daeabf2 commit 05926f2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test.js
Expand Up @@ -113,3 +113,22 @@ test('Execute batch in parallel', async (t) => {

t.deepEqual(started, [true, true, false])
})

test('Should work without size parameter', async (t) => {
const input = [
async () => {
await delay(200)

return 1
},
async () => {
await delay(100)

return 2
}
]

const res = await all(parallelBatch(input))

t.deepEqual(res, [1, 2])
})

0 comments on commit 05926f2

Please sign in to comment.