Update to @testing-library/jest-dom:6.0.0

This commit is contained in:
Alejandro Celaya
2023-08-15 09:53:28 +02:00
parent 30c07c6790
commit 9758e7ed8c
3 changed files with 31 additions and 1020 deletions

View File

@@ -1,15 +1,6 @@
import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers';
import matchers from '@testing-library/jest-dom/matchers';
import '@testing-library/jest-dom/vitest';
import { cleanup } from '@testing-library/react';
import { afterEach, expect } from 'vitest';
// Workaround for TypeScript error: https://github.com/testing-library/jest-dom/issues/439#issuecomment-1536524120
declare module 'vitest' {
interface Assertion<T = any> extends jest.Matchers<void, T>, TestingLibraryMatchers<T, void> {}
}
// Extends Vitest's expect method with methods from react-testing-library
expect.extend(matchers);
import { afterEach } from 'vitest';
// Clear all mocks and cleanup DOM after every test
afterEach(() => {