Skip to content

Commit

Permalink
Fix type definitions for vitest jest-extended
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddyGuthridge committed Sep 26, 2024
1 parent 4f38e7b commit 1c0bbea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/setup/jestExtended.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// Need to use interfaces, as they don't register the extended type definitions
// otherwise.
/* eslint-disable @typescript-eslint/no-empty-object-type */
// https://jest-extended.jestcommunity.dev/docs/getting-started/setup#use-with-vitest
import type CustomMatchers from 'jest-extended';
import 'vitest';

declare module 'vitest' {
type Assertion<T = any> = CustomMatchers<T>
type AsymmetricMatchersContaining<T = any> = CustomMatchers<T>
type ExpectStatic<T = any> = CustomMatchers<T>
interface Assertion<T = any> extends CustomMatchers<T> {}
interface AsymmetricMatchersContaining<T = any> extends CustomMatchers<T> {}
interface ExpectStatic<T = any> extends CustomMatchers<T> {}
}

0 comments on commit 1c0bbea

Please sign in to comment.