Skip to content

Commit

Permalink
fix: jsdom teardown
Browse files Browse the repository at this point in the history
When the teardown runs (when threads are disabled), it breaks JSDOM
It turns out that the teardown function is never called when running with threads enabled,
so this issue went unnoticed for most developers.

Fixes vitest-dev#835

The PR can be tested by running:

```
cd examples/vue
pnpm run test -- --no-threads
```

This fails on `main` but no longer fails with this commit.
  • Loading branch information
cexbrayat committed Mar 31, 2022
1 parent 2be420f commit 60847cc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/vitest/src/integrations/env/jsdom.ts
Expand Up @@ -58,8 +58,7 @@ export default <Environment>({
}

return {
teardown(global) {
keys.forEach(key => delete global[key])
teardown() {
},
}
},
Expand Down

0 comments on commit 60847cc

Please sign in to comment.