Skip to content

Commit

Permalink
fix flow
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee committed Mar 16, 2019
1 parent 59ce67c commit 7ecf184
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ type DiffOptions = {
expand?: boolean
colors?: boolean
contextLines?: number
stablePatchmarks?: boolean
aAnnotation?: string
bAnnotation?: string
stablePatchmarks?: boolean
}

declare namespace jest {
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ type Options = {|
expand?: boolean,
colors?: boolean,
contextLines?: number,
stablePatchmarks?: boolean,
aAnnotation?: string,
bAnnotation?: string,
stablePatchmarks?: boolean,
|};

const defaultOptions = {
expand: false,
colors: false,
contextLines: -1, // Forces to use default from Jest
stablePatchmarks: false,
aAnnotation: 'First value',
bAnnotation: 'Second value',
stablePatchmarks: false,
};

const SNAPSHOT_TITLE = 'Snapshot Diff:\n';

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

if (isReactComponent(valueA) && isReactComponent(valueB)) {
difference = diffReactComponents(valueA, valueB, mergedOptions);
Expand Down

0 comments on commit 7ecf184

Please sign in to comment.