Skip to content

Commit

Permalink
fix: support vitest 0.31.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeRahbari committed Jun 9, 2023
1 parent bdfb752 commit 4b1a658
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/itchy-chicken-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'jest-extended': patch
---

fix compatibility with vitest 0.31.0
5 changes: 4 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

interface CustomMatchers<R> extends Record<string, any> {
export interface CustomMatchers<R> extends Record<string, any> {
/**
* Note: Currently unimplemented
* Passing assertion
Expand Down Expand Up @@ -887,7 +887,10 @@ declare namespace Vi {
}

// Changed since vitest 0.31.0. Usefull for every vitest version after 0.31.0
import 'vitest';
declare module 'vitest' {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface Assertion<T = any> extends CustomMatchers<T> {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface AsymmetricMatchersContaining extends CustomMatchers<any> {}
}
Expand Down

0 comments on commit 4b1a658

Please sign in to comment.