File tree 2 files changed +5
-3
lines changed 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ 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
10
}
Original file line number Diff line number Diff line change @@ -9,13 +9,14 @@ const prettyFormat = require('pretty-format');
9
9
const { ReactElement } = prettyFormat . plugins ;
10
10
const reactElement = Symbol . for ( 'react.element' ) ;
11
11
12
- type Options = {
12
+ 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
- } ;
19
+ | } ;
19
20
20
21
const defaultOptions = {
21
22
expand : false ,
@@ -30,7 +31,7 @@ const SNAPSHOT_TITLE = 'Snapshot Diff:\n';
30
31
31
32
const snapshotDiff = ( valueA : any , valueB : any , options ? : Options ) : string => {
32
33
let difference ;
33
- const mergedOptions = Object . assign ( { } , defaultOptions , options ) ;
34
+ const mergedOptions = { ... defaultOptions , ... options } ;
34
35
35
36
if ( isReactComponent ( valueA ) && isReactComponent ( valueB ) ) {
36
37
difference = diffReactComponents ( valueA , valueB , mergedOptions ) ;
You can’t perform that action at this time.
0 commit comments