Skip to content

Commit 6ab5c5d

Browse files
ortathymikee
authored andcommitted
Update index.d.ts (#17)
1 parent 2627e0f commit 6ab5c5d

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

index.d.ts

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
/// <reference types="jest"/>
22

33
type DiffOptions = {
4-
expand?: boolean,
5-
colors?: boolean,
6-
contextLines?: number,
7-
};
4+
expand?: boolean
5+
colors?: boolean
6+
contextLines?: number
7+
}
88

99
declare namespace jest {
1010
interface Matchers<R> {
11+
/**
12+
* Compare the difference between the actual in the `expect()`
13+
* vs the object inside `valueB` with some extra options.
14+
*/
1115
toMatchDiffSnapshot(valueB: any, options?: DiffOptions): R
1216
}
1317
}
1418

15-
declare module 'snapshot-diff' {
16-
function diff(a: any, b: any, options?: DiffOptions): string;
17-
namespace diff {}
18-
export = diff;
19+
declare module "snapshot-diff" {
20+
interface SnapshotDiff {
21+
/**
22+
* Compare the changes from a, to b
23+
*/
24+
(a: any, b: any, options?: DiffOptions): string
25+
/**
26+
* Allows you to pull out toMatchDiffSnapshot and
27+
* make it available via `expect.extend({ toMatchDiffSnapshot })`.
28+
*/
29+
toMatchDiffSnapshot: (newObject: any) => void
30+
}
31+
const diff: SnapshotDiff
32+
export = diff
1933
}

0 commit comments

Comments
 (0)