Skip to content

Commit

Permalink
test: improve AsyncLock test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
  • Loading branch information
jerome-benoit committed Aug 23, 2024
1 parent b1421bc commit aff8ddb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/utils/AsyncLock.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from 'expect'
import { randomInt } from 'node:crypto'
import { describe, it } from 'node:test'

import { AsyncLock, AsyncLockType } from '../../src/utils/AsyncLock.js'
Expand Down Expand Up @@ -28,7 +29,7 @@ await describe('AsyncLock test suite', async () => {
let count = 0
const asyncFn = async () => {
await new Promise(resolve => {
setTimeout(resolve, 100)
setTimeout(resolve, randomInt(1, 100))
})
executed.push(++count)
}
Expand Down

0 comments on commit aff8ddb

Please sign in to comment.