Remove workaround for incomplete jest-axe typings

.toHaveNoViolations() wasn't properly typed when `expect` was
imported from `@jest/globals`, but our upstream fix was merged, so
the workaround is no longer necessary:
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67495
This commit is contained in:
Vincent 2023-11-27 12:45:38 +01:00 коммит произвёл Vincent
Родитель 1ff24afc64
Коммит 3c7b495992
1 изменённых файлов: 1 добавлений и 14 удалений

Просмотреть файл

@ -4,25 +4,12 @@
import "@testing-library/jest-dom";
import "@testing-library/jest-dom/jest-globals";
import { TestingLibraryMatchers } from "@testing-library/jest-dom/matchers";
import "jest-axe/extend-expect";
import { TextEncoder } from "util";
import { setProjectAnnotations } from "@storybook/react";
import { defaultFallbackInView } from "react-intersection-observer";
import failOnConsole from "jest-fail-on-console";
import * as globalStorybookConfig from "./.storybook/preview";
import "jest-axe/extend-expect";
// `@types/jest-axe` doesn't extend `expect` when imported from `@jest/globals`.
// This manually sets the correct type. Note that it has to extend the
// TestingLibraryMatchers to avoid overriding those.
// Also see
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67495
declare module "expect" {
interface Matchers<R = void>
extends TestingLibraryMatchers<typeof expect.stringContaining, R> {
toHaveNoViolations(): R;
}
}
setProjectAnnotations(
globalStorybookConfig as Parameters<typeof setProjectAnnotations>[0],