From 504f1dea3ef676edaf53698c896cb4e0d04dc514 Mon Sep 17 00:00:00 2001 From: Stephan Renatus Date: Thu, 4 Jul 2024 14:50:30 +0200 Subject: [PATCH] opa-react: fix typescript errors for vite matchers Following the instructions shared here: https://github.com/testing-library/jest-dom/issues/439#issuecomment-1715184115 Signed-off-by: Stephan Renatus --- packages/opa-react/package.json | 2 +- packages/opa-react/tests/setup.ts | 10 ---------- packages/opa-react/tsconfig.json | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/opa-react/package.json b/packages/opa-react/package.json index 6c1511fc..09999dcf 100644 --- a/packages/opa-react/package.json +++ b/packages/opa-react/package.json @@ -29,7 +29,7 @@ } }, "devDependencies": { - "@testing-library/jest-dom": "^6.4.5", + "@testing-library/jest-dom": "^6.4.6", "@testing-library/react": "^16.0.0", "@types/lodash.merge": "^4.6.9", "@types/react": ">=18.0.0", diff --git a/packages/opa-react/tests/setup.ts b/packages/opa-react/tests/setup.ts index 31354888..f149f27a 100644 --- a/packages/opa-react/tests/setup.ts +++ b/packages/opa-react/tests/setup.ts @@ -1,11 +1 @@ -import { expect, afterEach } from "vitest"; -import { cleanup } from "@testing-library/react"; -import "@testing-library/jest-dom"; -import * as matchers from "@testing-library/jest-dom/matchers"; import "@testing-library/jest-dom/vitest"; - -expect.extend(matchers); - -afterEach(() => { - cleanup(); -}); diff --git a/packages/opa-react/tsconfig.json b/packages/opa-react/tsconfig.json index 2caf9624..02c9766f 100644 --- a/packages/opa-react/tsconfig.json +++ b/packages/opa-react/tsconfig.json @@ -4,6 +4,6 @@ "compilerOptions": { "jsx": "react-jsx", "allowSyntheticDefaultImports": true, - "types": ["@testing-library/jest-dom"] + "types": ["vitest/globals"] } }