Skip to content

Commit 1948723

Browse files
committed
chore: update test to not stack callbacks
Change the test to use the `queueMicrotask`. This keeps the call stack in bounds. node v18 was having some issues with this test.
1 parent dfe5158 commit 1948723

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/decrypt-node/test/decrypt.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ function chunkCipherTextStream(ciphertext: Buffer, { size }: { size: number }) {
225225
next: (err: Error | null, chunk: Uint8Array | null) => void
226226
) => {
227227
const { value, done } = eat(i, size)
228-
if (done) return next(null, null)
229-
next(null, new Uint8Array(value))
228+
if (done) return queueMicrotask(() => next(null, null))
229+
queueMicrotask(() => next(null, new Uint8Array(value)))
230230
}
231231
)
232232

0 commit comments

Comments
 (0)