Merge pull request #860 from acelaya-forks/feature/update-testing-lib

Update to @testing-library/jest-dom:6.0.0
This commit is contained in:
Alejandro Celaya 2023-08-15 09:56:18 +02:00 committed by GitHub
commit 7d3b0e4db7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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(() => {

1036
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -57,7 +57,7 @@
"devDependencies": {
"@shlinkio/eslint-config-js-coding-standard": "~2.2.0",
"@shlinkio/stylelint-config-css-coding-standard": "~1.1.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@total-typescript/shoehorn": "^0.1.1",