Files
cyberyan_linkedin_search/frontend/src/test/setup.ts
T
mobiniqow 212074c5f5
CI / Backend (lint, types, tests) (push) Has been cancelled
CI / Frontend (lint, types, build) (push) Has been cancelled
CI / Docker images build (push) Has been cancelled
start project
2026-09-04 12:52:21 +03:30

15 lines
566 B
TypeScript

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();
});