start project
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { cleanup } from '@testing-library/react';
|
||||
import { afterEach } from 'vitest';
|
||||
|
||||
import '@testing-library/jest-dom/vitest';
|
||||
|
||||
// vitest.config.ts intentionally leaves `test.globals` off (test files import
|
||||
// describe/it/expect explicitly), so Testing Library's own auto-cleanup -
|
||||
// which only registers itself when it detects a *global* `afterEach` - never
|
||||
// fires on its own. Without this, unmounted DOM from one `it()` block leaks
|
||||
// into the next within the same file, and every query starts matching
|
||||
// duplicate nodes.
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
});
|
||||
Reference in New Issue
Block a user