From bec979a146a50f9f0975dbe764ccb78cbca006be Mon Sep 17 00:00:00 2001 From: Mark Pedrotti Date: Mon, 16 Sep 2019 16:01:39 -0400 Subject: [PATCH] chore: Align snapshots in jest-diff --- .../__tests__/__snapshots__/diff.test.ts.snap | 510 +++++++++--------- packages/jest-diff/src/__tests__/diff.test.ts | 179 +++--- 2 files changed, 367 insertions(+), 322 deletions(-) diff --git a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.ts.snap b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.ts.snap index eb7c2a247d46..981f946af1cc 100644 --- a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.ts.snap +++ b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.ts.snap @@ -1,386 +1,386 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`collapses big diffs to patch format 1`] = ` -"- Expected -+ Received - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -- 9, - 10, -+ 9, - ], - }" +- Expected ++ Received + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, +- 9, + 10, ++ 9, + ], + } `; exports[`color of text (expanded) 1`] = ` -"- Expected -+ Received +- Expected ++ Received - Object { - \\"searching\\": \\"\\", -- \\"sorting\\": Object { -+ \\"sorting\\": Array [ -+ Object { - \\"descending\\": false, - \\"fieldKey\\": \\"what\\", - }, -+ ], - }" + Object { + "searching": "", +- "sorting": Object { ++ "sorting": Array [ ++ Object { + "descending": false, + "fieldKey": "what", + }, ++ ], + } `; exports[`context number of lines: -1 (5 default) 1`] = ` -"- Expected 1 - -+ Received 1 + - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -- 9, - 10, -+ 9, - ], - }" +- Expected 1 - ++ Received 1 + + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, +- 9, + 10, ++ 9, + ], + } `; exports[`context number of lines: 0 1`] = ` -"- Expected 1 - -+ Received 1 + +- Expected 1 - ++ Received 1 + -@@ -11,1 +11,0 @@ -- 9, -@@ -13,0 +12,1 @@ -+ 9," +@@ -11,1 +11,0 @@ +- 9, +@@ -13,0 +12,1 @@ ++ 9, `; exports[`context number of lines: 1 1`] = ` -"- Expected 1 - -+ Received 1 + +- Expected 1 - ++ Received 1 + -@@ -10,4 +10,4 @@ - 8, -- 9, - 10, -+ 9, - ]," +@@ -10,4 +10,4 @@ + 8, +- 9, + 10, ++ 9, + ], `; exports[`context number of lines: 2 1`] = ` -"- Expected 1 - -+ Received 1 + +- Expected 1 - ++ Received 1 + -@@ -9,6 +9,6 @@ - 7, - 8, -- 9, - 10, -+ 9, - ], - }" +@@ -9,6 +9,6 @@ + 7, + 8, +- 9, + 10, ++ 9, + ], + } `; exports[`context number of lines: 3.1 (5 default) 1`] = ` -"- Expected 1 - -+ Received 1 + - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -- 9, - 10, -+ 9, - ], - }" +- Expected 1 - ++ Received 1 + + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, +- 9, + 10, ++ 9, + ], + } `; exports[`context number of lines: undefined (5 default) 1`] = ` -"- Expected 1 - -+ Received 1 + - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -- 9, - 10, -+ 9, - ], - }" +- Expected 1 - ++ Received 1 + + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, +- 9, + 10, ++ 9, + ], + } `; exports[`diffStringsUnified edge cases empty both a and b 1`] = ` -"- Expected 0 - -+ Received 0 + +- Expected 0 - ++ Received 0 + + -" `; exports[`diffStringsUnified edge cases empty only a 1`] = ` -"- Expected 0 - -+ Received 1 + +- Expected 0 - ++ Received 1 + -+ one-line string" ++ one-line string `; exports[`diffStringsUnified edge cases empty only b 1`] = ` -"- Expected 1 - -+ Received 0 + +- Expected 1 - ++ Received 0 + -- one-line string" +- one-line string `; exports[`diffStringsUnified edge cases equal both non-empty 1`] = ` -"- Expected 0 - -+ Received 0 + +- Expected 0 - ++ Received 0 + - one-line string" + one-line string `; exports[`diffStringsUnified edge cases multiline has no common after clean up chaff 1`] = ` -"- Expected 2 - -+ Received 2 + +- Expected 2 - ++ Received 2 + -- delete -- two -+ insert -+ 2" +- delete +- two ++ insert ++ 2 `; exports[`diffStringsUnified edge cases one-line has no common after clean up chaff 1`] = ` -"- Expected 1 - -+ Received 1 + +- Expected 1 - ++ Received 1 + -- delete -+ insert" +- delete ++ insert `; exports[`falls back to not call toJSON if it throws and then objects have differences 1`] = ` -"- Expected 1 - -+ Received 1 + +- Expected 1 - ++ Received 1 + - Object { -- \\"line\\": 1, -+ \\"line\\": 2, - \\"toJSON\\": [Function toJSON], - }" + Object { +- "line": 1, ++ "line": 2, + "toJSON": [Function toJSON], + } `; exports[`falls back to not call toJSON if serialization has no differences but then objects have differences 1`] = ` -"Compared values serialize to the same structure. -Printing internal object structure without calling \`toJSON\` instead. +Compared values serialize to the same structure. +Printing internal object structure without calling \`toJSON\` instead. -- Expected 1 - -+ Received 1 + +- Expected 1 - ++ Received 1 + - Object { -- \\"line\\": 1, -+ \\"line\\": 2, - \\"toJSON\\": [Function toJSON], - }" + Object { +- "line": 1, ++ "line": 2, + "toJSON": [Function toJSON], + } `; exports[`oneline strings 1`] = ` -"- Expected 1 - -+ Received 1 + +- Expected 1 - ++ Received 1 + -- ab -+ aa" +- ab ++ aa `; exports[`oneline strings 2`] = ` -"- Expected 1 - -+ Received 1 + +- Expected 1 - ++ Received 1 + -- 123456789 -+ 234567890" +- 123456789 ++ 234567890 `; exports[`oneline strings 3`] = ` -"- Expected 1 - -+ Received 2 + +- Expected 1 - ++ Received 2 + -- oneline -+ multi -+ line" +- oneline ++ multi ++ line `; exports[`oneline strings 4`] = ` -"- Expected 2 - -+ Received 1 + +- Expected 2 - ++ Received 1 + -- multi -- line -+ oneline" +- multi +- line ++ oneline `; exports[`options 7980 diff 1`] = ` -"- Original -+ Modified +- Original ++ Modified -- \`\${Ti.App.name} \${Ti.App.version} \${Ti.Platform.name} \${Ti.Platform.version}\` -+ \`\${Ti.App.getName()} \${Ti.App.getVersion()} \${Ti.Platform.getName()} \${Ti.Platform.getVersion()}\`" +- \`\${Ti.App.name} \${Ti.App.version} \${Ti.Platform.name} \${Ti.Platform.version}\` ++ \`\${Ti.App.getName()} \${Ti.App.getVersion()} \${Ti.Platform.getName()} \${Ti.Platform.getVersion()}\` `; exports[`options 7980 diffStringsUnified 1`] = ` -"- Original -+ Modified +- Original ++ Modified -- \`\${Ti.App.name} \${Ti.App.version} \${Ti.Platform.name} \${Ti.Platform.version}\` -+ \`\${Ti.App.getName()} \${Ti.App.getVersion()} \${Ti.Platform.getName()} \${Ti.Platform.getVersion()}\`" +- \`\${Ti.App.name} \${Ti.App.version} \${Ti.Platform.name} \${Ti.Platform.version}\` ++ \`\${Ti.App.getName()} \${Ti.App.getVersion()} \${Ti.Platform.getName()} \${Ti.Platform.getVersion()}\` `; exports[`options change color diffStringsUnified 1`] = ` -"- Expected -+ Received +- Expected ++ Received -- delete -- changed from -+ changed to -+ insert - common" +- delete +- changed from ++ changed to ++ insert + common `; exports[`options change indicators diff 1`] = ` -"< Expected -> Received +< Expected +> Received - Array [ -< \\"delete\\", -< \\"change from\\", -> \\"change to\\", -> \\"insert\\", - \\"common\\", - ]" + Array [ +< "delete", +< "change from", +> "change to", +> "insert", + "common", + ] `; exports[`options common diff 1`] = ` -"- Expected -+ Received +- Expected ++ Received = Array [ -- \\"delete\\", -- \\"change from\\", -+ \\"change to\\", -+ \\"insert\\", -= \\"common\\", -= ]" +- "delete", +- "change from", ++ "change to", ++ "insert", += "common", += ] `; exports[`options includeChangeCounts false diffLinesUnified 1`] = ` -"- Expected -+ Received +- Expected ++ Received - Array [ -- \\"delete\\", -- \\"change from\\", -+ \\"change to\\", -+ \\"insert\\", - \\"common\\", - ]" + Array [ +- "delete", +- "change from", ++ "change to", ++ "insert", + "common", + ] `; exports[`options includeChangeCounts false diffStringsUnified 1`] = ` -"- Expected -+ Received +- Expected ++ Received -- change from -+ change to - common" +- change from ++ change to + common `; exports[`options includeChangeCounts true padding diffLinesUnified a has 2 digits 1`] = ` -"- Before 10 - -+ After 1 + - - common -- a -- a -- a -- a -- a -- a -- a -- a -- a -- a -+ b" +- Before 10 - ++ After 1 + + + common +- a +- a +- a +- a +- a +- a +- a +- a +- a +- a ++ b `; exports[`options includeChangeCounts true padding diffLinesUnified b has 2 digits 1`] = ` -"- Before 1 - -+ After 10 + - - common -- a -+ b -+ b -+ b -+ b -+ b -+ b -+ b -+ b -+ b -+ b" +- Before 1 - ++ After 10 + + + common +- a ++ b ++ b ++ b ++ b ++ b ++ b ++ b ++ b ++ b ++ b `; exports[`options includeChangeCounts true padding diffStringsUnified 1`] = ` -"- Before 1 - -+ After 1 + +- Before 1 - ++ After 1 + -- change from -+ change to - common" +- change from ++ change to + common `; exports[`options omitAnnotationLines true diff 1`] = ` -" Array [ -- \\"delete\\", -- \\"change from\\", -+ \\"change to\\", -+ \\"insert\\", - \\"common\\", - ]" + Array [ +- "delete", +- "change from", ++ "change to", ++ "insert", + "common", + ] `; exports[`options omitAnnotationLines true diffStringsUnified and includeChangeCounts true 1`] = ` -"- change from -+ change to - common" +- change from ++ change to + common `; -exports[`options omitAnnotationLines true diffStringsUnified empty strings 1`] = `""`; +exports[`options omitAnnotationLines true diffStringsUnified empty strings 1`] = ``; exports[`options trailingSpaceFormatter diffDefault default yellowish 1`] = ` -"- Expected -+ Received +- Expected ++ Received -- delete 1 trailing space: -+ delete 1 trailing space: - common 2 trailing spaces: -- insert 1 trailing space: -+ insert 1 trailing space: " +- delete 1 trailing space: ++ delete 1 trailing space: + common 2 trailing spaces: +- insert 1 trailing space: ++ insert 1 trailing space: `; exports[`options trailingSpaceFormatter diffDefault middle dot 1`] = ` -"- Expected -+ Received - -- delete 1 trailing space:· -+ delete 1 trailing space: - common 2 trailing spaces:·· -- insert 1 trailing space: -+ insert 1 trailing space:·" +- Expected ++ Received + +- delete 1 trailing space:· ++ delete 1 trailing space: + common 2 trailing spaces:·· +- insert 1 trailing space: ++ insert 1 trailing space:· `; diff --git a/packages/jest-diff/src/__tests__/diff.test.ts b/packages/jest-diff/src/__tests__/diff.test.ts index cfde5f7069d2..dcea872dcdeb 100644 --- a/packages/jest-diff/src/__tests__/diff.test.ts +++ b/packages/jest-diff/src/__tests__/diff.test.ts @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +import ansiRegex = require('ansi-regex'); +import * as style from 'ansi-styles'; import chalk from 'chalk'; import stripAnsi from 'strip-ansi'; @@ -12,20 +14,78 @@ import diff from '../'; import {diffStringsUnified} from '../printDiffs'; import {DiffOptions} from '../types'; -const optionsCounts = { +const optionsCounts: DiffOptions = { includeChangeCounts: true, }; const NO_DIFF_MESSAGE = 'Compared values have no visual difference.'; -const stripped = (a: unknown, b: unknown, options?: DiffOptions) => - stripAnsi(diff(a, b, options) || ''); +// Use only in toBe assertions for edge case messages. +const stripped = (a: unknown, b: unknown) => stripAnsi(diff(a, b) || ''); +// Use in toBe assertions for comparison lines. +const noColor = (string: string) => string; +const optionsBe: DiffOptions = { + aColor: noColor, + bColor: noColor, + commonColor: noColor, + omitAnnotationLines: true, +}; +const unexpandedBe: DiffOptions = { + ...optionsBe, + expand: false, +}; +const expandedBe: DiffOptions = { + ...optionsBe, + expand: true, +}; + +// Use for toMatchSnapshot assertions. const unexpanded = {expand: false}; const expanded = {expand: true}; const elementSymbol = Symbol.for('react.element'); +expect.addSnapshotSerializer({ + serialize(val: string): string { + return val.replace(ansiRegex(), match => { + switch (match) { + case style.inverse.open: + return ''; + case style.inverse.close: + return ''; + + case style.bold.open: + return ''; + case style.dim.open: + return ''; + case style.green.open: + return ''; + case style.red.open: + return ''; + case style.yellow.open: + return ''; + case style.bgYellow.open: + return ''; + + case style.bold.close: + case style.dim.close: + case style.green.close: + case style.red.close: + case style.yellow.close: + case style.bgYellow.close: + return ''; + + default: + return match; + } + }); + }, + test(val: any): val is string { + return typeof val === 'string'; + }, +}); + describe('different types', () => { [ [1, 'a', 'number', 'string'], @@ -66,13 +126,8 @@ describe('no visual difference', () => { ].forEach(values => { test(`'${JSON.stringify(values[0])}' and '${JSON.stringify( values[1], - )}' (unexpanded)`, () => { - expect(stripped(values[0], values[1], unexpanded)).toBe(NO_DIFF_MESSAGE); - }); - test(`'${JSON.stringify(values[0])}' and '${JSON.stringify( - values[1], - )}' (expanded)`, () => { - expect(stripped(values[0], values[1], expanded)).toBe(NO_DIFF_MESSAGE); + )}'`, () => { + expect(stripped(values[0], values[1])).toBe(NO_DIFF_MESSAGE); }); }); @@ -134,7 +189,7 @@ describe('falls back to not call toJSON', () => { }); // Some of the following assertions seem complex, but compare to alternatives: -// * toMatch instead of toMatchSnapshot: +// * toBe instead of toMatchSnapshot: // * to avoid visual complexity of escaped quotes in expected string // * to omit Expected/Received heading which is an irrelevant detail // * join lines of expected string instead of multiline string: @@ -158,10 +213,10 @@ line 4`; ].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); @@ -180,42 +235,36 @@ describe('objects', () => { ].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); test('numbers', () => { - expect(stripped(1, 2)).toEqual(expect.stringContaining('- 1\n+ 2')); + expect(diff(1, 2, optionsBe)).toBe('- 1\n+ 2'); }); test('-0 and 0', () => { - expect(stripped(-0, 0)).toEqual(expect.stringContaining('- -0\n+ 0')); + expect(diff(-0, 0, optionsBe)).toBe('- -0\n+ 0'); }); test('booleans', () => { - expect(stripped(false, true)).toEqual( - expect.stringContaining('- false\n+ true'), - ); + expect(diff(false, true, optionsBe)).toBe('- false\n+ true'); }); describe('multiline string non-snapshot', () => { // For example, CLI output // toBe or toEqual for a string isn’t enclosed in double quotes. - const a = ` -Options: + const a = `Options: --help, -h Show help [boolean] --bail, -b Exit the test suite immediately upon the first - failing test. [boolean] -`; - const b = ` -Options: + failing test. [boolean]`; + const b = `Options: --help, -h Show help [boolean] --bail, -b Exit the test suite immediately upon the first - failing test. [boolean] -`; + failing test. [boolean]`; const expected = [ ' Options:', '- --help, -h Show help [boolean]', @@ -227,32 +276,28 @@ Options: ].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); describe('multiline string snapshot', () => { // For example, CLI output // A snapshot of a string is enclosed in double quotes. - const a = ` -" + const a = `" Options: --help, -h Show help [boolean] --bail, -b Exit the test suite immediately upon the first - failing test. [boolean]" -`; - const b = ` -" + failing test. [boolean]"`; + const b = `" Options: --help, -h Show help [boolean] --bail, -b Exit the test suite immediately upon the first - failing test. [boolean]" -`; + failing test. [boolean]"`; const expected = [ - ' "', + ' "', ' Options:', '- --help, -h Show help [boolean]', '- --bail, -b Exit the test suite immediately upon the first', @@ -263,10 +308,10 @@ Options: ].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); @@ -297,10 +342,10 @@ describe('React elements', () => { ].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); @@ -324,10 +369,10 @@ describe('multiline string as value of object property', () => { points: '0.5,0.460\n0.5,0.875\n0.25,0.875', }; test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); @@ -348,10 +393,10 @@ describe('multiline string as value of object property', () => { '}', ].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); }); @@ -387,10 +432,10 @@ describe('indentation in JavaScript structures', () => { ].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); @@ -410,10 +455,10 @@ describe('indentation in JavaScript structures', () => { ].join('\n'); test('(unexpanded)', () => { - expect(stripped(b, a, unexpanded)).toMatch(expected); + expect(diff(b, a, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(b, a, expanded)).toMatch(expected); + expect(diff(b, a, expandedBe)).toBe(expected); }); }); }); @@ -487,10 +532,10 @@ describe('indentation in React elements (non-snapshot)', () => { ].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); @@ -507,10 +552,10 @@ describe('indentation in React elements (non-snapshot)', () => { ].join('\n'); test('(unexpanded)', () => { - expect(stripped(b, a, unexpanded)).toMatch(expected); + expect(diff(b, a, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(b, a, expanded)).toMatch(expected); + expect(diff(b, a, expandedBe)).toBe(expected); }); }); }); @@ -550,10 +595,10 @@ describe('indentation in React elements (snapshot)', () => { ].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); @@ -573,10 +618,10 @@ describe('indentation in React elements (snapshot)', () => { ].join('\n'); test('(unexpanded)', () => { - expect(stripped(b, a, unexpanded)).toMatch(expected); + expect(diff(b, a, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(b, a, expanded)).toMatch(expected); + expect(diff(b, a, expandedBe)).toBe(expected); }); }); }); @@ -620,10 +665,10 @@ describe('outer React element (non-snapshot)', () => { ].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); @@ -641,10 +686,10 @@ describe('outer React element (non-snapshot)', () => { ].join('\n'); test('(unexpanded)', () => { - expect(stripped(b, a, unexpanded)).toMatch(expected); + expect(diff(b, a, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(b, a, expanded)).toMatch(expected); + expect(diff(b, a, expandedBe)).toBe(expected); }); }); }); @@ -657,10 +702,10 @@ describe('trailing newline in multiline string not enclosed in quotes', () => { const expected = [' line 1', ' line 2', ' line 3', '+ '].join('\n'); test('(unexpanded)', () => { - expect(stripped(a, b, unexpanded)).toMatch(expected); + expect(diff(a, b, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(a, b, expanded)).toMatch(expected); + expect(diff(a, b, expandedBe)).toBe(expected); }); }); @@ -668,10 +713,10 @@ describe('trailing newline in multiline string not enclosed in quotes', () => { const expected = [' line 1', ' line 2', ' line 3', '- '].join('\n'); test('(unexpanded)', () => { - expect(stripped(b, a, unexpanded)).toMatch(expected); + expect(diff(b, a, unexpandedBe)).toBe(expected); }); test('(expanded)', () => { - expect(stripped(b, a, expanded)).toMatch(expected); + expect(diff(b, a, expandedBe)).toBe(expected); }); }); });