You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enabling this option will make your tests run much slower. Use only when debugging or developing tests.
14
+
:::
15
+
16
+
Detect asynchronous resources leaking from the test file.
17
+
Uses [`node:async_hooks`](https://nodejs.org/api/async_hooks.html) to track creation of async resources. If a resource is not cleaned up, it will be logged after tests have finished.
18
+
19
+
For example if your code has `setTimeout` calls that execute the callback after tests have finished, you will see following error:
Copy file name to clipboardExpand all lines: packages/vitest/src/node/config/resolveConfig.ts
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -354,6 +354,10 @@ export function resolveConfig(
354
354
thrownewError(`"Istanbul" coverage provider is not compatible with "experimental.viteModuleRunner: false". Please, enable "viteModuleRunner" or switch to "v8" coverage provider.`)
355
355
}
356
356
357
+
if(browser.enabled&&resolved.detectAsyncLeaks){
358
+
logger.console.warn(c.yellow('The option "detectAsyncLeaks" is not supported in browser mode and will be ignored.'))
0 commit comments