D
Deno

help

Test case is leaking resources

SSpixy4/19/2023
Hi, all my tests keeps failing because of
error: AssertionError: Test case is leaking 2 resources:
- A timer (rid 770) was started before the test started, but was fired/cleared during the test. Do not close resources in a test that were not created during that test.
- A timer (rid 773) was started during the test, but not fired/cleared during the test. Clear the timer by calling `clearInterval` or `clearTimeout`.

at assert (deno:ext/web/00_infra.js:295:13) ...
error: AssertionError: Test case is leaking 2 resources:
- A timer (rid 770) was started before the test started, but was fired/cleared during the test. Do not close resources in a test that were not created during that test.
- A timer (rid 773) was started during the test, but not fired/cleared during the test. Clear the timer by calling `clearInterval` or `clearTimeout`.

at assert (deno:ext/web/00_infra.js:295:13) ...
Google didnt help, there is only one setTimeout in the code and I commented it out. I use Deno.test
SSorikairo4/19/2023
You gotta share the test code my dear, otherwise it's kinda complicated
SSpixy4/19/2023
ok I found it occurs when using DB with Typeorm (npm:typeorm@0.2.45)

Looking for more? Join the community!