Skip to content

Commit e77658c

Browse files
nlfwraithgar
authored andcommittedApr 27, 2022
chore(test): insert a setTimeout to ensure order of operations
1 parent bd2b7a3 commit e77658c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎test/get.js

+3
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ t.test('get.stream add new listeners post stream creation', (t) => {
409409
// in which the stream has already been created and has the entry data
410410
// available, allowing for the validation of the newListener event handler
411411
return index.find(CACHE, KEY)
412+
// we additionally wait for setTimeout because we want to be as sure as
413+
// we can the event loop has ticked over after the i/o cycle completes
414+
.then(() => new Promise((resolve) => setTimeout(resolve, 0)))
412415
.then(() => {
413416
[
414417
'integrity',

0 commit comments

Comments
 (0)
Please sign in to comment.