Open yjaaidi opened 4 months ago
The following tests will not show any error when using happy-dom environment:
test('leak microtask', () => { queueMicrotask(() => expect(1).toBe(2)); }); test('leak timer', () => { setTimeout(() => expect(1).toBe(2), 1000); });
It would be nice if the environment could detect pending timers or flush (until timeout) when torn down. This could be achieved with something like await this.global.happyDOM.waitUntilComplete() in the teardown.
await this.global.happyDOM.waitUntilComplete()
I'll be happy to help with a PR.
Cf. https://github.com/jestjs/jest/issues/14984
The following tests will not show any error when using happy-dom environment:
It would be nice if the environment could detect pending timers or flush (until timeout) when torn down. This could be achieved with something like
await this.global.happyDOM.waitUntilComplete()
in the teardown.I'll be happy to help with a PR.
Cf. https://github.com/jestjs/jest/issues/14984