Skip to content

Commit

Permalink
Fix typings (#6)
Browse files Browse the repository at this point in the history
If we restrict `toMatchJSON` to only accept records, we can't actually compare arrays. 
At the moment, compiling `expect("[]").toMatchJSON([])` fails.

Setting `expected` to any should fix that.
  • Loading branch information
idan-at authored Dec 8, 2021
1 parent 95d4db4 commit f93ee6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare namespace jest {
interface Matchers<R> {
toMatchJSON(expected: Record<string, unknown>): R;
toMatchJSON(expected: any): R;
}

interface Expect {
Expand Down

0 comments on commit f93ee6a

Please sign in to comment.