File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ type DiffOptions = {
4
4
expand ?: boolean
5
5
colors ?: boolean
6
6
contextLines ?: number
7
+ stablePatchmarks ?: boolean
7
8
aAnnotation ?: string
8
9
bAnnotation ?: string
9
- stablePatchmarks ?: boolean
10
10
}
11
11
12
12
declare namespace jest {
Original file line number Diff line number Diff line change @@ -13,25 +13,25 @@ type Options = {|
13
13
expand ? : boolean ,
14
14
colors ? : boolean ,
15
15
contextLines ? : number ,
16
+ stablePatchmarks ? : boolean ,
16
17
aAnnotation ? : string ,
17
18
bAnnotation ? : string ,
18
- stablePatchmarks ? : boolean ,
19
19
| } ;
20
20
21
21
const defaultOptions = {
22
22
expand : false ,
23
23
colors : false ,
24
24
contextLines : - 1 , // Forces to use default from Jest
25
+ stablePatchmarks : false ,
25
26
aAnnotation : 'First value' ,
26
27
bAnnotation : 'Second value' ,
27
- stablePatchmarks : false ,
28
28
} ;
29
29
30
30
const SNAPSHOT_TITLE = 'Snapshot Diff:\n' ;
31
31
32
32
const snapshotDiff = ( valueA : any , valueB : any , options ? : Options ) : string => {
33
33
let difference ;
34
- const mergedOptions = Object . assign ( { } , defaultOptions , options ) ;
34
+ const mergedOptions = { ... defaultOptions , ... options } ;
35
35
36
36
if ( isReactComponent ( valueA ) && isReactComponent ( valueB ) ) {
37
37
difference = diffReactComponents ( valueA , valueB , mergedOptions ) ;
You can’t perform that action at this time.
0 commit comments