Skip to content

Commit

Permalink
chore: test
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Aug 2, 2024
1 parent dc7f63b commit 183d4a8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/promise/pMap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,14 @@ test('Infinity math', () => {
// eslint-disable-next-line jest/prefer-equality-matcher
expect(a === Infinity).toBe(true)
})

test('order is preserved', async () => {
const input = _range(6)
const result = await pMap(input, async v => {
await pDelay(100 - v * 20)
// console.log('done', v)
return v
})
// console.log(result)
expect(result).toEqual(input)
})

0 comments on commit 183d4a8

Please sign in to comment.