Skip to content

Commit eb61723

Browse files
avocadowastakenthymikee
authored andcommitted
fix(index.d.ts): Use jest.CustomMatcher type for toMatchDiffSnapshot (#61)
Currently `expect.extend({ toMatchDiffSnapshot });` throws: ``` TS2322: Type '(newObject: any) => void' is not assignable to type 'CustomMatcher'. Type 'void' is not assignable to type 'CustomMatcherResult | Promise<CustomMatcherResult>'. ```
1 parent 65b1d3f commit eb61723

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ declare module "snapshot-diff" {
2828
* Allows you to pull out toMatchDiffSnapshot and
2929
* make it available via `expect.extend({ toMatchDiffSnapshot })`.
3030
*/
31-
toMatchDiffSnapshot: (newObject: any) => void
31+
toMatchDiffSnapshot: jest.CustomMatcher
3232
/**
3333
* By default Jest adds extra quotes around strings so it makes diff
3434
* snapshots of objects too noisy. To fix this – snapshot-diff comes

0 commit comments

Comments
 (0)