diff --git a/src/test/vitest.d.ts b/src/test/vitest.d.ts new file mode 100644 index 00000000..5da46dfc --- /dev/null +++ b/src/test/vitest.d.ts @@ -0,0 +1,12 @@ +import type { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers'; + +declare module 'vitest' { + // Extend Vitest's Assertion with jest-dom matchers + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-object-type + interface Assertion extends TestingLibraryMatchers {} + // eslint-disable-next-line @typescript-eslint/no-empty-object-type + interface AsymmetricMatchersContaining extends TestingLibraryMatchers< + unknown, + void + > {} +} diff --git a/tsconfig.json b/tsconfig.json index 9a08ad86..7162a6cf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,5 +21,5 @@ "types": ["node"] }, "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "**/*.stories.tsx", "**/*.test.tsx"] + "exclude": ["node_modules", "dist", "**/*.stories.tsx"] }