diff --git a/lib/struct/bufferedQueue.test.ts b/lib/struct/bufferedQueue.test.ts index 4876de9..62e28b3 100644 --- a/lib/struct/bufferedQueue.test.ts +++ b/lib/struct/bufferedQueue.test.ts @@ -18,8 +18,7 @@ describe('struct/BufferedQueue', async () => { deepStrictEqual(eqT, ['info']); }); - // blocked by https://github.com/nodejs/node/pull/52332 - it('dispatches each topic to a handler fn', {skip: true}, t => { + it('dispatches each topic to a handler fn', t => { t.mock.timers.enable(); const mockHandleFn = t.mock.fn(); @@ -57,8 +56,7 @@ describe('struct/BufferedQueue', async () => { deepStrictEqual(infoQ, ['info', 3]); }); - // blocked by https://github.com/nodejs/node/pull/52332 - it('splits dispatches by timeout', {skip: true}, t => { + it('splits dispatches by timeout', t => { t.mock.timers.enable({apis: ['setTimeout']}); const fn = t.mock.fn(); diff --git a/lib/struct/bufferedQueue.ts b/lib/struct/bufferedQueue.ts index 8f189be..c53b6d5 100644 --- a/lib/struct/bufferedQueue.ts +++ b/lib/struct/bufferedQueue.ts @@ -3,7 +3,7 @@ import {defer} from '..'; export interface BufferedData { buffer: Data[]; - timeout: NodeJS.Timeout; + timeout?: NodeJS.Timeout; promise: Promise<[Topic, unknown]>; resolve: (t: [Topic, unknown]) => void; } @@ -53,7 +53,7 @@ export class BufferedQueue { stored = { buffer: [], - timeout: undefined!, + timeout: undefined, promise, resolve, };