Skip to content

Commit 7ecf184

Browse files
committed
fix flow
1 parent 59ce67c commit 7ecf184

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ type DiffOptions = {
44
expand?: boolean
55
colors?: boolean
66
contextLines?: number
7+
stablePatchmarks?: boolean
78
aAnnotation?: string
89
bAnnotation?: string
9-
stablePatchmarks?: boolean
1010
}
1111

1212
declare namespace jest {

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@ type Options = {|
1313
expand?: boolean,
1414
colors?: boolean,
1515
contextLines?: number,
16+
stablePatchmarks?: boolean,
1617
aAnnotation?: string,
1718
bAnnotation?: string,
18-
stablePatchmarks?: boolean,
1919
|};
2020

2121
const defaultOptions = {
2222
expand: false,
2323
colors: false,
2424
contextLines: -1, // Forces to use default from Jest
25+
stablePatchmarks: false,
2526
aAnnotation: 'First value',
2627
bAnnotation: 'Second value',
27-
stablePatchmarks: false,
2828
};
2929

3030
const SNAPSHOT_TITLE = 'Snapshot Diff:\n';
3131

3232
const snapshotDiff = (valueA: any, valueB: any, options?: Options): string => {
3333
let difference;
34-
const mergedOptions = Object.assign({}, defaultOptions, options);
34+
const mergedOptions = { ...defaultOptions, ...options };
3535

3636
if (isReactComponent(valueA) && isReactComponent(valueB)) {
3737
difference = diffReactComponents(valueA, valueB, mergedOptions);

0 commit comments

Comments
 (0)