diff --git a/package.json b/package.json index 243b11c67b31..24a7f0ac95cc 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "istanbul-reports": "^3.1.3", "jest": "workspace:^", "jest-changed-files": "workspace:^", + "jest-diff": "workspace:^", "jest-junit": "^16.0.0", "jest-mock": "workspace:^", "jest-runner-tsd": "^5.0.0", diff --git a/packages/expect/__typetests__/expect.test.ts b/packages/expect/__typetests__/expect.test.ts index 4e1d2bb72b5d..d2e3582db3d8 100644 --- a/packages/expect/__typetests__/expect.test.ts +++ b/packages/expect/__typetests__/expect.test.ts @@ -16,6 +16,7 @@ import { TesterContext, expect, } from 'expect'; +import type {DiffOptions} from 'jest-diff'; import type * as jestMatcherUtils from 'jest-matcher-utils'; type M = Matchers; @@ -69,6 +70,7 @@ expectType( expectType(this.assertionCalls); expectType(this.currentTestName); expectType>(this.customTesters); + expectType(this.diffOptions); expectType<() => void>(this.dontThrow); expectType(this.error); expectType(this.equals); @@ -79,6 +81,9 @@ expectType( expectType(this.isExpectingAssertionsError); expectType(this.isNot); expectType(this.numPassingAsserts); + expectType( + this.matcherHintOptions, + ); expectType(this.promise); expectType>(this.suppressedErrors); expectType(this.testPath); diff --git a/packages/expect/package.json b/packages/expect/package.json index 7db38a0a045f..3b18cccd2be9 100644 --- a/packages/expect/package.json +++ b/packages/expect/package.json @@ -31,6 +31,7 @@ "@tsd/typescript": "^5.0.4", "chalk": "^4.0.0", "immutable": "^4.0.0", + "jest-diff": "workspace:^", "tsd-lite": "^0.7.0" }, "engines": { diff --git a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap index 31c26a85f106..7e3debebe660 100644 --- a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap @@ -1,295 +1,295 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`.rejects fails for promise that resolves 1`] = ` -expect(received).rejects.toBe() +expect(received).rejects.toBe() Received promise resolved instead of rejected Resolved to value: 4 `; exports[`.rejects fails non-promise value "a" 1`] = ` -expect(received).rejects.toBeDefined() +expect(received).rejects.toBeDefined() -Matcher error: received value must be a promise or a function returning a promise +Matcher error: received value must be a promise or a function returning a promise Received has type: string Received has value: "a" `; exports[`.rejects fails non-promise value [1] 1`] = ` -expect(received).rejects.toBeDefined() +expect(received).rejects.toBeDefined() -Matcher error: received value must be a promise or a function returning a promise +Matcher error: received value must be a promise or a function returning a promise Received has type: array Received has value: [1] `; exports[`.rejects fails non-promise value [Function anonymous] 1`] = ` -expect(received).rejects.toBeDefined() +expect(received).rejects.toBeDefined() -Matcher error: received value must be a promise or a function returning a promise +Matcher error: received value must be a promise or a function returning a promise Received has type: function Received has value: [Function anonymous] `; exports[`.rejects fails non-promise value {"a": 1} 1`] = ` -expect(received).rejects.toBeDefined() +expect(received).rejects.toBeDefined() -Matcher error: received value must be a promise or a function returning a promise +Matcher error: received value must be a promise or a function returning a promise Received has type: object Received has value: {"a": 1} `; exports[`.rejects fails non-promise value 4 1`] = ` -expect(received).rejects.not.toBeDefined() +expect(received).rejects.not.toBeDefined() -Matcher error: received value must be a promise or a function returning a promise +Matcher error: received value must be a promise or a function returning a promise Received has type: number Received has value: 4 `; exports[`.rejects fails non-promise value null 1`] = ` -expect(received).rejects.not.toBeDefined() +expect(received).rejects.not.toBeDefined() -Matcher error: received value must be a promise or a function returning a promise +Matcher error: received value must be a promise or a function returning a promise Received has value: null `; exports[`.rejects fails non-promise value true 1`] = ` -expect(received).rejects.not.toBeDefined() +expect(received).rejects.not.toBeDefined() -Matcher error: received value must be a promise or a function returning a promise +Matcher error: received value must be a promise or a function returning a promise Received has type: boolean Received has value: true `; exports[`.rejects fails non-promise value undefined 1`] = ` -expect(received).rejects.not.toBeDefined() +expect(received).rejects.not.toBeDefined() -Matcher error: received value must be a promise or a function returning a promise +Matcher error: received value must be a promise or a function returning a promise Received has value: undefined `; exports[`.resolves fails for promise that rejects 1`] = ` -expect(received).resolves.toBe() +expect(received).resolves.toBe() Received promise rejected instead of resolved Rejected to value: 4 `; exports[`.resolves fails non-promise value "a" 1`] = ` -expect(received).resolves.toBeDefined() +expect(received).resolves.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: string Received has value: "a" `; exports[`.resolves fails non-promise value "a" synchronously 1`] = ` -expect(received).resolves.toBeDefined() +expect(received).resolves.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: string Received has value: "a" `; exports[`.resolves fails non-promise value [1] 1`] = ` -expect(received).resolves.toBeDefined() +expect(received).resolves.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: array Received has value: [1] `; exports[`.resolves fails non-promise value [1] synchronously 1`] = ` -expect(received).resolves.toBeDefined() +expect(received).resolves.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: array Received has value: [1] `; exports[`.resolves fails non-promise value [Function anonymous] 1`] = ` -expect(received).resolves.toBeDefined() +expect(received).resolves.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: function Received has value: [Function anonymous] `; exports[`.resolves fails non-promise value [Function anonymous] synchronously 1`] = ` -expect(received).resolves.toBeDefined() +expect(received).resolves.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: function Received has value: [Function anonymous] `; exports[`.resolves fails non-promise value {"a": 1} 1`] = ` -expect(received).resolves.toBeDefined() +expect(received).resolves.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: object Received has value: {"a": 1} `; exports[`.resolves fails non-promise value {"a": 1} synchronously 1`] = ` -expect(received).resolves.toBeDefined() +expect(received).resolves.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: object Received has value: {"a": 1} `; exports[`.resolves fails non-promise value 4 1`] = ` -expect(received).resolves.not.toBeDefined() +expect(received).resolves.not.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: number Received has value: 4 `; exports[`.resolves fails non-promise value 4 synchronously 1`] = ` -expect(received).resolves.not.toBeDefined() +expect(received).resolves.not.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: number Received has value: 4 `; exports[`.resolves fails non-promise value null 1`] = ` -expect(received).resolves.not.toBeDefined() +expect(received).resolves.not.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has value: null `; exports[`.resolves fails non-promise value null synchronously 1`] = ` -expect(received).resolves.not.toBeDefined() +expect(received).resolves.not.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has value: null `; exports[`.resolves fails non-promise value true 1`] = ` -expect(received).resolves.not.toBeDefined() +expect(received).resolves.not.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: boolean Received has value: true `; exports[`.resolves fails non-promise value true synchronously 1`] = ` -expect(received).resolves.not.toBeDefined() +expect(received).resolves.not.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has type: boolean Received has value: true `; exports[`.resolves fails non-promise value undefined 1`] = ` -expect(received).resolves.not.toBeDefined() +expect(received).resolves.not.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has value: undefined `; exports[`.resolves fails non-promise value undefined synchronously 1`] = ` -expect(received).resolves.not.toBeDefined() +expect(received).resolves.not.toBeDefined() -Matcher error: received value must be a promise +Matcher error: received value must be a promise Received has value: undefined `; exports[`.toBe() does not crash on circular references 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -- Expected - 1 -+ Received + 3 +- Expected - 1 ++ Received + 3 -- Object {} -+ Object { -+ "circular": [Circular], -+ } +- Object {} ++ Object { ++ "circular": [Circular], ++ } `; exports[`.toBe() fails for '"a"' with '.not' 1`] = ` -expect(received).not.toBe(expected) // Object.is equality +expect(received).not.toBe(expected) // Object.is equality -Expected: not "a" +Expected: not "a" `; exports[`.toBe() fails for '[]' with '.not' 1`] = ` -expect(received).not.toBe(expected) // Object.is equality +expect(received).not.toBe(expected) // Object.is equality -Expected: not [] +Expected: not [] `; exports[`.toBe() fails for '{}' with '.not' 1`] = ` -expect(received).not.toBe(expected) // Object.is equality +expect(received).not.toBe(expected) // Object.is equality -Expected: not {} +Expected: not {} `; exports[`.toBe() fails for '1' with '.not' 1`] = ` -expect(received).not.toBe(expected) // Object.is equality +expect(received).not.toBe(expected) // Object.is equality -Expected: not 1 +Expected: not 1 `; exports[`.toBe() fails for 'false' with '.not' 1`] = ` -expect(received).not.toBe(expected) // Object.is equality +expect(received).not.toBe(expected) // Object.is equality -Expected: not false +Expected: not false `; exports[`.toBe() fails for 'null' with '.not' 1`] = ` -expect(received).not.toBe(expected) // Object.is equality +expect(received).not.toBe(expected) // Object.is equality -Expected: not null +Expected: not null `; exports[`.toBe() fails for 'undefined' with '.not' 1`] = ` -expect(received).not.toBe(expected) // Object.is equality +expect(received).not.toBe(expected) // Object.is equality -Expected: not undefined +Expected: not undefined `; exports[`.toBe() fails for: "" and "compare one-line string to empty string" 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: "compare one-line string to empty string" -Received: "" +Expected: "compare one-line string to empty string" +Received: "" `; exports[`.toBe() fails for: "abc" and "cde" 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: "cde" -Received: "abc" +Expected: "cde" +Received: "abc" `; exports[`.toBe() fails for: "four @@ -298,1486 +298,1486 @@ line string" and "3 line string" 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -- Expected - 1 -+ Received + 2 +- Expected - 1 ++ Received + 2 -- 3 -+ four -+ 4 - line - string +- 3 ++ four ++ 4 + line + string `; exports[`.toBe() fails for: "painless JavaScript testing" and "delightful JavaScript testing" 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: "delightful JavaScript testing" -Received: "painless JavaScript testing" +Expected: "delightful JavaScript testing" +Received: "painless JavaScript testing" `; exports[`.toBe() fails for: "with trailing space" and "without trailing space" 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -- Expected - 1 -+ Received + 2 +- Expected - 1 ++ Received + 2 -- without trailing space -+ with -+ trailing space +- without trailing space ++ with ++ trailing space `; exports[`.toBe() fails for: /received/ and /expected/ 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: /expected/ -Received: /received/ +Expected: /expected/ +Received: /received/ `; exports[`.toBe() fails for: [] and [] 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -If it should pass with deep equality, replace "toBe" with "toStrictEqual" +If it should pass with deep equality, replace "toBe" with "toStrictEqual" -Expected: [] +Expected: [] Received: serializes to the same string `; exports[`.toBe() fails for: [Error: received] and [Error: expected] 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: [Error: expected] -Received: [Error: received] +Expected: [Error: expected] +Received: [Error: received] `; exports[`.toBe() fails for: [Function anonymous] and [Function anonymous] 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: [Function anonymous] +Expected: [Function anonymous] Received: serializes to the same string `; exports[`.toBe() fails for: {"a": [Function a], "b": 2} and {"a": Any, "b": 2} 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -If it should pass with deep equality, replace "toBe" with "toStrictEqual" +If it should pass with deep equality, replace "toBe" with "toStrictEqual" -Expected: {"a": Any, "b": 2} -Received: {"a": [Function a], "b": 2} +Expected: {"a": Any, "b": 2} +Received: {"a": [Function a], "b": 2} `; exports[`.toBe() fails for: {"a": 1} and {"a": 1} 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -If it should pass with deep equality, replace "toBe" with "toStrictEqual" +If it should pass with deep equality, replace "toBe" with "toStrictEqual" -Expected: {"a": 1} +Expected: {"a": 1} Received: serializes to the same string `; exports[`.toBe() fails for: {"a": 1} and {"a": 5} 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": 5, -+ "a": 1, - } + Object { +- "a": 5, ++ "a": 1, + } `; exports[`.toBe() fails for: {"a": undefined, "b": 2} and {"b": 2} 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -If it should pass with deep equality, replace "toBe" with "toEqual" +If it should pass with deep equality, replace "toBe" with "toEqual" -- Expected - 0 -+ Received + 1 +- Expected - 0 ++ Received + 1 - Object { -+ "a": undefined, - "b": 2, - } + Object { ++ "a": undefined, + "b": 2, + } `; exports[`.toBe() fails for: {} and {} 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -If it should pass with deep equality, replace "toBe" with "toStrictEqual" +If it should pass with deep equality, replace "toBe" with "toStrictEqual" -Expected: {} +Expected: {} Received: serializes to the same string `; exports[`.toBe() fails for: -0 and 0 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: 0 -Received: -0 +Expected: 0 +Received: -0 `; exports[`.toBe() fails for: 1 and 2 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: 2 -Received: 1 +Expected: 2 +Received: 1 `; exports[`.toBe() fails for: 2020-02-20T00:00:00.000Z and 2020-02-20T00:00:00.000Z 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -If it should pass with deep equality, replace "toBe" with "toStrictEqual" +If it should pass with deep equality, replace "toBe" with "toStrictEqual" -Expected: 2020-02-20T00:00:00.000Z +Expected: 2020-02-20T00:00:00.000Z Received: serializes to the same string `; exports[`.toBe() fails for: 2020-02-21T00:00:00.000Z and 2020-02-20T00:00:00.000Z 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: 2020-02-20T00:00:00.000Z -Received: 2020-02-21T00:00:00.000Z +Expected: 2020-02-20T00:00:00.000Z +Received: 2020-02-21T00:00:00.000Z `; exports[`.toBe() fails for: Symbol(received) and Symbol(expected) 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: Symbol(expected) -Received: Symbol(received) +Expected: Symbol(expected) +Received: Symbol(received) `; exports[`.toBe() fails for: null and undefined 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: undefined -Received: null +Expected: undefined +Received: null `; exports[`.toBe() fails for: true and false 1`] = ` -expect(received).toBe(expected) // Object.is equality +expect(received).toBe(expected) // Object.is equality -Expected: false -Received: true +Expected: false +Received: true `; exports[`.toBeCloseTo {pass: false} expect(-Infinity).toBeCloseTo(-1.23) 1`] = ` -expect(received).toBeCloseTo(expected) +expect(received).toBeCloseTo(expected) -Expected: -1.23 -Received: -Infinity +Expected: -1.23 +Received: -Infinity Expected precision: 2 -Expected difference: < 0.005 -Received difference: Infinity +Expected difference: < 0.005 +Received difference: Infinity `; exports[`.toBeCloseTo {pass: false} expect(0).toBeCloseTo(0.01) 1`] = ` -expect(received).toBeCloseTo(expected) +expect(received).toBeCloseTo(expected) -Expected: 0.01 -Received: 0 +Expected: 0.01 +Received: 0 Expected precision: 2 -Expected difference: < 0.005 -Received difference: 0.01 +Expected difference: < 0.005 +Received difference: 0.01 `; exports[`.toBeCloseTo {pass: false} expect(1).toBeCloseTo(1.23) 1`] = ` -expect(received).toBeCloseTo(expected) +expect(received).toBeCloseTo(expected) -Expected: 1.23 -Received: 1 +Expected: 1.23 +Received: 1 Expected precision: 2 -Expected difference: < 0.005 -Received difference: 0.22999999999999998 +Expected difference: < 0.005 +Received difference: 0.22999999999999998 `; exports[`.toBeCloseTo {pass: false} expect(1.23).toBeCloseTo(1.2249999) 1`] = ` -expect(received).toBeCloseTo(expected) +expect(received).toBeCloseTo(expected) -Expected: 1.2249999 -Received: 1.23 +Expected: 1.2249999 +Received: 1.23 Expected precision: 2 -Expected difference: < 0.005 -Received difference: 0.005000099999999952 +Expected difference: < 0.005 +Received difference: 0.005000099999999952 `; exports[`.toBeCloseTo {pass: false} expect(3.141592e-7).toBeCloseTo(3e-7, 8) 1`] = ` -expect(received).toBeCloseTo(expected, precision) +expect(received).toBeCloseTo(expected, precision) -Expected: 3e-7 -Received: 3.141592e-7 +Expected: 3e-7 +Received: 3.141592e-7 Expected precision: 8 -Expected difference: < 5e-9 -Received difference: 1.4159200000000025e-8 +Expected difference: < 5e-9 +Received difference: 1.4159200000000025e-8 `; exports[`.toBeCloseTo {pass: false} expect(56789).toBeCloseTo(51234, -4) 1`] = ` -expect(received).toBeCloseTo(expected, precision) +expect(received).toBeCloseTo(expected, precision) -Expected: 51234 -Received: 56789 +Expected: 51234 +Received: 56789 Expected precision: -4 -Expected difference: < 5000 -Received difference: 5555 +Expected difference: < 5000 +Received difference: 5555 `; exports[`.toBeCloseTo {pass: false} expect(Infinity).toBeCloseTo(-Infinity) 1`] = ` -expect(received).toBeCloseTo(expected) +expect(received).toBeCloseTo(expected) -Expected: -Infinity -Received: Infinity +Expected: -Infinity +Received: Infinity Expected precision: 2 -Expected difference: < 0.005 -Received difference: Infinity +Expected difference: < 0.005 +Received difference: Infinity `; exports[`.toBeCloseTo {pass: false} expect(Infinity).toBeCloseTo(1.23) 1`] = ` -expect(received).toBeCloseTo(expected) +expect(received).toBeCloseTo(expected) -Expected: 1.23 -Received: Infinity +Expected: 1.23 +Received: Infinity Expected precision: 2 -Expected difference: < 0.005 -Received difference: Infinity +Expected difference: < 0.005 +Received difference: Infinity `; exports[`.toBeCloseTo {pass: true} expect(-Infinity).toBeCloseTo(-Infinity) 1`] = ` -expect(received).not.toBeCloseTo(expected) +expect(received).not.toBeCloseTo(expected) -Expected: not -Infinity +Expected: not -Infinity `; exports[`.toBeCloseTo {pass: true} expect(0).toBeCloseTo(0) 1`] = ` -expect(received).not.toBeCloseTo(expected) +expect(received).not.toBeCloseTo(expected) -Expected: not 0 +Expected: not 0 `; exports[`.toBeCloseTo {pass: true} expect(0).toBeCloseTo(0.000004, 5) 1`] = ` -expect(received).not.toBeCloseTo(expected, precision) +expect(received).not.toBeCloseTo(expected, precision) -Expected: not 0.000004 -Received: 0 +Expected: not 0.000004 +Received: 0 Expected precision: 5 -Expected difference: not < 0.000005 -Received difference: 0.000004 +Expected difference: not < 0.000005 +Received difference: 0.000004 `; exports[`.toBeCloseTo {pass: true} expect(0).toBeCloseTo(0.0001, 3) 1`] = ` -expect(received).not.toBeCloseTo(expected, precision) +expect(received).not.toBeCloseTo(expected, precision) -Expected: not 0.0001 -Received: 0 +Expected: not 0.0001 +Received: 0 Expected precision: 3 -Expected difference: not < 0.0005 -Received difference: 0.0001 +Expected difference: not < 0.0005 +Received difference: 0.0001 `; exports[`.toBeCloseTo {pass: true} expect(0).toBeCloseTo(0.001) 1`] = ` -expect(received).not.toBeCloseTo(expected) +expect(received).not.toBeCloseTo(expected) -Expected: not 0.001 -Received: 0 +Expected: not 0.001 +Received: 0 Expected precision: 2 -Expected difference: not < 0.005 -Received difference: 0.001 +Expected difference: not < 0.005 +Received difference: 0.001 `; exports[`.toBeCloseTo {pass: true} expect(0).toBeCloseTo(0.1, 0) 1`] = ` -expect(received).not.toBeCloseTo(expected, precision) +expect(received).not.toBeCloseTo(expected, precision) -Expected: not 0.1 -Received: 0 +Expected: not 0.1 +Received: 0 Expected precision: 0 -Expected difference: not < 0.5 -Received difference: 0.1 +Expected difference: not < 0.5 +Received difference: 0.1 `; exports[`.toBeCloseTo {pass: true} expect(1.23).toBeCloseTo(1.225) 1`] = ` -expect(received).not.toBeCloseTo(expected) +expect(received).not.toBeCloseTo(expected) -Expected: not 1.225 -Received: 1.23 +Expected: not 1.225 +Received: 1.23 Expected precision: 2 -Expected difference: not < 0.005 -Received difference: 0.004999999999999893 +Expected difference: not < 0.005 +Received difference: 0.004999999999999893 `; exports[`.toBeCloseTo {pass: true} expect(1.23).toBeCloseTo(1.226) 1`] = ` -expect(received).not.toBeCloseTo(expected) +expect(received).not.toBeCloseTo(expected) -Expected: not 1.226 -Received: 1.23 +Expected: not 1.226 +Received: 1.23 Expected precision: 2 -Expected difference: not < 0.005 -Received difference: 0.0040000000000000036 +Expected difference: not < 0.005 +Received difference: 0.0040000000000000036 `; exports[`.toBeCloseTo {pass: true} expect(1.23).toBeCloseTo(1.229) 1`] = ` -expect(received).not.toBeCloseTo(expected) +expect(received).not.toBeCloseTo(expected) -Expected: not 1.229 -Received: 1.23 +Expected: not 1.229 +Received: 1.23 Expected precision: 2 -Expected difference: not < 0.005 -Received difference: 0.0009999999999998899 +Expected difference: not < 0.005 +Received difference: 0.0009999999999998899 `; exports[`.toBeCloseTo {pass: true} expect(1.23).toBeCloseTo(1.234) 1`] = ` -expect(received).not.toBeCloseTo(expected) +expect(received).not.toBeCloseTo(expected) -Expected: not 1.234 -Received: 1.23 +Expected: not 1.234 +Received: 1.23 Expected precision: 2 -Expected difference: not < 0.005 -Received difference: 0.0040000000000000036 +Expected difference: not < 0.005 +Received difference: 0.0040000000000000036 `; exports[`.toBeCloseTo {pass: true} expect(2.0000002).toBeCloseTo(2, 5) 1`] = ` -expect(received).not.toBeCloseTo(expected, precision) +expect(received).not.toBeCloseTo(expected, precision) -Expected: not 2 -Received: 2.0000002 +Expected: not 2 +Received: 2.0000002 Expected precision: 5 -Expected difference: not < 5e-6 -Received difference: 2.0000000011677344e-7 +Expected difference: not < 5e-6 +Received difference: 2.0000000011677344e-7 `; exports[`.toBeCloseTo {pass: true} expect(Infinity).toBeCloseTo(Infinity) 1`] = ` -expect(received).not.toBeCloseTo(expected) +expect(received).not.toBeCloseTo(expected) -Expected: not Infinity +Expected: not Infinity `; exports[`.toBeCloseTo throws: Matcher error promise empty isNot false received 1`] = ` -expect(received).toBeCloseTo(expected, precision) +expect(received).toBeCloseTo(expected, precision) -Matcher error: received value must be a number +Matcher error: received value must be a number Received has type: string Received has value: "" `; exports[`.toBeCloseTo throws: Matcher error promise empty isNot true expected 1`] = ` -expect(received).not.toBeCloseTo(expected) +expect(received).not.toBeCloseTo(expected) -Matcher error: expected value must be a number +Matcher error: expected value must be a number Expected has value: undefined `; exports[`.toBeCloseTo throws: Matcher error promise rejects isNot false expected 1`] = ` -expect(received).rejects.toBeCloseTo(expected) +expect(received).rejects.toBeCloseTo(expected) -Matcher error: expected value must be a number +Matcher error: expected value must be a number Expected has type: string Expected has value: "0" `; exports[`.toBeCloseTo throws: Matcher error promise rejects isNot true received 1`] = ` -expect(received).rejects.not.toBeCloseTo(expected) +expect(received).rejects.not.toBeCloseTo(expected) -Matcher error: received value must be a number +Matcher error: received value must be a number Received has type: symbol Received has value: Symbol(0.1) `; exports[`.toBeCloseTo throws: Matcher error promise resolves isNot false received 1`] = ` -expect(received).resolves.toBeCloseTo(expected, precision) +expect(received).resolves.toBeCloseTo(expected, precision) -Matcher error: received value must be a number +Matcher error: received value must be a number Received has type: boolean Received has value: false `; exports[`.toBeCloseTo throws: Matcher error promise resolves isNot true expected 1`] = ` -expect(received).resolves.not.toBeCloseTo(expected, precision) +expect(received).resolves.not.toBeCloseTo(expected, precision) -Matcher error: expected value must be a number +Matcher error: expected value must be a number Expected has value: null `; exports[`.toBeDefined(), .toBeUndefined() '"a"' is defined 1`] = ` -expect(received).not.toBeDefined() +expect(received).not.toBeDefined() -Received: "a" +Received: "a" `; exports[`.toBeDefined(), .toBeUndefined() '"a"' is defined 2`] = ` -expect(received).toBeUndefined() +expect(received).toBeUndefined() -Received: "a" +Received: "a" `; exports[`.toBeDefined(), .toBeUndefined() '[]' is defined 1`] = ` -expect(received).not.toBeDefined() +expect(received).not.toBeDefined() -Received: [] +Received: [] `; exports[`.toBeDefined(), .toBeUndefined() '[]' is defined 2`] = ` -expect(received).toBeUndefined() +expect(received).toBeUndefined() -Received: [] +Received: [] `; exports[`.toBeDefined(), .toBeUndefined() '[Function anonymous]' is defined 1`] = ` -expect(received).not.toBeDefined() +expect(received).not.toBeDefined() -Received: [Function anonymous] +Received: [Function anonymous] `; exports[`.toBeDefined(), .toBeUndefined() '[Function anonymous]' is defined 2`] = ` -expect(received).toBeUndefined() +expect(received).toBeUndefined() -Received: [Function anonymous] +Received: [Function anonymous] `; exports[`.toBeDefined(), .toBeUndefined() '{}' is defined 1`] = ` -expect(received).not.toBeDefined() +expect(received).not.toBeDefined() -Received: {} +Received: {} `; exports[`.toBeDefined(), .toBeUndefined() '{}' is defined 2`] = ` -expect(received).toBeUndefined() +expect(received).toBeUndefined() -Received: {} +Received: {} `; exports[`.toBeDefined(), .toBeUndefined() '0.5' is defined 1`] = ` -expect(received).not.toBeDefined() +expect(received).not.toBeDefined() -Received: 0.5 +Received: 0.5 `; exports[`.toBeDefined(), .toBeUndefined() '0.5' is defined 2`] = ` -expect(received).toBeUndefined() +expect(received).toBeUndefined() -Received: 0.5 +Received: 0.5 `; exports[`.toBeDefined(), .toBeUndefined() '1' is defined 1`] = ` -expect(received).not.toBeDefined() +expect(received).not.toBeDefined() -Received: 1 +Received: 1 `; exports[`.toBeDefined(), .toBeUndefined() '1' is defined 2`] = ` -expect(received).toBeUndefined() +expect(received).toBeUndefined() -Received: 1 +Received: 1 `; exports[`.toBeDefined(), .toBeUndefined() 'Infinity' is defined 1`] = ` -expect(received).not.toBeDefined() +expect(received).not.toBeDefined() -Received: Infinity +Received: Infinity `; exports[`.toBeDefined(), .toBeUndefined() 'Infinity' is defined 2`] = ` -expect(received).toBeUndefined() +expect(received).toBeUndefined() -Received: Infinity +Received: Infinity `; exports[`.toBeDefined(), .toBeUndefined() 'Map {}' is defined 1`] = ` -expect(received).not.toBeDefined() +expect(received).not.toBeDefined() -Received: Map {} +Received: Map {} `; exports[`.toBeDefined(), .toBeUndefined() 'Map {}' is defined 2`] = ` -expect(received).toBeUndefined() +expect(received).toBeUndefined() -Received: Map {} +Received: Map {} `; exports[`.toBeDefined(), .toBeUndefined() 'true' is defined 1`] = ` -expect(received).not.toBeDefined() +expect(received).not.toBeDefined() -Received: true +Received: true `; exports[`.toBeDefined(), .toBeUndefined() 'true' is defined 2`] = ` -expect(received).toBeUndefined() +expect(received).toBeUndefined() -Received: true +Received: true `; exports[`.toBeDefined(), .toBeUndefined() undefined is undefined 1`] = ` -expect(received).toBeDefined() +expect(received).toBeDefined() -Received: undefined +Received: undefined `; exports[`.toBeDefined(), .toBeUndefined() undefined is undefined 2`] = ` -expect(received).not.toBeUndefined() +expect(received).not.toBeUndefined() -Received: undefined +Received: undefined `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [-Infinity, -Infinity] 1`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= -Infinity -Received: -Infinity +Expected: not >= -Infinity +Received: -Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [-Infinity, -Infinity] 2`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= -Infinity -Received: -Infinity +Expected: not <= -Infinity +Received: -Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [1, 1] 1`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= 1 -Received: 1 +Expected: not >= 1 +Received: 1 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [1, 1] 2`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= 1 -Received: 1 +Expected: not <= 1 +Received: 1 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [1.7976931348623157e+308, 1.7976931348623157e+308] 1`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= 1.7976931348623157e+308 -Received: 1.7976931348623157e+308 +Expected: not >= 1.7976931348623157e+308 +Received: 1.7976931348623157e+308 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [1.7976931348623157e+308, 1.7976931348623157e+308] 2`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= 1.7976931348623157e+308 -Received: 1.7976931348623157e+308 +Expected: not <= 1.7976931348623157e+308 +Received: 1.7976931348623157e+308 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [5e-324, 5e-324] 1`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= 5e-324 -Received: 5e-324 +Expected: not >= 5e-324 +Received: 5e-324 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [5e-324, 5e-324] 2`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= 5e-324 -Received: 5e-324 +Expected: not <= 5e-324 +Received: 5e-324 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [Infinity, Infinity] 1`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= Infinity -Received: Infinity +Expected: not >= Infinity +Received: Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [Infinity, Infinity] 2`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= Infinity -Received: Infinity +Expected: not <= Infinity +Received: Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 1`] = ` -expect(received).toBeGreaterThan(expected) +expect(received).toBeGreaterThan(expected) -Expected: > Infinity -Received: -Infinity +Expected: > Infinity +Received: -Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 2`] = ` -expect(received).not.toBeLessThan(expected) +expect(received).not.toBeLessThan(expected) -Expected: not < Infinity -Received: -Infinity +Expected: not < Infinity +Received: -Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 3`] = ` -expect(received).not.toBeGreaterThan(expected) +expect(received).not.toBeGreaterThan(expected) -Expected: not > -Infinity -Received: Infinity +Expected: not > -Infinity +Received: Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 4`] = ` -expect(received).toBeLessThan(expected) +expect(received).toBeLessThan(expected) -Expected: < -Infinity -Received: Infinity +Expected: < -Infinity +Received: Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 5`] = ` -expect(received).toBeGreaterThanOrEqual(expected) +expect(received).toBeGreaterThanOrEqual(expected) -Expected: >= Infinity -Received: -Infinity +Expected: >= Infinity +Received: -Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 6`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= Infinity -Received: -Infinity +Expected: not <= Infinity +Received: -Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 7`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= -Infinity -Received: Infinity +Expected: not >= -Infinity +Received: Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 8`] = ` -expect(received).toBeLessThanOrEqual(expected) +expect(received).toBeLessThanOrEqual(expected) -Expected: <= -Infinity -Received: Infinity +Expected: <= -Infinity +Received: Infinity `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 1`] = ` -expect(received).toBeGreaterThan(expected) +expect(received).toBeGreaterThan(expected) -Expected: > 0.2 -Received: 0.1 +Expected: > 0.2 +Received: 0.1 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 2`] = ` -expect(received).not.toBeLessThan(expected) +expect(received).not.toBeLessThan(expected) -Expected: not < 0.2 -Received: 0.1 +Expected: not < 0.2 +Received: 0.1 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 3`] = ` -expect(received).not.toBeGreaterThan(expected) +expect(received).not.toBeGreaterThan(expected) -Expected: not > 0.1 -Received: 0.2 +Expected: not > 0.1 +Received: 0.2 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 4`] = ` -expect(received).toBeLessThan(expected) +expect(received).toBeLessThan(expected) -Expected: < 0.1 -Received: 0.2 +Expected: < 0.1 +Received: 0.2 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 5`] = ` -expect(received).toBeGreaterThanOrEqual(expected) +expect(received).toBeGreaterThanOrEqual(expected) -Expected: >= 0.2 -Received: 0.1 +Expected: >= 0.2 +Received: 0.1 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 6`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= 0.2 -Received: 0.1 +Expected: not <= 0.2 +Received: 0.1 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 7`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= 0.1 -Received: 0.2 +Expected: not >= 0.1 +Received: 0.2 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 8`] = ` -expect(received).toBeLessThanOrEqual(expected) +expect(received).toBeLessThanOrEqual(expected) -Expected: <= 0.1 -Received: 0.2 +Expected: <= 0.1 +Received: 0.2 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 1`] = ` -expect(received).toBeGreaterThan(expected) +expect(received).toBeGreaterThan(expected) -Expected: > 2 -Received: 1 +Expected: > 2 +Received: 1 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 2`] = ` -expect(received).not.toBeLessThan(expected) +expect(received).not.toBeLessThan(expected) -Expected: not < 2 -Received: 1 +Expected: not < 2 +Received: 1 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 3`] = ` -expect(received).not.toBeGreaterThan(expected) +expect(received).not.toBeGreaterThan(expected) -Expected: not > 1 -Received: 2 +Expected: not > 1 +Received: 2 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 4`] = ` -expect(received).toBeLessThan(expected) +expect(received).toBeLessThan(expected) -Expected: < 1 -Received: 2 +Expected: < 1 +Received: 2 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 5`] = ` -expect(received).toBeGreaterThanOrEqual(expected) +expect(received).toBeGreaterThanOrEqual(expected) -Expected: >= 2 -Received: 1 +Expected: >= 2 +Received: 1 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 6`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= 2 -Received: 1 +Expected: not <= 2 +Received: 1 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 7`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= 1 -Received: 2 +Expected: not >= 1 +Received: 2 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 8`] = ` -expect(received).toBeLessThanOrEqual(expected) +expect(received).toBeLessThanOrEqual(expected) -Expected: <= 1 -Received: 2 +Expected: <= 1 +Received: 2 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 1`] = ` -expect(received).toBeGreaterThan(expected) +expect(received).toBeGreaterThan(expected) -Expected: > 7 -Received: 3 +Expected: > 7 +Received: 3 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 2`] = ` -expect(received).not.toBeLessThan(expected) +expect(received).not.toBeLessThan(expected) -Expected: not < 7 -Received: 3 +Expected: not < 7 +Received: 3 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 3`] = ` -expect(received).not.toBeGreaterThan(expected) +expect(received).not.toBeGreaterThan(expected) -Expected: not > 3 -Received: 7 +Expected: not > 3 +Received: 7 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 4`] = ` -expect(received).toBeLessThan(expected) +expect(received).toBeLessThan(expected) -Expected: < 3 -Received: 7 +Expected: < 3 +Received: 7 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 5`] = ` -expect(received).toBeGreaterThanOrEqual(expected) +expect(received).toBeGreaterThanOrEqual(expected) -Expected: >= 7 -Received: 3 +Expected: >= 7 +Received: 3 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 6`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= 7 -Received: 3 +Expected: not <= 7 +Received: 3 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 7`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= 3 -Received: 7 +Expected: not >= 3 +Received: 7 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 8`] = ` -expect(received).toBeLessThanOrEqual(expected) +expect(received).toBeLessThanOrEqual(expected) -Expected: <= 3 -Received: 7 +Expected: <= 3 +Received: 7 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 1`] = ` -expect(received).toBeGreaterThan(expected) +expect(received).toBeGreaterThan(expected) -Expected: > 1.7976931348623157e+308 -Received: 5e-324 +Expected: > 1.7976931348623157e+308 +Received: 5e-324 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 2`] = ` -expect(received).not.toBeLessThan(expected) +expect(received).not.toBeLessThan(expected) -Expected: not < 1.7976931348623157e+308 -Received: 5e-324 +Expected: not < 1.7976931348623157e+308 +Received: 5e-324 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 3`] = ` -expect(received).not.toBeGreaterThan(expected) +expect(received).not.toBeGreaterThan(expected) -Expected: not > 5e-324 -Received: 1.7976931348623157e+308 +Expected: not > 5e-324 +Received: 1.7976931348623157e+308 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 4`] = ` -expect(received).toBeLessThan(expected) +expect(received).toBeLessThan(expected) -Expected: < 5e-324 -Received: 1.7976931348623157e+308 +Expected: < 5e-324 +Received: 1.7976931348623157e+308 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 5`] = ` -expect(received).toBeGreaterThanOrEqual(expected) +expect(received).toBeGreaterThanOrEqual(expected) -Expected: >= 1.7976931348623157e+308 -Received: 5e-324 +Expected: >= 1.7976931348623157e+308 +Received: 5e-324 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 6`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= 1.7976931348623157e+308 -Received: 5e-324 +Expected: not <= 1.7976931348623157e+308 +Received: 5e-324 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 7`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= 5e-324 -Received: 1.7976931348623157e+308 +Expected: not >= 5e-324 +Received: 1.7976931348623157e+308 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 8`] = ` -expect(received).toBeLessThanOrEqual(expected) +expect(received).toBeLessThanOrEqual(expected) -Expected: <= 5e-324 -Received: 1.7976931348623157e+308 +Expected: <= 5e-324 +Received: 1.7976931348623157e+308 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 1`] = ` -expect(received).toBeGreaterThan(expected) +expect(received).toBeGreaterThan(expected) -Expected: > 18 -Received: 9 +Expected: > 18 +Received: 9 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 2`] = ` -expect(received).not.toBeLessThan(expected) +expect(received).not.toBeLessThan(expected) -Expected: not < 18 -Received: 9 +Expected: not < 18 +Received: 9 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 3`] = ` -expect(received).not.toBeGreaterThan(expected) +expect(received).not.toBeGreaterThan(expected) -Expected: not > 9 -Received: 18 +Expected: not > 9 +Received: 18 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 4`] = ` -expect(received).toBeLessThan(expected) +expect(received).toBeLessThan(expected) -Expected: < 9 -Received: 18 +Expected: < 9 +Received: 18 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 5`] = ` -expect(received).toBeGreaterThanOrEqual(expected) +expect(received).toBeGreaterThanOrEqual(expected) -Expected: >= 18 -Received: 9 +Expected: >= 18 +Received: 9 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 6`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= 18 -Received: 9 +Expected: not <= 18 +Received: 9 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 7`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= 9 -Received: 18 +Expected: not >= 9 +Received: 18 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 8`] = ` -expect(received).toBeLessThanOrEqual(expected) +expect(received).toBeLessThanOrEqual(expected) -Expected: <= 9 -Received: 18 +Expected: <= 9 +Received: 18 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 1`] = ` -expect(received).toBeGreaterThan(expected) +expect(received).toBeGreaterThan(expected) -Expected: > 34 -Received: 17 +Expected: > 34 +Received: 17 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 2`] = ` -expect(received).not.toBeLessThan(expected) +expect(received).not.toBeLessThan(expected) -Expected: not < 34 -Received: 17 +Expected: not < 34 +Received: 17 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 3`] = ` -expect(received).not.toBeGreaterThan(expected) +expect(received).not.toBeGreaterThan(expected) -Expected: not > 17 -Received: 34 +Expected: not > 17 +Received: 34 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 4`] = ` -expect(received).toBeLessThan(expected) +expect(received).toBeLessThan(expected) -Expected: < 17 -Received: 34 +Expected: < 17 +Received: 34 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 5`] = ` -expect(received).toBeGreaterThanOrEqual(expected) +expect(received).toBeGreaterThanOrEqual(expected) -Expected: >= 34 -Received: 17 +Expected: >= 34 +Received: 17 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 6`] = ` -expect(received).not.toBeLessThanOrEqual(expected) +expect(received).not.toBeLessThanOrEqual(expected) -Expected: not <= 34 -Received: 17 +Expected: not <= 34 +Received: 17 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 7`] = ` -expect(received).not.toBeGreaterThanOrEqual(expected) +expect(received).not.toBeGreaterThanOrEqual(expected) -Expected: not >= 17 -Received: 34 +Expected: not >= 17 +Received: 34 `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 8`] = ` -expect(received).toBeLessThanOrEqual(expected) +expect(received).toBeLessThanOrEqual(expected) -Expected: <= 17 -Received: 34 +Expected: <= 17 +Received: 34 `; exports[`.toBeInstanceOf() failing "a" and [Function String] 1`] = ` -expect(received).toBeInstanceOf(expected) +expect(received).toBeInstanceOf(expected) -Expected constructor: String +Expected constructor: String Received value has no prototype -Received value: "a" +Received value: "a" `; exports[`.toBeInstanceOf() failing /\\w+/ and [Function anonymous] 1`] = ` -expect(received).toBeInstanceOf(expected) +expect(received).toBeInstanceOf(expected) Expected constructor name is an empty string -Received constructor: RegExp +Received constructor: RegExp `; exports[`.toBeInstanceOf() failing {} and [Function A] 1`] = ` -expect(received).toBeInstanceOf(expected) +expect(received).toBeInstanceOf(expected) -Expected constructor: A +Expected constructor: A Received value has no prototype -Received value: {} +Received value: {} `; exports[`.toBeInstanceOf() failing {} and [Function B] 1`] = ` -expect(received).toBeInstanceOf(expected) +expect(received).toBeInstanceOf(expected) -Expected constructor: B -Received constructor: A +Expected constructor: B +Received constructor: A `; exports[`.toBeInstanceOf() failing {} and [Function RegExp] 1`] = ` -expect(received).toBeInstanceOf(expected) +expect(received).toBeInstanceOf(expected) -Expected constructor: RegExp +Expected constructor: RegExp Received constructor name is an empty string `; exports[`.toBeInstanceOf() failing 1 and [Function Number] 1`] = ` -expect(received).toBeInstanceOf(expected) +expect(received).toBeInstanceOf(expected) -Expected constructor: Number +Expected constructor: Number Received value has no prototype -Received value: 1 +Received value: 1 `; exports[`.toBeInstanceOf() failing null and [Function String] 1`] = ` -expect(received).toBeInstanceOf(expected) +expect(received).toBeInstanceOf(expected) -Expected constructor: String +Expected constructor: String Received value has no prototype -Received value: null +Received value: null `; exports[`.toBeInstanceOf() failing true and [Function Boolean] 1`] = ` -expect(received).toBeInstanceOf(expected) +expect(received).toBeInstanceOf(expected) -Expected constructor: Boolean +Expected constructor: Boolean Received value has no prototype -Received value: true +Received value: true `; exports[`.toBeInstanceOf() failing undefined and [Function String] 1`] = ` -expect(received).toBeInstanceOf(expected) +expect(received).toBeInstanceOf(expected) -Expected constructor: String +Expected constructor: String Received value has no prototype -Received value: undefined +Received value: undefined `; exports[`.toBeInstanceOf() passing [] and [Function Array] 1`] = ` -expect(received).not.toBeInstanceOf(expected) +expect(received).not.toBeInstanceOf(expected) -Expected constructor: not Array +Expected constructor: not Array `; exports[`.toBeInstanceOf() passing {} and [Function A] 1`] = ` -expect(received).not.toBeInstanceOf(expected) +expect(received).not.toBeInstanceOf(expected) -Expected constructor: not A +Expected constructor: not A `; exports[`.toBeInstanceOf() passing {} and [Function B] 1`] = ` -expect(received).not.toBeInstanceOf(expected) +expect(received).not.toBeInstanceOf(expected) -Expected constructor: not B -Received constructor: C extends B +Expected constructor: not B +Received constructor: C extends B `; exports[`.toBeInstanceOf() passing {} and [Function B] 2`] = ` -expect(received).not.toBeInstanceOf(expected) +expect(received).not.toBeInstanceOf(expected) -Expected constructor: not B -Received constructor: E extends … extends B +Expected constructor: not B +Received constructor: E extends … extends B `; exports[`.toBeInstanceOf() passing {} and [Function B] 3`] = ` -expect(received).not.toBeInstanceOf(expected) +expect(received).not.toBeInstanceOf(expected) -Expected constructor: not B +Expected constructor: not B Received constructor name is not a string `; exports[`.toBeInstanceOf() passing {} and [Function anonymous] 1`] = ` -expect(received).not.toBeInstanceOf(expected) +expect(received).not.toBeInstanceOf(expected) Expected constructor name is an empty string -Received constructor: SubHasNameProp +Received constructor: SubHasNameProp `; exports[`.toBeInstanceOf() passing {} and [Function name() {}] 1`] = ` -expect(received).not.toBeInstanceOf(expected) +expect(received).not.toBeInstanceOf(expected) Expected constructor name is not a string `; exports[`.toBeInstanceOf() passing Map {} and [Function Map] 1`] = ` -expect(received).not.toBeInstanceOf(expected) +expect(received).not.toBeInstanceOf(expected) -Expected constructor: not Map +Expected constructor: not Map `; exports[`.toBeInstanceOf() throws if constructor is not a function 1`] = ` -expect(received).toBeInstanceOf(expected) +expect(received).toBeInstanceOf(expected) -Matcher error: expected value must be a function +Matcher error: expected value must be a function Expected has type: number Expected has value: 4 `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 1`] = ` -expect(received).not.toBeNaN() +expect(received).not.toBeNaN() -Received: NaN +Received: NaN `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 2`] = ` -expect(received).not.toBeNaN() +expect(received).not.toBeNaN() -Received: NaN +Received: NaN `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 3`] = ` -expect(received).not.toBeNaN() +expect(received).not.toBeNaN() -Received: NaN +Received: NaN `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 4`] = ` -expect(received).not.toBeNaN() +expect(received).not.toBeNaN() -Received: NaN +Received: NaN `; exports[`.toBeNaN() throws 1`] = ` -expect(received).toBeNaN() +expect(received).toBeNaN() -Received: 1 +Received: 1 `; exports[`.toBeNaN() throws 2`] = ` -expect(received).toBeNaN() +expect(received).toBeNaN() -Received: "" +Received: "" `; exports[`.toBeNaN() throws 3`] = ` -expect(received).toBeNaN() +expect(received).toBeNaN() -Received: null +Received: null `; exports[`.toBeNaN() throws 4`] = ` -expect(received).toBeNaN() +expect(received).toBeNaN() -Received: undefined +Received: undefined `; exports[`.toBeNaN() throws 5`] = ` -expect(received).toBeNaN() +expect(received).toBeNaN() -Received: {} +Received: {} `; exports[`.toBeNaN() throws 6`] = ` -expect(received).toBeNaN() +expect(received).toBeNaN() -Received: [] +Received: [] `; exports[`.toBeNaN() throws 7`] = ` -expect(received).toBeNaN() +expect(received).toBeNaN() -Received: 0.2 +Received: 0.2 `; exports[`.toBeNaN() throws 8`] = ` -expect(received).toBeNaN() +expect(received).toBeNaN() -Received: 0 +Received: 0 `; exports[`.toBeNaN() throws 9`] = ` -expect(received).toBeNaN() +expect(received).toBeNaN() -Received: Infinity +Received: Infinity `; exports[`.toBeNaN() throws 10`] = ` -expect(received).toBeNaN() +expect(received).toBeNaN() -Received: -Infinity +Received: -Infinity `; exports[`.toBeNull() fails for '"a"' 1`] = ` -expect(received).toBeNull() +expect(received).toBeNull() -Received: "a" +Received: "a" `; exports[`.toBeNull() fails for '[]' 1`] = ` -expect(received).toBeNull() +expect(received).toBeNull() -Received: [] +Received: [] `; exports[`.toBeNull() fails for '[Function anonymous]' 1`] = ` -expect(received).toBeNull() +expect(received).toBeNull() -Received: [Function anonymous] +Received: [Function anonymous] `; exports[`.toBeNull() fails for '{}' 1`] = ` -expect(received).toBeNull() +expect(received).toBeNull() -Received: {} +Received: {} `; exports[`.toBeNull() fails for '0.5' 1`] = ` -expect(received).toBeNull() +expect(received).toBeNull() -Received: 0.5 +Received: 0.5 `; exports[`.toBeNull() fails for '1' 1`] = ` -expect(received).toBeNull() +expect(received).toBeNull() -Received: 1 +Received: 1 `; exports[`.toBeNull() fails for 'Infinity' 1`] = ` -expect(received).toBeNull() +expect(received).toBeNull() -Received: Infinity +Received: Infinity `; exports[`.toBeNull() fails for 'Map {}' 1`] = ` -expect(received).toBeNull() +expect(received).toBeNull() -Received: Map {} +Received: Map {} `; exports[`.toBeNull() fails for 'true' 1`] = ` -expect(received).toBeNull() +expect(received).toBeNull() -Received: true +Received: true `; exports[`.toBeNull() fails for null with .not 1`] = ` -expect(received).not.toBeNull() +expect(received).not.toBeNull() -Received: null +Received: null `; exports[`.toBeTruthy(), .toBeFalsy() '""' is falsy 1`] = ` -expect(received).toBeTruthy() +expect(received).toBeTruthy() -Received: "" +Received: "" `; exports[`.toBeTruthy(), .toBeFalsy() '""' is falsy 2`] = ` -expect(received).not.toBeFalsy() +expect(received).not.toBeFalsy() -Received: "" +Received: "" `; exports[`.toBeTruthy(), .toBeFalsy() '"a"' is truthy 1`] = ` -expect(received).not.toBeTruthy() +expect(received).not.toBeTruthy() -Received: "a" +Received: "a" `; exports[`.toBeTruthy(), .toBeFalsy() '"a"' is truthy 2`] = ` -expect(received).toBeFalsy() +expect(received).toBeFalsy() -Received: "a" +Received: "a" `; exports[`.toBeTruthy(), .toBeFalsy() '[]' is truthy 1`] = ` -expect(received).not.toBeTruthy() +expect(received).not.toBeTruthy() -Received: [] +Received: [] `; exports[`.toBeTruthy(), .toBeFalsy() '[]' is truthy 2`] = ` -expect(received).toBeFalsy() +expect(received).toBeFalsy() -Received: [] +Received: [] `; exports[`.toBeTruthy(), .toBeFalsy() '[Function anonymous]' is truthy 1`] = ` -expect(received).not.toBeTruthy() +expect(received).not.toBeTruthy() -Received: [Function anonymous] +Received: [Function anonymous] `; exports[`.toBeTruthy(), .toBeFalsy() '[Function anonymous]' is truthy 2`] = ` -expect(received).toBeFalsy() +expect(received).toBeFalsy() -Received: [Function anonymous] +Received: [Function anonymous] `; exports[`.toBeTruthy(), .toBeFalsy() '{}' is truthy 1`] = ` -expect(received).not.toBeTruthy() +expect(received).not.toBeTruthy() -Received: {} +Received: {} `; exports[`.toBeTruthy(), .toBeFalsy() '{}' is truthy 2`] = ` -expect(received).toBeFalsy() +expect(received).toBeFalsy() -Received: {} +Received: {} `; exports[`.toBeTruthy(), .toBeFalsy() '0' is falsy 1`] = ` -expect(received).toBeTruthy() +expect(received).toBeTruthy() -Received: 0 +Received: 0 `; exports[`.toBeTruthy(), .toBeFalsy() '0' is falsy 2`] = ` -expect(received).not.toBeFalsy() +expect(received).not.toBeFalsy() -Received: 0 +Received: 0 `; exports[`.toBeTruthy(), .toBeFalsy() '0.5' is truthy 1`] = ` -expect(received).not.toBeTruthy() +expect(received).not.toBeTruthy() -Received: 0.5 +Received: 0.5 `; exports[`.toBeTruthy(), .toBeFalsy() '0.5' is truthy 2`] = ` -expect(received).toBeFalsy() +expect(received).toBeFalsy() -Received: 0.5 +Received: 0.5 `; exports[`.toBeTruthy(), .toBeFalsy() '1' is truthy 1`] = ` -expect(received).not.toBeTruthy() +expect(received).not.toBeTruthy() -Received: 1 +Received: 1 `; exports[`.toBeTruthy(), .toBeFalsy() '1' is truthy 2`] = ` -expect(received).toBeFalsy() +expect(received).toBeFalsy() -Received: 1 +Received: 1 `; exports[`.toBeTruthy(), .toBeFalsy() 'Infinity' is truthy 1`] = ` -expect(received).not.toBeTruthy() +expect(received).not.toBeTruthy() -Received: Infinity +Received: Infinity `; exports[`.toBeTruthy(), .toBeFalsy() 'Infinity' is truthy 2`] = ` -expect(received).toBeFalsy() +expect(received).toBeFalsy() -Received: Infinity +Received: Infinity `; exports[`.toBeTruthy(), .toBeFalsy() 'Map {}' is truthy 1`] = ` -expect(received).not.toBeTruthy() +expect(received).not.toBeTruthy() -Received: Map {} +Received: Map {} `; exports[`.toBeTruthy(), .toBeFalsy() 'Map {}' is truthy 2`] = ` -expect(received).toBeFalsy() +expect(received).toBeFalsy() -Received: Map {} +Received: Map {} `; exports[`.toBeTruthy(), .toBeFalsy() 'NaN' is falsy 1`] = ` -expect(received).toBeTruthy() +expect(received).toBeTruthy() -Received: NaN +Received: NaN `; exports[`.toBeTruthy(), .toBeFalsy() 'NaN' is falsy 2`] = ` -expect(received).not.toBeFalsy() +expect(received).not.toBeFalsy() -Received: NaN +Received: NaN `; exports[`.toBeTruthy(), .toBeFalsy() 'false' is falsy 1`] = ` -expect(received).toBeTruthy() +expect(received).toBeTruthy() -Received: false +Received: false `; exports[`.toBeTruthy(), .toBeFalsy() 'false' is falsy 2`] = ` -expect(received).not.toBeFalsy() +expect(received).not.toBeFalsy() -Received: false +Received: false `; exports[`.toBeTruthy(), .toBeFalsy() 'null' is falsy 1`] = ` -expect(received).toBeTruthy() +expect(received).toBeTruthy() -Received: null +Received: null `; exports[`.toBeTruthy(), .toBeFalsy() 'null' is falsy 2`] = ` -expect(received).not.toBeFalsy() +expect(received).not.toBeFalsy() -Received: null +Received: null `; exports[`.toBeTruthy(), .toBeFalsy() 'true' is truthy 1`] = ` -expect(received).not.toBeTruthy() +expect(received).not.toBeTruthy() -Received: true +Received: true `; exports[`.toBeTruthy(), .toBeFalsy() 'true' is truthy 2`] = ` -expect(received).toBeFalsy() +expect(received).toBeFalsy() -Received: true +Received: true `; exports[`.toBeTruthy(), .toBeFalsy() 'undefined' is falsy 1`] = ` -expect(received).toBeTruthy() +expect(received).toBeTruthy() -Received: undefined +Received: undefined `; exports[`.toBeTruthy(), .toBeFalsy() 'undefined' is falsy 2`] = ` -expect(received).not.toBeFalsy() +expect(received).not.toBeFalsy() -Received: undefined +Received: undefined `; exports[`.toBeTruthy(), .toBeFalsy() does not accept arguments 1`] = ` -expect(received).toBeTruthy() +expect(received).toBeTruthy() Matcher error: this matcher must not have an expected argument @@ -1785,7 +1785,7 @@ Expected has value: null `; exports[`.toBeTruthy(), .toBeFalsy() does not accept arguments 2`] = ` -expect(received).not.toBeFalsy() +expect(received).not.toBeFalsy() Matcher error: this matcher must not have an expected argument @@ -1793,175 +1793,175 @@ Expected has value: null `; exports[`.toContain(), .toContainEqual() '"11112111"' contains '"2"' 1`] = ` -expect(received).not.toContain(expected) // indexOf +expect(received).not.toContain(expected) // indexOf -Expected substring: not "2" -Received string: "11112111" +Expected substring: not "2" +Received string: "11112111" `; exports[`.toContain(), .toContainEqual() '"abcdef"' contains '"abc"' 1`] = ` -expect(received).not.toContain(expected) // indexOf +expect(received).not.toContain(expected) // indexOf -Expected substring: not "abc" -Received string: "abcdef" +Expected substring: not "abc" +Received string: "abcdef" `; exports[`.toContain(), .toContainEqual() '["a", "b", "c", "d"]' contains '"a"' 1`] = ` -expect(received).not.toContain(expected) // indexOf +expect(received).not.toContain(expected) // indexOf -Expected value: not "a" -Received array: ["a", "b", "c", "d"] +Expected value: not "a" +Received array: ["a", "b", "c", "d"] `; exports[`.toContain(), .toContainEqual() '["a", "b", "c", "d"]' contains a value equal to '"a"' 1`] = ` -expect(received).not.toContainEqual(expected) // deep equality +expect(received).not.toContainEqual(expected) // deep equality -Expected value: not "a" -Received array: ["a", "b", "c", "d"] +Expected value: not "a" +Received array: ["a", "b", "c", "d"] `; exports[`.toContain(), .toContainEqual() '[{"a": "b"}, {"a": "c"}]' contains a value equal to '{"a": "b"}' 1`] = ` -expect(received).not.toContainEqual(expected) // deep equality +expect(received).not.toContainEqual(expected) // deep equality -Expected value: not {"a": "b"} -Received array: [{"a": "b"}, {"a": "c"}] +Expected value: not {"a": "b"} +Received array: [{"a": "b"}, {"a": "c"}] `; exports[`.toContain(), .toContainEqual() '[{"a": "b"}, {"a": "c"}]' does not contain a value equal to'{"a": "d"}' 1`] = ` -expect(received).toContainEqual(expected) // deep equality +expect(received).toContainEqual(expected) // deep equality -Expected value: {"a": "d"} -Received array: [{"a": "b"}, {"a": "c"}] +Expected value: {"a": "d"} +Received array: [{"a": "b"}, {"a": "c"}] `; exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '[]' 1`] = ` -expect(received).toContain(expected) // indexOf +expect(received).toContain(expected) // indexOf -Expected value: [] -Received array: [{}, []] +Expected value: [] +Received array: [{}, []] Looks like you wanted to test for object/array equality with the stricter \`toContain\` matcher. You probably need to use \`toContainEqual\` instead. `; exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '{}' 1`] = ` -expect(received).toContain(expected) // indexOf +expect(received).toContain(expected) // indexOf -Expected value: {} -Received array: [{}, []] +Expected value: {} +Received array: [{}, []] Looks like you wanted to test for object/array equality with the stricter \`toContain\` matcher. You probably need to use \`toContainEqual\` instead. `; exports[`.toContain(), .toContainEqual() '[0, 1]' contains '1' 1`] = ` -expect(received).not.toContain(expected) // indexOf +expect(received).not.toContain(expected) // indexOf -Expected value: not 1 -Received object: [0, 1] +Expected value: not 1 +Received object: [0, 1] `; exports[`.toContain(), .toContainEqual() '[0, 1]' contains a value equal to '1' 1`] = ` -expect(received).not.toContainEqual(expected) // deep equality +expect(received).not.toContainEqual(expected) // deep equality -Expected value: not 1 -Received object: [0, 1] +Expected value: not 1 +Received object: [0, 1] `; exports[`.toContain(), .toContainEqual() '[1, 2, 3, 4]' contains '1' 1`] = ` -expect(received).not.toContain(expected) // indexOf +expect(received).not.toContain(expected) // indexOf -Expected value: not 1 -Received array: [1, 2, 3, 4] +Expected value: not 1 +Received array: [1, 2, 3, 4] `; exports[`.toContain(), .toContainEqual() '[1, 2, 3, 4]' contains a value equal to '1' 1`] = ` -expect(received).not.toContainEqual(expected) // deep equality +expect(received).not.toContainEqual(expected) // deep equality -Expected value: not 1 -Received array: [1, 2, 3, 4] +Expected value: not 1 +Received array: [1, 2, 3, 4] `; exports[`.toContain(), .toContainEqual() '[1, 2, 3]' does not contain '4' 1`] = ` -expect(received).toContain(expected) // indexOf +expect(received).toContain(expected) // indexOf -Expected value: 4 -Received array: [1, 2, 3] +Expected value: 4 +Received array: [1, 2, 3] `; exports[`.toContain(), .toContainEqual() '[Symbol(a)]' contains 'Symbol(a)' 1`] = ` -expect(received).not.toContain(expected) // indexOf +expect(received).not.toContain(expected) // indexOf -Expected value: not Symbol(a) -Received array: [Symbol(a)] +Expected value: not Symbol(a) +Received array: [Symbol(a)] `; exports[`.toContain(), .toContainEqual() '[Symbol(a)]' contains a value equal to 'Symbol(a)' 1`] = ` -expect(received).not.toContainEqual(expected) // deep equality +expect(received).not.toContainEqual(expected) // deep equality -Expected value: not Symbol(a) -Received array: [Symbol(a)] +Expected value: not Symbol(a) +Received array: [Symbol(a)] `; exports[`.toContain(), .toContainEqual() '[null, undefined]' does not contain '1' 1`] = ` -expect(received).toContain(expected) // indexOf +expect(received).toContain(expected) // indexOf -Expected value: 1 -Received array: [null, undefined] +Expected value: 1 +Received array: [null, undefined] `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains 'null' 1`] = ` -expect(received).not.toContain(expected) // indexOf +expect(received).not.toContain(expected) // indexOf -Expected value: not null -Received array: [undefined, null] +Expected value: not null +Received array: [undefined, null] `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains 'undefined' 1`] = ` -expect(received).not.toContain(expected) // indexOf +expect(received).not.toContain(expected) // indexOf -Expected value: not undefined -Received array: [undefined, null] +Expected value: not undefined +Received array: [undefined, null] `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains a value equal to 'null' 1`] = ` -expect(received).not.toContainEqual(expected) // deep equality +expect(received).not.toContainEqual(expected) // deep equality -Expected value: not null -Received array: [undefined, null] +Expected value: not null +Received array: [undefined, null] `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains a value equal to 'undefined' 1`] = ` -expect(received).not.toContainEqual(expected) // deep equality +expect(received).not.toContainEqual(expected) // deep equality -Expected value: not undefined -Received array: [undefined, null] +Expected value: not undefined +Received array: [undefined, null] `; exports[`.toContain(), .toContainEqual() 'Set {"abc", "def"}' contains '"abc"' 1`] = ` -expect(received).not.toContain(expected) // indexOf +expect(received).not.toContain(expected) // indexOf -Expected value: not "abc" -Received set: Set {"abc", "def"} +Expected value: not "abc" +Received set: Set {"abc", "def"} `; exports[`.toContain(), .toContainEqual() 'Set {1, 2, 3, 4}' contains a value equal to '1' 1`] = ` -expect(received).not.toContainEqual(expected) // deep equality +expect(received).not.toContainEqual(expected) // deep equality -Expected value: not 1 -Received set: Set {1, 2, 3, 4} +Expected value: not 1 +Received set: Set {1, 2, 3, 4} `; exports[`.toContain(), .toContainEqual() error cases 1`] = ` -expect(received).toContain(expected) // indexOf +expect(received).toContain(expected) // indexOf -Matcher error: received value must not be null nor undefined +Matcher error: received value must not be null nor undefined Received has value: null `; exports[`.toContain(), .toContainEqual() error cases 2`] = ` -expect(-0).toContain(0) // indexOf +expect(-0).toContain(0) // indexOf -Matcher error: expected value must be a string if received value is a string +Matcher error: expected value must be a string if received value is a string Expected has type: number Expected has value: -0 @@ -1970,9 +1970,9 @@ Received has value: "-0" `; exports[`.toContain(), .toContainEqual() error cases 3`] = ` -expect(null).toContain(null) // indexOf +expect(null).toContain(null) // indexOf -Matcher error: expected value must be a string if received value is a string +Matcher error: expected value must be a string if received value is a string Expected has value: null Received has type: string @@ -1980,9 +1980,9 @@ Received has value: "null" `; exports[`.toContain(), .toContainEqual() error cases 4`] = ` -expect(undefined).toContain(undefined) // indexOf +expect(undefined).toContain(undefined) // indexOf -Matcher error: expected value must be a string if received value is a string +Matcher error: expected value must be a string if received value is a string Expected has value: undefined Received has type: string @@ -1990,9 +1990,9 @@ Received has value: "undefined" `; exports[`.toContain(), .toContainEqual() error cases 5`] = ` -expect(false).toContain(false) // indexOf +expect(false).toContain(false) // indexOf -Matcher error: expected value must be a string if received value is a string +Matcher error: expected value must be a string if received value is a string Expected has type: boolean Expected has value: false @@ -2001,1536 +2001,1536 @@ Received has value: "false" `; exports[`.toContain(), .toContainEqual() error cases for toContainEqual 1`] = ` -expect(received).toContainEqual(expected) // deep equality +expect(received).toContainEqual(expected) // deep equality -Matcher error: received value must not be null nor undefined +Matcher error: received value must not be null nor undefined Received has value: null `; exports[`.toEqual() {pass: false} expect("1 234,57 $").toEqual("1 234,57 $") 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: "1 234,57 $" -Received: "1 234,57 $" +Expected: "1 234,57 $" +Received: "1 234,57 $" `; exports[`.toEqual() {pass: false} expect("Eve").toEqual({"asymmetricMatch": [Function asymmetricMatch]}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: {"asymmetricMatch": [Function asymmetricMatch]} -Received: "Eve" +Expected: {"asymmetricMatch": [Function asymmetricMatch]} +Received: "Eve" `; exports[`.toEqual() {pass: false} expect("abc").toEqual({"0": "a", "1": "b", "2": "c"}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: {"0": "a", "1": "b", "2": "c"} -Received: "abc" +Expected: {"0": "a", "1": "b", "2": "c"} +Received: "abc" `; exports[`.toEqual() {pass: false} expect("abd").toEqual(StringContaining "bc") 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: StringContaining "bc" -Received: "abd" +Expected: StringContaining "bc" +Received: "abd" `; exports[`.toEqual() {pass: false} expect("abd").toEqual(StringMatching /bc/i) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: StringMatching /bc/i -Received: "abd" +Expected: StringMatching /bc/i +Received: "abd" `; exports[`.toEqual() {pass: false} expect("banana").toEqual("apple") 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: "apple" -Received: "banana" +Expected: "apple" +Received: "banana" `; exports[`.toEqual() {pass: false} expect("type TypeName = T extends Function ? \\"function\\" : \\"object\\";").toEqual("type TypeName = T extends Function ? \\"function\\" : \\"object\\";") 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 3 -+ Received + 1 +- Expected - 3 ++ Received + 1 -- type TypeName = T extends Function -- ? "function" -- : "object"; -+ type TypeName = T extends Function ? "function" : "object"; +- type TypeName = T extends Function +- ? "function" +- : "object"; ++ type TypeName = T extends Function ? "function" : "object"; `; exports[`.toEqual() {pass: false} expect(/abc/gsy).toEqual(/abc/g) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: /abc/g -Received: /abc/gsy +Expected: /abc/g +Received: /abc/gsy `; exports[`.toEqual() {pass: false} expect([, , 1, ]).toEqual([, , 2, ]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Array [ - undefined, - undefined, -- 2, -+ 1, - undefined, - ] + Array [ + undefined, + undefined, +- 2, ++ 1, + undefined, + ] `; exports[`.toEqual() {pass: false} expect([]).toEqual([]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: [] +Expected: [] Received: serializes to the same string `; exports[`.toEqual() {pass: false} expect([]).toEqual([]) 2`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: [] +Expected: [] Received: serializes to the same string `; exports[`.toEqual() {pass: false} expect([]).toEqual([]) 3`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: [] +Expected: [] Received: serializes to the same string `; exports[`.toEqual() {pass: false} expect([]).toEqual([1]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 3 -+ Received + 1 +- Expected - 3 ++ Received + 1 -- Array [ -- 1, -- ] -+ Array [] +- Array [ +- 1, +- ] ++ Array [] `; exports[`.toEqual() {pass: false} expect([1, 2]).toEqual([2, 1]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Array [ -- 2, - 1, -+ 2, - ] + Array [ +- 2, + 1, ++ 2, + ] `; exports[`.toEqual() {pass: false} expect([1, 3]).toEqual(ArrayContaining [1, 2]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: ArrayContaining [1, 2] -Received: [1, 3] +Expected: ArrayContaining [1, 2] +Received: [1, 3] `; exports[`.toEqual() {pass: false} expect([1]).toEqual([2]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Array [ -- 2, -+ 1, - ] + Array [ +- 2, ++ 1, + ] `; exports[`.toEqual() {pass: false} expect([97, 98, 99]).toEqual([97, 98, 100]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Uint8Array [ - 97, - 98, -- 100, -+ 99, - ] + Uint8Array [ + 97, + 98, +- 100, ++ 99, + ] `; exports[`.toEqual() {pass: false} expect({"0": "a", "1": "b", "2": "c"}).toEqual("abc") 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: "abc" -Received: {"0": "a", "1": "b", "2": "c"} +Expected: "abc" +Received: {"0": "a", "1": "b", "2": "c"} `; exports[`.toEqual() {pass: false} expect({"a": 1, "b": 2}).toEqual(ObjectContaining {"a": 2}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 2 -+ Received + 3 +- Expected - 2 ++ Received + 3 -- ObjectContaining { -- "a": 2, -+ Object { -+ "a": 1, -+ "b": 2, - } +- ObjectContaining { +- "a": 2, ++ Object { ++ "a": 1, ++ "b": 2, + } `; exports[`.toEqual() {pass: false} expect({"a": 1}).toEqual({"a": 2}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": 2, -+ "a": 1, - } + Object { +- "a": 2, ++ "a": 1, + } `; exports[`.toEqual() {pass: false} expect({"a": 5}).toEqual({"b": 6}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "b": 6, -+ "a": 5, - } + Object { +- "b": 6, ++ "a": 5, + } `; exports[`.toEqual() {pass: false} expect({"foo": {"bar": 1}}).toEqual({"foo": {}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 3 +- Expected - 1 ++ Received + 3 - Object { -- "foo": Object {}, -+ "foo": Object { -+ "bar": 1, -+ }, - } + Object { +- "foo": Object {}, ++ "foo": Object { ++ "bar": 1, ++ }, + } `; exports[`.toEqual() {pass: false} expect({"frozenGetter": {}}).toEqual({"frozenGetter": {"foo": "bar"}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 3 -+ Received + 1 +- Expected - 3 ++ Received + 1 - Object { -- "frozenGetter": Object { -- "foo": "bar", -- }, -+ "frozenGetter": Object {}, - } + Object { +- "frozenGetter": Object { +- "foo": "bar", +- }, ++ "frozenGetter": Object {}, + } `; exports[`.toEqual() {pass: false} expect({"frozenGetterAndSetter": {}}).toEqual({"frozenGetterAndSetter": {"foo": "bar"}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 3 -+ Received + 1 +- Expected - 3 ++ Received + 1 - Object { -- "frozenGetterAndSetter": Object { -- "foo": "bar", -- }, -+ "frozenGetterAndSetter": Object {}, - } + Object { +- "frozenGetterAndSetter": Object { +- "foo": "bar", +- }, ++ "frozenGetterAndSetter": Object {}, + } `; exports[`.toEqual() {pass: false} expect({"frozenSetter": undefined}).toEqual({"frozenSetter": {"foo": "bar"}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 3 -+ Received + 1 +- Expected - 3 ++ Received + 1 - Object { -- "frozenSetter": Object { -- "foo": "bar", -- }, -+ "frozenSetter": undefined, - } + Object { +- "frozenSetter": Object { +- "foo": "bar", +- }, ++ "frozenSetter": undefined, + } `; exports[`.toEqual() {pass: false} expect({"getter": {}}).toEqual({"getter": {"foo": "bar"}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 3 -+ Received + 1 +- Expected - 3 ++ Received + 1 - Object { -- "getter": Object { -- "foo": "bar", -- }, -+ "getter": Object {}, - } + Object { +- "getter": Object { +- "foo": "bar", +- }, ++ "getter": Object {}, + } `; exports[`.toEqual() {pass: false} expect({"getterAndSetter": {}}).toEqual({"getterAndSetter": {"foo": "bar"}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 3 -+ Received + 1 +- Expected - 3 ++ Received + 1 - Object { -- "getterAndSetter": Object { -- "foo": "bar", -- }, -+ "getterAndSetter": Object {}, - } + Object { +- "getterAndSetter": Object { +- "foo": "bar", +- }, ++ "getterAndSetter": Object {}, + } `; exports[`.toEqual() {pass: false} expect({"nodeName": "div", "nodeType": 1}).toEqual({"nodeName": "p", "nodeType": 1}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "nodeName": "p", -+ "nodeName": "div", - "nodeType": 1, - } + Object { +- "nodeName": "p", ++ "nodeName": "div", + "nodeType": 1, + } `; exports[`.toEqual() {pass: false} expect({"setter": undefined}).toEqual({"setter": {"foo": "bar"}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 3 -+ Received + 1 +- Expected - 3 ++ Received + 1 - Object { -- "setter": Object { -- "foo": "bar", -- }, -+ "setter": undefined, - } + Object { +- "setter": Object { +- "foo": "bar", +- }, ++ "setter": undefined, + } `; exports[`.toEqual() {pass: false} expect({"target": {"nodeType": 1, "value": "a"}}).toEqual({"target": {"nodeType": 1, "value": "b"}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { - "target": Object { - "nodeType": 1, -- "value": "b", -+ "value": "a", - }, - } + Object { + "target": Object { + "nodeType": 1, +- "value": "b", ++ "value": "a", + }, + } `; exports[`.toEqual() {pass: false} expect({}).toEqual({}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: {} +Expected: {} Received: serializes to the same string `; exports[`.toEqual() {pass: false} expect({}).toEqual(0) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: 0 -Received: {} +Expected: 0 +Received: {} `; exports[`.toEqual() {pass: false} expect({Symbol(foo): 1, Symbol(bar): 2}).toEqual({Symbol(foo): Any, Symbol(bar): 1}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { - Symbol(foo): Any, -- Symbol(bar): 1, -+ Symbol(bar): 2, - } + Object { + Symbol(foo): Any, +- Symbol(bar): 1, ++ Symbol(bar): 2, + } `; exports[`.toEqual() {pass: false} expect(0).toEqual({}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: {} -Received: 0 +Expected: {} +Received: 0 `; exports[`.toEqual() {pass: false} expect(0).toEqual(-0) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: -0 -Received: 0 +Expected: -0 +Received: 0 `; exports[`.toEqual() {pass: false} expect(0).toEqual(5e-324) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: 5e-324 -Received: 0 +Expected: 5e-324 +Received: 0 `; exports[`.toEqual() {pass: false} expect(1).toEqual(2) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: 2 -Received: 1 +Expected: 2 +Received: 1 `; exports[`.toEqual() {pass: false} expect(1).toEqual(ArrayContaining [1, 2]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: ArrayContaining [1, 2] -Received: 1 +Expected: ArrayContaining [1, 2] +Received: 1 `; exports[`.toEqual() {pass: false} expect(5e-324).toEqual(0) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: 0 -Received: 5e-324 +Expected: 0 +Received: 5e-324 `; exports[`.toEqual() {pass: false} expect(Immutable.List [1, 2]).toEqual(Immutable.List [2, 1]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Immutable.List [ -- 2, - 1, -+ 2, - ] + Immutable.List [ +- 2, + 1, ++ 2, + ] `; exports[`.toEqual() {pass: false} expect(Immutable.List [1]).toEqual(Immutable.List [2]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Immutable.List [ -- 2, -+ 1, - ] + Immutable.List [ +- 2, ++ 1, + ] `; exports[`.toEqual() {pass: false} expect(Immutable.Map {"1": Immutable.Map {"2": {"a": 99}}}).toEqual(Immutable.Map {"1": Immutable.Map {"2": {"a": 11}}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Immutable.Map { - "1": Immutable.Map { - "2": Object { -- "a": 11, -+ "a": 99, - }, - }, - } + Immutable.Map { + "1": Immutable.Map { + "2": Object { +- "a": 11, ++ "a": 99, + }, + }, + } `; exports[`.toEqual() {pass: false} expect(Immutable.Map {"a": 0}).toEqual(Immutable.Map {"b": 0}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Immutable.Map { -- "b": 0, -+ "a": 0, - } + Immutable.Map { +- "b": 0, ++ "a": 0, + } `; exports[`.toEqual() {pass: false} expect(Immutable.Map {"v": 1}).toEqual(Immutable.Map {"v": 2}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Immutable.Map { -- "v": 2, -+ "v": 1, - } + Immutable.Map { +- "v": 2, ++ "v": 1, + } `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedMap {1: "one", 2: "two"}).toEqual(Immutable.OrderedMap {2: "two", 1: "one"}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Immutable.OrderedMap { -- 2: "two", - 1: "one", -+ 2: "two", - } + Immutable.OrderedMap { +- 2: "two", + 1: "one", ++ 2: "two", + } `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedSet [1, 2]).toEqual(Immutable.OrderedSet [2, 1]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Immutable.OrderedSet [ -- 2, - 1, -+ 2, - ] + Immutable.OrderedSet [ +- 2, + 1, ++ 2, + ] `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).toEqual(Immutable.Set []) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 4 +- Expected - 1 ++ Received + 4 -- Immutable.Set [] -+ Immutable.Set [ -+ 1, -+ 2, -+ ] +- Immutable.Set [] ++ Immutable.Set [ ++ 1, ++ 2, ++ ] `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).toEqual(Immutable.Set [1, 2, 3]) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 0 +- Expected - 1 ++ Received + 0 - Immutable.Set [ - 1, - 2, -- 3, - ] + Immutable.Set [ + 1, + 2, +- 3, + ] `; exports[`.toEqual() {pass: false} expect(Map {"a" => 0}).toEqual(Map {"b" => 0}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Map { -- "b" => 0, -+ "a" => 0, - } + Map { +- "b" => 0, ++ "a" => 0, + } `; exports[`.toEqual() {pass: false} expect(Map {"v" => 1}).toEqual(Map {"v" => 2}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Map { -- "v" => 2, -+ "v" => 1, - } + Map { +- "v" => 2, ++ "v" => 1, + } `; exports[`.toEqual() {pass: false} expect(Map {["v"] => 1}).toEqual(Map {["v"] => 2}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Map { - Array [ - "v", -- ] => 2, -+ ] => 1, - } + Map { + Array [ + "v", +- ] => 2, ++ ] => 1, + } `; exports[`.toEqual() {pass: false} expect(Map {[1] => Map {[1] => "one"}}).toEqual(Map {[1] => Map {[1] => "two"}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 @@ -2,8 +2,8 @@ - Array [ - 1, - ] => Map { - Array [ - 1, -- ] => "two", -+ ] => "one", - }, - } + Array [ + 1, + ] => Map { + Array [ + 1, +- ] => "two", ++ ] => "one", + }, + } `; exports[`.toEqual() {pass: false} expect(Map {}).toEqual(Set {}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: Set {} -Received: Map {} +Expected: Set {} +Received: Map {} `; exports[`.toEqual() {pass: false} expect(Map {1 => "one", 2 => "two"}).toEqual(Map {1 => "one"}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 0 -+ Received + 1 +- Expected - 0 ++ Received + 1 - Map { - 1 => "one", -+ 2 => "two", - } + Map { + 1 => "one", ++ 2 => "two", + } `; exports[`.toEqual() {pass: false} expect(Set {[1], [2]}).toEqual(Set {[1], [2], [2]}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 3 -+ Received + 0 +- Expected - 3 ++ Received + 0 @@ -3,9 +3,6 @@ - 1, - ], - Array [ - 2, - ], -- Array [ -- 2, -- ], - } + 1, + ], + Array [ + 2, + ], +- Array [ +- 2, +- ], + } `; exports[`.toEqual() {pass: false} expect(Set {[1], [2]}).toEqual(Set {[1], [2], [3]}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 3 -+ Received + 0 +- Expected - 3 ++ Received + 0 @@ -3,9 +3,6 @@ - 1, - ], - Array [ - 2, - ], -- Array [ -- 3, -- ], - } + 1, + ], + Array [ + 2, + ], +- Array [ +- 3, +- ], + } `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).toEqual(Set {}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 4 +- Expected - 1 ++ Received + 4 -- Set {} -+ Set { -+ 1, -+ 2, -+ } +- Set {} ++ Set { ++ 1, ++ 2, ++ } `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).toEqual(Set {1, 2, 3}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 0 +- Expected - 1 ++ Received + 0 - Set { - 1, - 2, -- 3, - } + Set { + 1, + 2, +- 3, + } `; exports[`.toEqual() {pass: false} expect(Set {Set {1}, Set {2}}).toEqual(Set {Set {1}, Set {3}}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Set { - Set { - 1, - }, - Set { -- 3, -+ 2, - }, - } + Set { + Set { + 1, + }, + Set { +- 3, ++ 2, + }, + } `; exports[`.toEqual() {pass: false} expect(false).toEqual(ObjectContaining {"a": 2}) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: ObjectContaining {"a": 2} -Received: false +Expected: ObjectContaining {"a": 2} +Received: false `; exports[`.toEqual() {pass: false} expect(null).toEqual(undefined) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: undefined -Received: null +Expected: undefined +Received: null `; exports[`.toEqual() {pass: false} expect(true).toEqual(false) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: false -Received: true +Expected: false +Received: true `; exports[`.toEqual() {pass: false} expect(undefined).toEqual(Any) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: Any -Received: undefined +Expected: Any +Received: undefined `; exports[`.toEqual() {pass: false} expect(undefined).toEqual(Anything) 1`] = ` -expect(received).toEqual(expected) // deep equality +expect(received).toEqual(expected) // deep equality -Expected: Anything -Received: undefined +Expected: Anything +Received: undefined `; exports[`.toEqual() {pass: true} expect("Alice").not.toEqual({"asymmetricMatch": [Function asymmetricMatch]}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {"asymmetricMatch": [Function asymmetricMatch]} -Received: "Alice" +Expected: not {"asymmetricMatch": [Function asymmetricMatch]} +Received: "Alice" `; exports[`.toEqual() {pass: true} expect("abc").not.toEqual("abc") 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not "abc" +Expected: not "abc" `; exports[`.toEqual() {pass: true} expect("abc").not.toEqual("abc") 2`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not "abc" +Expected: not "abc" `; exports[`.toEqual() {pass: true} expect("abc").not.toEqual("abc") 3`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not "abc" +Expected: not "abc" `; exports[`.toEqual() {pass: true} expect("abcd").not.toEqual(StringContaining "bc") 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not StringContaining "bc" -Received: "abcd" +Expected: not StringContaining "bc" +Received: "abcd" `; exports[`.toEqual() {pass: true} expect("abcd").not.toEqual(StringMatching /bc/) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not StringMatching /bc/ -Received: "abcd" +Expected: not StringMatching /bc/ +Received: "abcd" `; exports[`.toEqual() {pass: true} expect([, , 1, , ]).not.toEqual([, , 1, undefined, ]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [, , 1, undefined, ] -Received: [, , 1, , ] +Expected: not [, , 1, undefined, ] +Received: [, , 1, , ] `; exports[`.toEqual() {pass: true} expect([, , 1, ]).not.toEqual([, , 1, ]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [, , 1, ] +Expected: not [, , 1, ] `; exports[`.toEqual() {pass: true} expect([1, [Function anonymous]]).not.toEqual([1, optionalFn<>]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [1, optionalFn<>] -Received: [1, [Function anonymous]] +Expected: not [1, optionalFn<>] +Received: [1, [Function anonymous]] `; exports[`.toEqual() {pass: true} expect([1, 2, 3]).not.toEqual(ArrayContaining [2, 3]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not ArrayContaining [2, 3] -Received: [1, 2, 3] +Expected: not ArrayContaining [2, 3] +Received: [1, 2, 3] `; exports[`.toEqual() {pass: true} expect([1, 2]).not.toEqual([1, 2]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [1, 2] +Expected: not [1, 2] `; exports[`.toEqual() {pass: true} expect([1, optionalFn<>]).not.toEqual([1, [Function anonymous]]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [1, [Function anonymous]] -Received: [1, optionalFn<>] +Expected: not [1, [Function anonymous]] +Received: [1, optionalFn<>] `; exports[`.toEqual() {pass: true} expect([1, optionalFn<>]).not.toEqual([1, undefined]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [1, undefined] -Received: [1, optionalFn<>] +Expected: not [1, undefined] +Received: [1, optionalFn<>] `; exports[`.toEqual() {pass: true} expect([1, optionalFn<>]).not.toEqual([1]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [1] -Received: [1, optionalFn<>] +Expected: not [1] +Received: [1, optionalFn<>] `; exports[`.toEqual() {pass: true} expect([1, undefined]).not.toEqual([1, optionalFn<>]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [1, optionalFn<>] -Received: [1, undefined] +Expected: not [1, optionalFn<>] +Received: [1, undefined] `; exports[`.toEqual() {pass: true} expect([1]).not.toEqual([1, optionalFn<>]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [1, optionalFn<>] -Received: [1] +Expected: not [1, optionalFn<>] +Received: [1] `; exports[`.toEqual() {pass: true} expect([1]).not.toEqual([1]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [1] +Expected: not [1] `; exports[`.toEqual() {pass: true} expect([97, 98, 99]).not.toEqual([97, 98, 99]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not [97, 98, 99] +Expected: not [97, 98, 99] `; exports[`.toEqual() {pass: true} expect([Function anonymous]).not.toEqual(Any) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Any -Received: [Function anonymous] +Expected: not Any +Received: [Function anonymous] `; exports[`.toEqual() {pass: true} expect({"a": 1, "b": [Function b], "c": true}).not.toEqual({"a": 1, "b": Any, "c": Anything}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {"a": 1, "b": Any, "c": Anything} -Received: {"a": 1, "b": [Function b], "c": true} +Expected: not {"a": 1, "b": Any, "c": Anything} +Received: {"a": 1, "b": [Function b], "c": true} `; exports[`.toEqual() {pass: true} expect({"a": 1, "b": [Function b]}).not.toEqual({"a": 1, "b": optionalFn<>}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {"a": 1, "b": optionalFn<>} -Received: {"a": 1, "b": [Function b]} +Expected: not {"a": 1, "b": optionalFn<>} +Received: {"a": 1, "b": [Function b]} `; exports[`.toEqual() {pass: true} expect({"a": 1, "b": 2}).not.toEqual(ObjectContaining {"a": 1}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not ObjectContaining {"a": 1} -Received: {"a": 1, "b": 2} +Expected: not ObjectContaining {"a": 1} +Received: {"a": 1, "b": 2} `; exports[`.toEqual() {pass: true} expect({"a": 1, "b": optionalFn<>}).not.toEqual({"a": 1, "b": [Function b]}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {"a": 1, "b": [Function b]} -Received: {"a": 1, "b": optionalFn<>} +Expected: not {"a": 1, "b": [Function b]} +Received: {"a": 1, "b": optionalFn<>} `; exports[`.toEqual() {pass: true} expect({"a": 1, "b": optionalFn<>}).not.toEqual({"a": 1, "b": undefined}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {"a": 1, "b": undefined} -Received: {"a": 1, "b": optionalFn<>} +Expected: not {"a": 1, "b": undefined} +Received: {"a": 1, "b": optionalFn<>} `; exports[`.toEqual() {pass: true} expect({"a": 1, "b": optionalFn<>}).not.toEqual({"a": 1}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {"a": 1} -Received: {"a": 1, "b": optionalFn<>} +Expected: not {"a": 1} +Received: {"a": 1, "b": optionalFn<>} `; exports[`.toEqual() {pass: true} expect({"a": 1, "b": undefined}).not.toEqual({"a": 1, "b": optionalFn<>}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {"a": 1, "b": optionalFn<>} -Received: {"a": 1, "b": undefined} +Expected: not {"a": 1, "b": optionalFn<>} +Received: {"a": 1, "b": undefined} `; exports[`.toEqual() {pass: true} expect({"a": 1}).not.toEqual({"a": 1, "b": optionalFn<>}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {"a": 1, "b": optionalFn<>} -Received: {"a": 1} +Expected: not {"a": 1, "b": optionalFn<>} +Received: {"a": 1} `; exports[`.toEqual() {pass: true} expect({"a": 99}).not.toEqual({"a": 99}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {"a": 99} +Expected: not {"a": 99} `; exports[`.toEqual() {pass: true} expect({"nodeName": "div", "nodeType": 1}).not.toEqual({"nodeName": "div", "nodeType": 1}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {"nodeName": "div", "nodeType": 1} +Expected: not {"nodeName": "div", "nodeType": 1} `; exports[`.toEqual() {pass: true} expect({}).not.toEqual({}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {} +Expected: not {} `; exports[`.toEqual() {pass: true} expect({}).not.toEqual({}) 2`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {} +Expected: not {} `; exports[`.toEqual() {pass: true} expect({Symbol(foo): 1, Symbol(bar): 2}).not.toEqual({Symbol(foo): Any, Symbol(bar): 2}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not {Symbol(foo): Any, Symbol(bar): 2} -Received: {Symbol(foo): 1, Symbol(bar): 2} +Expected: not {Symbol(foo): Any, Symbol(bar): 2} +Received: {Symbol(foo): 1, Symbol(bar): 2} `; exports[`.toEqual() {pass: true} expect(0).not.toEqual(0) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not 0 +Expected: not 0 `; exports[`.toEqual() {pass: true} expect(0).not.toEqual(0) 2`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not 0 +Expected: not 0 `; exports[`.toEqual() {pass: true} expect(1).not.toEqual(1) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not 1 +Expected: not 1 `; exports[`.toEqual() {pass: true} expect(Immutable.List [1, 2]).not.toEqual(Immutable.List [1, 2]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.List [1, 2] +Expected: not Immutable.List [1, 2] `; exports[`.toEqual() {pass: true} expect(Immutable.List [1]).not.toEqual(Immutable.List [1]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.List [1] +Expected: not Immutable.List [1] `; exports[`.toEqual() {pass: true} expect(Immutable.Map {"1": Immutable.Map {"2": {"a": 99}}}).not.toEqual(Immutable.Map {"1": Immutable.Map {"2": {"a": 99}}}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.Map {"1": Immutable.Map {"2": {"a": 99}}} +Expected: not Immutable.Map {"1": Immutable.Map {"2": {"a": 99}}} `; exports[`.toEqual() {pass: true} expect(Immutable.Map {}).not.toEqual(Immutable.Map {}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.Map {} +Expected: not Immutable.Map {} `; exports[`.toEqual() {pass: true} expect(Immutable.Map {1: "one", 2: "two"}).not.toEqual(Immutable.Map {1: "one", 2: "two"}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.Map {1: "one", 2: "two"} +Expected: not Immutable.Map {1: "one", 2: "two"} `; exports[`.toEqual() {pass: true} expect(Immutable.Map {1: "one", 2: "two"}).not.toEqual(Immutable.Map {2: "two", 1: "one"}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.Map {2: "two", 1: "one"} -Received: Immutable.Map {1: "one", 2: "two"} +Expected: not Immutable.Map {2: "two", 1: "one"} +Received: Immutable.Map {1: "one", 2: "two"} `; exports[`.toEqual() {pass: true} expect(Immutable.OrderedMap {1: "one", 2: "two"}).not.toEqual(Immutable.OrderedMap {1: "one", 2: "two"}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.OrderedMap {1: "one", 2: "two"} +Expected: not Immutable.OrderedMap {1: "one", 2: "two"} `; exports[`.toEqual() {pass: true} expect(Immutable.OrderedSet []).not.toEqual(Immutable.OrderedSet []) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.OrderedSet [] +Expected: not Immutable.OrderedSet [] `; exports[`.toEqual() {pass: true} expect(Immutable.OrderedSet [1, 2]).not.toEqual(Immutable.OrderedSet [1, 2]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.OrderedSet [1, 2] +Expected: not Immutable.OrderedSet [1, 2] `; exports[`.toEqual() {pass: true} expect(Immutable.Set []).not.toEqual(Immutable.Set []) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.Set [] +Expected: not Immutable.Set [] `; exports[`.toEqual() {pass: true} expect(Immutable.Set [1, 2]).not.toEqual(Immutable.Set [1, 2]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.Set [1, 2] +Expected: not Immutable.Set [1, 2] `; exports[`.toEqual() {pass: true} expect(Immutable.Set [1, 2]).not.toEqual(Immutable.Set [2, 1]) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Immutable.Set [2, 1] -Received: Immutable.Set [1, 2] +Expected: not Immutable.Set [2, 1] +Received: Immutable.Set [1, 2] `; exports[`.toEqual() {pass: true} expect(Map {[1] => "one", [2] => "two", [3] => "three", [3] => "four"}).not.toEqual(Map {[3] => "three", [3] => "four", [2] => "two", [1] => "one"}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Map {[3] => "three", [3] => "four", [2] => "two", [1] => "one"} -Received: Map {[1] => "one", [2] => "two", [3] => "three", [3] => "four"} +Expected: not Map {[3] => "three", [3] => "four", [2] => "two", [1] => "one"} +Received: Map {[1] => "one", [2] => "two", [3] => "three", [3] => "four"} `; exports[`.toEqual() {pass: true} expect(Map {[1] => "one", [2] => "two"}).not.toEqual(Map {[2] => "two", [1] => "one"}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Map {[2] => "two", [1] => "one"} -Received: Map {[1] => "one", [2] => "two"} +Expected: not Map {[2] => "two", [1] => "one"} +Received: Map {[1] => "one", [2] => "two"} `; exports[`.toEqual() {pass: true} expect(Map {[1] => Map {[1] => "one"}, [2] => Map {[2] => "two"}}).not.toEqual(Map {[2] => Map {[2] => "two"}, [1] => Map {[1] => "one"}}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Map {[2] => Map {[2] => "two"}, [1] => Map {[1] => "one"}} -Received: Map {[1] => Map {[1] => "one"}, [2] => Map {[2] => "two"}} +Expected: not Map {[2] => Map {[2] => "two"}, [1] => Map {[1] => "one"}} +Received: Map {[1] => Map {[1] => "one"}, [2] => Map {[2] => "two"}} `; exports[`.toEqual() {pass: true} expect(Map {{"a": 1} => "one", {"b": 2} => "two"}).not.toEqual(Map {{"b": 2} => "two", {"a": 1} => "one"}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Map {{"b": 2} => "two", {"a": 1} => "one"} -Received: Map {{"a": 1} => "one", {"b": 2} => "two"} +Expected: not Map {{"b": 2} => "two", {"a": 1} => "one"} +Received: Map {{"a": 1} => "one", {"b": 2} => "two"} `; exports[`.toEqual() {pass: true} expect(Map {}).not.toEqual(Map {}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Map {} +Expected: not Map {} `; exports[`.toEqual() {pass: true} expect(Map {1 => "one", 2 => "two"}).not.toEqual(Map {1 => "one", 2 => "two"}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Map {1 => "one", 2 => "two"} +Expected: not Map {1 => "one", 2 => "two"} `; exports[`.toEqual() {pass: true} expect(Map {1 => "one", 2 => "two"}).not.toEqual(Map {2 => "two", 1 => "one"}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Map {2 => "two", 1 => "one"} -Received: Map {1 => "one", 2 => "two"} +Expected: not Map {2 => "two", 1 => "one"} +Received: Map {1 => "one", 2 => "two"} `; exports[`.toEqual() {pass: true} expect(Map {1 => ["one"], 2 => ["two"]}).not.toEqual(Map {2 => ["two"], 1 => ["one"]}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Map {2 => ["two"], 1 => ["one"]} -Received: Map {1 => ["one"], 2 => ["two"]} +Expected: not Map {2 => ["two"], 1 => ["one"]} +Received: Map {1 => ["one"], 2 => ["two"]} `; exports[`.toEqual() {pass: true} expect(NaN).not.toEqual(NaN) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not NaN +Expected: not NaN `; exports[`.toEqual() {pass: true} expect(Set {[1], [2], [3], [3]}).not.toEqual(Set {[3], [3], [2], [1]}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Set {[3], [3], [2], [1]} -Received: Set {[1], [2], [3], [3]} +Expected: not Set {[3], [3], [2], [1]} +Received: Set {[1], [2], [3], [3]} `; exports[`.toEqual() {pass: true} expect(Set {[1], [2]}).not.toEqual(Set {[2], [1]}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Set {[2], [1]} -Received: Set {[1], [2]} +Expected: not Set {[2], [1]} +Received: Set {[1], [2]} `; exports[`.toEqual() {pass: true} expect(Set {{"a": 1}, {"b": 2}}).not.toEqual(Set {{"b": 2}, {"a": 1}}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Set {{"b": 2}, {"a": 1}} -Received: Set {{"a": 1}, {"b": 2}} +Expected: not Set {{"b": 2}, {"a": 1}} +Received: Set {{"a": 1}, {"b": 2}} `; exports[`.toEqual() {pass: true} expect(Set {}).not.toEqual(Set {}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Set {} +Expected: not Set {} `; exports[`.toEqual() {pass: true} expect(Set {1, 2}).not.toEqual(Set {1, 2}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Set {1, 2} +Expected: not Set {1, 2} `; exports[`.toEqual() {pass: true} expect(Set {1, 2}).not.toEqual(Set {2, 1}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Set {2, 1} -Received: Set {1, 2} +Expected: not Set {2, 1} +Received: Set {1, 2} `; exports[`.toEqual() {pass: true} expect(Set {Set {[1]}, Set {[2]}}).not.toEqual(Set {Set {[2]}, Set {[1]}}) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Set {Set {[2]}, Set {[1]}} -Received: Set {Set {[1]}, Set {[2]}} +Expected: not Set {Set {[2]}, Set {[1]}} +Received: Set {Set {[1]}, Set {[2]}} `; exports[`.toEqual() {pass: true} expect(true).not.toEqual(Anything) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not Anything -Received: true +Expected: not Anything +Received: true `; exports[`.toEqual() {pass: true} expect(true).not.toEqual(true) 1`] = ` -expect(received).not.toEqual(expected) // deep equality +expect(received).not.toEqual(expected) // deep equality -Expected: not true +Expected: not true `; exports[`.toHaveLength {pass: false} expect("").toHaveLength(1) 1`] = ` -expect(received).toHaveLength(expected) +expect(received).toHaveLength(expected) -Expected length: 1 -Received length: 0 -Received string: "" +Expected length: 1 +Received length: 0 +Received string: "" `; exports[`.toHaveLength {pass: false} expect("abc").toHaveLength(66) 1`] = ` -expect(received).toHaveLength(expected) +expect(received).toHaveLength(expected) -Expected length: 66 -Received length: 3 -Received string: "abc" +Expected length: 66 +Received length: 3 +Received string: "abc" `; exports[`.toHaveLength {pass: false} expect(["a", "b"]).toHaveLength(99) 1`] = ` -expect(received).toHaveLength(expected) +expect(received).toHaveLength(expected) -Expected length: 99 -Received length: 2 -Received array: ["a", "b"] +Expected length: 99 +Received length: 2 +Received array: ["a", "b"] `; exports[`.toHaveLength {pass: false} expect([]).toHaveLength(1) 1`] = ` -expect(received).toHaveLength(expected) +expect(received).toHaveLength(expected) -Expected length: 1 -Received length: 0 -Received array: [] +Expected length: 1 +Received length: 0 +Received array: [] `; exports[`.toHaveLength {pass: false} expect([1, 2]).toHaveLength(3) 1`] = ` -expect(received).toHaveLength(expected) +expect(received).toHaveLength(expected) -Expected length: 3 -Received length: 2 -Received array: [1, 2] +Expected length: 3 +Received length: 2 +Received array: [1, 2] `; exports[`.toHaveLength {pass: true} expect("").toHaveLength(0) 1`] = ` -expect(received).not.toHaveLength(expected) +expect(received).not.toHaveLength(expected) -Expected length: not 0 -Received string: "" +Expected length: not 0 +Received string: "" `; exports[`.toHaveLength {pass: true} expect("abc").toHaveLength(3) 1`] = ` -expect(received).not.toHaveLength(expected) +expect(received).not.toHaveLength(expected) -Expected length: not 3 -Received string: "abc" +Expected length: not 3 +Received string: "abc" `; exports[`.toHaveLength {pass: true} expect(["a", "b"]).toHaveLength(2) 1`] = ` -expect(received).not.toHaveLength(expected) +expect(received).not.toHaveLength(expected) -Expected length: not 2 -Received array: ["a", "b"] +Expected length: not 2 +Received array: ["a", "b"] `; exports[`.toHaveLength {pass: true} expect([]).toHaveLength(0) 1`] = ` -expect(received).not.toHaveLength(expected) +expect(received).not.toHaveLength(expected) -Expected length: not 0 -Received array: [] +Expected length: not 0 +Received array: [] `; exports[`.toHaveLength {pass: true} expect([1, 2]).toHaveLength(2) 1`] = ` -expect(received).not.toHaveLength(expected) +expect(received).not.toHaveLength(expected) -Expected length: not 2 -Received array: [1, 2] +Expected length: not 2 +Received array: [1, 2] `; exports[`.toHaveLength {pass: true} expect([Function anonymous]).toHaveLength(0) 1`] = ` -expect(received).not.toHaveLength(expected) +expect(received).not.toHaveLength(expected) -Expected length: not 0 -Received function: [Function anonymous] +Expected length: not 0 +Received function: [Function anonymous] `; exports[`.toHaveLength error cases 1`] = ` -expect(received).toHaveLength(expected) +expect(received).toHaveLength(expected) -Matcher error: received value must have a length property whose value must be a number +Matcher error: received value must have a length property whose value must be a number Received has type: object Received has value: {"a": 9} `; exports[`.toHaveLength error cases 2`] = ` -expect(received).toHaveLength(expected) +expect(received).toHaveLength(expected) -Matcher error: received value must have a length property whose value must be a number +Matcher error: received value must have a length property whose value must be a number Received has type: number Received has value: 0 `; exports[`.toHaveLength error cases 3`] = ` -expect(received).not.toHaveLength(expected) +expect(received).not.toHaveLength(expected) -Matcher error: received value must have a length property whose value must be a number +Matcher error: received value must have a length property whose value must be a number Received has value: undefined `; exports[`.toHaveLength matcher error expected length not number 1`] = ` -expect(received).not.toHaveLength(expected) +expect(received).not.toHaveLength(expected) -Matcher error: expected value must be a non-negative integer +Matcher error: expected value must be a non-negative integer Expected has type: string Expected has value: "3" `; exports[`.toHaveLength matcher error expected length number Infinity 1`] = ` -expect(received).rejects.toHaveLength(expected) +expect(received).rejects.toHaveLength(expected) -Matcher error: expected value must be a non-negative integer +Matcher error: expected value must be a non-negative integer Expected has type: number Expected has value: Infinity `; exports[`.toHaveLength matcher error expected length number NaN 1`] = ` -expect(received).rejects.not.toHaveLength(expected) +expect(received).rejects.not.toHaveLength(expected) -Matcher error: expected value must be a non-negative integer +Matcher error: expected value must be a non-negative integer Expected has type: number Expected has value: NaN `; exports[`.toHaveLength matcher error expected length number float 1`] = ` -expect(received).resolves.toHaveLength(expected) +expect(received).resolves.toHaveLength(expected) -Matcher error: expected value must be a non-negative integer +Matcher error: expected value must be a non-negative integer Expected has type: number Expected has value: 0.5 `; exports[`.toHaveLength matcher error expected length number negative integer 1`] = ` -expect(received).resolves.not.toHaveLength(expected) +expect(received).resolves.not.toHaveLength(expected) -Matcher error: expected value must be a non-negative integer +Matcher error: expected value must be a non-negative integer Expected has type: number Expected has value: -3 `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('1') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) -Matcher error: expected path must be a string or array +Matcher error: expected path must be a string or array Expected has type: number Expected has value: 1 `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('null') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) -Matcher error: expected path must be a string or array +Matcher error: expected path must be a string or array Expected has value: null `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('undefined') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) -Matcher error: expected path must be a string or array +Matcher error: expected path must be a string or array Expected has value: undefined `; exports[`.toHaveProperty() {error} expect({}).toHaveProperty('') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) -Matcher error: expected path must not be an empty array +Matcher error: expected path must not be an empty array Expected has type: array Expected has value: [] `; exports[`.toHaveProperty() {error} expect(null).toHaveProperty('a.b') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) -Matcher error: received value must not be null nor undefined +Matcher error: received value must not be null nor undefined Received has value: null `; exports[`.toHaveProperty() {error} expect(undefined).toHaveProperty('a') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) -Matcher error: received value must not be null nor undefined +Matcher error: received value must not be null nor undefined Received has value: undefined `; exports[`.toHaveProperty() {pass: false} expect("").toHaveProperty('key') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: "key" -Received path: [] +Received path: [] -Received value: "" +Received value: "" `; exports[`.toHaveProperty() {pass: false} expect("abc").toHaveProperty('a.b.c') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: "a.b.c" -Received path: [] +Received path: [] -Received value: "abc" +Received value: "abc" `; exports[`.toHaveProperty() {pass: false} expect("abc").toHaveProperty('a.b.c', {"a": 5}) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a.b.c" -Received path: [] +Received path: [] -Expected value: {"a": 5} -Received value: "abc" +Expected value: {"a": 5} +Received value: "abc" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d', 2) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: ["a", "b", "c", "d"] -Expected value: 2 -Received value: 1 +Expected value: 2 +Received value: 1 `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d', 2) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a.b.c.d" -Expected value: 2 -Received value: 1 +Expected value: 2 +Received value: 1 `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.ttt.d', 1) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a.b.ttt.d" -Received path: "a.b" +Received path: "a.b" -Expected value: 1 -Received value: {"c": {"d": 1}} +Expected value: 1 +Received value: {"c": {"d": 1}} `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('.a.b.c') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: ".a.b.c" -Received path: [] +Received path: [] -Received value: {"a": {"b": {"c": {}}}} +Received value: {"a": {"b": {"c": {}}}} `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('a.b.c.d') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: "a.b.c.d" -Received path: "a.b.c" +Received path: "a.b.c" -Received value: {} +Received value: {} `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('a.b.c.d', 1) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a.b.c.d" -Received path: "a.b.c" +Received path: "a.b.c" -Expected value: 1 -Received value: {} +Expected value: 1 +Received value: {} `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": 5}}}).toHaveProperty('a.b', {"c": 4}) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a.b" -- Expected value - 1 -+ Received value + 1 +- Expected value - 1 ++ Received value + 1 - Object { -- "c": 4, -+ "c": 5, - } + Object { +- "c": 4, ++ "c": 5, + } `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": 3}}).toHaveProperty('a.b', undefined) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a.b" -Expected value: undefined -Received value: 3 +Expected value: undefined +Received value: 3 `; exports[`.toHaveProperty() {pass: false} expect({"a": {}}).toHaveProperty('a.b', undefined) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a.b" -Received path: "a" +Received path: "a" -Expected value: undefined -Received value: {} +Expected value: undefined +Received value: {} `; exports[`.toHaveProperty() {pass: false} expect({"a": 1}).toHaveProperty('a.b.c.d') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: "a.b.c.d" -Received path: "a" +Received path: "a" -Received value: 1 +Received value: 1 `; exports[`.toHaveProperty() {pass: false} expect({"a": 1}).toHaveProperty('a.b.c.d', 5) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a.b.c.d" -Received path: "a" +Received path: "a" -Expected value: 5 -Received value: 1 +Expected value: 5 +Received value: 1 `; exports[`.toHaveProperty() {pass: false} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 2) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a.b.c.d" -Received path: [] +Received path: [] -Expected value: 2 -Received value: {"a.b.c.d": 1} +Expected value: 2 +Received value: {"a.b.c.d": 1} `; exports[`.toHaveProperty() {pass: false} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 2) 2`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: ["a.b.c.d"] -Expected value: 2 -Received value: 1 +Expected value: 2 +Received value: 1 `; exports[`.toHaveProperty() {pass: false} expect({"children": ["\\"That cartoon\\""], "props": null, "type": "p"}).toHaveProperty('children,0', "\\"That cat cartoon\\"") 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: ["children", 0] -Expected value: "\\"That cat cartoon\\"" -Received value: "\\"That cartoon\\"" +Expected value: "\\"That cat cartoon\\"" +Received value: "\\"That cartoon\\"" `; exports[`.toHaveProperty() {pass: false} expect({"children": ["Roses are red. @@ -3538,1279 +3538,1279 @@ Violets are blue. Testing with Jest is good for you."], "props": null, "type": "pre"}).toHaveProperty('children,0', "Roses are red, violets are blue. Testing with Jest Is good for you.") 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: ["children", 0] -- Expected value - 3 -+ Received value + 3 +- Expected value - 3 ++ Received value + 3 -- Roses are red, violets are blue. -+ Roses are red. -+ Violets are blue. -- Testing with Jest -- Is good for you. -+ Testing with Jest is good for you. +- Roses are red, violets are blue. ++ Roses are red. ++ Violets are blue. +- Testing with Jest +- Is good for you. ++ Testing with Jest is good for you. `; exports[`.toHaveProperty() {pass: false} expect({"key": 1}).toHaveProperty('not') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: "not" -Received path: [] +Received path: [] -Received value: {"key": 1} +Received value: {"key": 1} `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: "a" -Received path: [] +Received path: [] -Received value: {} +Received value: {} `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a', "a") 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a" -Expected value: "a" -Received value: undefined +Expected value: "a" +Received value: undefined `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a', "test") 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a" -Received path: [] +Received path: [] -Expected value: "test" -Received value: {} +Expected value: "test" +Received value: {} `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('b', undefined) 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "b" -Expected value: undefined -Received value: "b" +Expected value: undefined +Received value: "b" `; exports[`.toHaveProperty() {pass: false} expect(0).toHaveProperty('key') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: "key" -Received path: [] +Received path: [] -Received value: 0 +Received value: 0 `; exports[`.toHaveProperty() {pass: false} expect(1).toHaveProperty('a.b.c') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: "a.b.c" -Received path: [] +Received path: [] -Received value: 1 +Received value: 1 `; exports[`.toHaveProperty() {pass: false} expect(1).toHaveProperty('a.b.c', "test") 1`] = ` -expect(received).toHaveProperty(path, value) +expect(received).toHaveProperty(path, value) Expected path: "a.b.c" -Received path: [] +Received path: [] -Expected value: "test" -Received value: 1 +Expected value: "test" +Received value: 1 `; exports[`.toHaveProperty() {pass: false} expect(Symbol()).toHaveProperty('key') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: "key" -Received path: [] +Received path: [] -Received value: Symbol() +Received value: Symbol() `; exports[`.toHaveProperty() {pass: false} expect(false).toHaveProperty('key') 1`] = ` -expect(received).toHaveProperty(path) +expect(received).toHaveProperty(path) Expected path: "key" -Received path: [] +Received path: [] -Received value: false +Received value: false `; exports[`.toHaveProperty() {pass: true} expect("").toHaveProperty('length', 0) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "length" +Expected path: "length" -Expected value: not 0 +Expected value: not 0 `; exports[`.toHaveProperty() {pass: true} expect([Function memoized]).toHaveProperty('memo', []) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "memo" +Expected path: "memo" -Expected value: not [] +Expected value: not [] `; exports[`.toHaveProperty() {pass: true} expect({"": 1}).toHaveProperty('', 1) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "" +Expected path: "" -Expected value: not 1 +Expected value: not 1 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [[{"c": [{"d": 1}]}]]}}).toHaveProperty('a.b[0][0].c[0].d', 1) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "a.b[0][0].c[0].d" +Expected path: "a.b[0][0].c[0].d" -Expected value: not 1 +Expected value: not 1 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [{"c": [{"d": 1}]}]}}).toHaveProperty('a.b[0].c[0].d', 1) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "a.b[0].c[0].d" +Expected path: "a.b[0].c[0].d" -Expected value: not 1 +Expected value: not 1 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [{"c": {"d": [{"e": 1}, {"f": 2}]}}]}}).toHaveProperty('a.b[0].c.d[1].f', 2) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "a.b[0].c.d[1].f" +Expected path: "a.b[0].c.d[1].f" -Expected value: not 2 +Expected value: not 2 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1') 1`] = ` -expect(received).not.toHaveProperty(path) +expect(received).not.toHaveProperty(path) -Expected path: not ["a", "b", 1] +Expected path: not ["a", "b", 1] -Received value: 2 +Received value: 2 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1', 2) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: ["a", "b", 1] +Expected path: ["a", "b", 1] -Expected value: not 2 +Expected value: not 2 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1', Any) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: ["a", "b", 1] +Expected path: ["a", "b", 1] -Expected value: not Any -Received value: 2 +Expected value: not Any +Received value: 2 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d') 1`] = ` -expect(received).not.toHaveProperty(path) +expect(received).not.toHaveProperty(path) -Expected path: not ["a", "b", "c", "d"] +Expected path: not ["a", "b", "c", "d"] -Received value: 1 +Received value: 1 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d', 1) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: ["a", "b", "c", "d"] +Expected path: ["a", "b", "c", "d"] -Expected value: not 1 +Expected value: not 1 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d') 1`] = ` -expect(received).not.toHaveProperty(path) +expect(received).not.toHaveProperty(path) -Expected path: not "a.b.c.d" +Expected path: not "a.b.c.d" -Received value: 1 +Received value: 1 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d', 1) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "a.b.c.d" +Expected path: "a.b.c.d" -Expected value: not 1 +Expected value: not 1 `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": 5}}}).toHaveProperty('a.b', {"c": 5}) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "a.b" +Expected path: "a.b" -Expected value: not {"c": 5} +Expected value: not {"c": 5} `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": undefined}}).toHaveProperty('a.b') 1`] = ` -expect(received).not.toHaveProperty(path) +expect(received).not.toHaveProperty(path) -Expected path: not "a.b" +Expected path: not "a.b" -Received value: undefined +Received value: undefined `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": undefined}}).toHaveProperty('a.b', undefined) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "a.b" +Expected path: "a.b" -Expected value: not undefined +Expected value: not undefined `; exports[`.toHaveProperty() {pass: true} expect({"a": 0}).toHaveProperty('a') 1`] = ` -expect(received).not.toHaveProperty(path) +expect(received).not.toHaveProperty(path) -Expected path: not "a" +Expected path: not "a" -Received value: 0 +Received value: 0 `; exports[`.toHaveProperty() {pass: true} expect({"a": 0}).toHaveProperty('a', 0) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "a" +Expected path: "a" -Expected value: not 0 +Expected value: not 0 `; exports[`.toHaveProperty() {pass: true} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d') 1`] = ` -expect(received).not.toHaveProperty(path) +expect(received).not.toHaveProperty(path) -Expected path: not ["a.b.c.d"] +Expected path: not ["a.b.c.d"] -Received value: 1 +Received value: 1 `; exports[`.toHaveProperty() {pass: true} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 1) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: ["a.b.c.d"] +Expected path: ["a.b.c.d"] -Expected value: not 1 +Expected value: not 1 `; exports[`.toHaveProperty() {pass: true} expect({"nodeName": "DIV"}).toHaveProperty('nodeType', 1) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "nodeType" +Expected path: "nodeType" -Expected value: not 1 +Expected value: not 1 `; exports[`.toHaveProperty() {pass: true} expect({"property": 1}).toHaveProperty('property', 1) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "property" +Expected path: "property" -Expected value: not 1 +Expected value: not 1 `; exports[`.toHaveProperty() {pass: true} expect({"val": true}).toHaveProperty('a', undefined) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "a" +Expected path: "a" -Expected value: not undefined +Expected value: not undefined `; exports[`.toHaveProperty() {pass: true} expect({"val": true}).toHaveProperty('c', "c") 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "c" +Expected path: "c" -Expected value: not "c" +Expected value: not "c" `; exports[`.toHaveProperty() {pass: true} expect({"val": true}).toHaveProperty('val', true) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "val" +Expected path: "val" -Expected value: not true +Expected value: not true `; exports[`.toHaveProperty() {pass: true} expect({}).toHaveProperty('a', undefined) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "a" +Expected path: "a" -Expected value: not undefined +Expected value: not undefined `; exports[`.toHaveProperty() {pass: true} expect({}).toHaveProperty('b', "b") 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "b" +Expected path: "b" -Expected value: not "b" +Expected value: not "b" `; exports[`.toHaveProperty() {pass: true} expect({}).toHaveProperty('setter', undefined) 1`] = ` -expect(received).not.toHaveProperty(path, value) +expect(received).not.toHaveProperty(path, value) -Expected path: "setter" +Expected path: "setter" -Expected value: not undefined +Expected value: not undefined `; exports[`.toMatch() {pass: true} expect(Foo bar).toMatch(/^foo/i) 1`] = ` -expect(received).not.toMatch(expected) +expect(received).not.toMatch(expected) -Expected pattern: not /^foo/i -Received string: "Foo bar" +Expected pattern: not /^foo/i +Received string: "Foo bar" `; exports[`.toMatch() {pass: true} expect(foo).toMatch(foo) 1`] = ` -expect(received).not.toMatch(expected) +expect(received).not.toMatch(expected) -Expected substring: not "foo" -Received string: "foo" +Expected substring: not "foo" +Received string: "foo" `; exports[`.toMatch() throws if non String actual value passed: [/foo/i, "foo"] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: received value must be a string +Matcher error: received value must be a string Received has type: regexp Received has value: /foo/i `; exports[`.toMatch() throws if non String actual value passed: [[], "foo"] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: received value must be a string +Matcher error: received value must be a string Received has type: array Received has value: [] `; exports[`.toMatch() throws if non String actual value passed: [[Function anonymous], "foo"] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: received value must be a string +Matcher error: received value must be a string Received has type: function Received has value: [Function anonymous] `; exports[`.toMatch() throws if non String actual value passed: [{}, "foo"] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: received value must be a string +Matcher error: received value must be a string Received has type: object Received has value: {} `; exports[`.toMatch() throws if non String actual value passed: [1, "foo"] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: received value must be a string +Matcher error: received value must be a string Received has type: number Received has value: 1 `; exports[`.toMatch() throws if non String actual value passed: [true, "foo"] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: received value must be a string +Matcher error: received value must be a string Received has type: boolean Received has value: true `; exports[`.toMatch() throws if non String actual value passed: [undefined, "foo"] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: received value must be a string +Matcher error: received value must be a string Received has value: undefined `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", []] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: expected value must be a string or regular expression +Matcher error: expected value must be a string or regular expression Expected has type: array Expected has value: [] `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", [Function anonymous]] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: expected value must be a string or regular expression +Matcher error: expected value must be a string or regular expression Expected has type: function Expected has value: [Function anonymous] `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", {}] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: expected value must be a string or regular expression +Matcher error: expected value must be a string or regular expression Expected has type: object Expected has value: {} `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", 1] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: expected value must be a string or regular expression +Matcher error: expected value must be a string or regular expression Expected has type: number Expected has value: 1 `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", true] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: expected value must be a string or regular expression +Matcher error: expected value must be a string or regular expression Expected has type: boolean Expected has value: true `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", undefined] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Matcher error: expected value must be a string or regular expression +Matcher error: expected value must be a string or regular expression Expected has value: undefined `; exports[`.toMatch() throws: [bar, /foo/] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Expected pattern: /foo/ -Received string: "bar" +Expected pattern: /foo/ +Received string: "bar" `; exports[`.toMatch() throws: [bar, foo] 1`] = ` -expect(received).toMatch(expected) +expect(received).toMatch(expected) -Expected substring: "foo" -Received string: "bar" +Expected substring: "foo" +Received string: "bar" `; exports[`.toStrictEqual() displays substring diff 1`] = ` -expect(received).toStrictEqual(expected) // deep equality +expect(received).toStrictEqual(expected) // deep equality -Expected: "Another caveat is that Jest will not typecheck your tests." -Received: "Because TypeScript support in Babel is just transpilation, Jest will not type-check your tests as they run." +Expected: "Another caveat is that Jest will not typecheck your tests." +Received: "Because TypeScript support in Babel is just transpilation, Jest will not type-check your tests as they run." `; exports[`.toStrictEqual() displays substring diff for multiple lines 1`] = ` -expect(received).toStrictEqual(expected) // deep equality - -- Expected - 7 -+ Received + 7 - -- 69 | -+ 68 | -- 70 | test('assert.doesNotThrow', () => { -+ 69 | test('assert.doesNotThrow', () => { -- > 71 | assert.doesNotThrow(() => { -+ > 70 | assert.doesNotThrow(() => { - | ^ -- 72 | throw Error('err!'); -+ 71 | throw Error('err!'); -- 73 | }); -+ 72 | }); -- 74 | }); -+ 73 | }); -- at Object.doesNotThrow (__tests__/assertionError.test.js:71:10) -+ at Object.doesNotThrow (__tests__/assertionError.test.js:70:10) +expect(received).toStrictEqual(expected) // deep equality + +- Expected - 7 ++ Received + 7 + +- 69 |  ++ 68 | +- 70 | test('assert.doesNotThrow', () => { ++ 69 | test('assert.doesNotThrow', () => { +- > 71 | assert.doesNotThrow(() => { ++ > 70 | assert.doesNotThrow(() => { + | ^ +- 72 | throw Error('err!'); ++ 71 | throw Error('err!'); +- 73 | }); ++ 72 | }); +- 74 | }); ++ 73 | }); +- at Object.doesNotThrow (__tests__/assertionError.test.js:71:10) ++ at Object.doesNotThrow (__tests__/assertionError.test.js:70:10) `; exports[`.toStrictEqual() matches the expected snapshot when it fails 1`] = ` -expect(received).toStrictEqual(expected) // deep equality +expect(received).toStrictEqual(expected) // deep equality -- Expected - 4 -+ Received + 1 +- Expected - 4 ++ Received + 1 - Object { -- "test": TestClassA { -- "a": 1, -- "b": 2, -- }, -+ "test": 2, - } + Object { +- "test": TestClassA { +- "a": 1, +- "b": 2, +- }, ++ "test": 2, + } `; exports[`.toStrictEqual() matches the expected snapshot when it fails 2`] = ` -expect(received).not.toStrictEqual(expected) // deep equality +expect(received).not.toStrictEqual(expected) // deep equality -Expected: not {"test": {"a": 1, "b": 2}} +Expected: not {"test": {"a": 1, "b": 2}} `; exports[`toMatchObject() {pass: false} expect([0]).toMatchObject([-0]) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Array [ -- -0, -+ 0, - ] + Array [ +- -0, ++ 0, + ] `; exports[`toMatchObject() {pass: false} expect([1, 2, 3]).toMatchObject([1, 2, 2]) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Array [ - 1, - 2, -- 2, -+ 3, - ] + Array [ + 1, + 2, +- 2, ++ 3, + ] `; exports[`toMatchObject() {pass: false} expect([1, 2, 3]).toMatchObject([2, 3, 1]) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Array [ -+ 1, - 2, - 3, -- 1, - ] + Array [ ++ 1, + 2, + 3, +- 1, + ] `; exports[`toMatchObject() {pass: false} expect([1, 2]).toMatchObject([1, 3]) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Array [ - 1, -- 3, -+ 2, - ] + Array [ + 1, +- 3, ++ 2, + ] `; exports[`toMatchObject() {pass: false} expect([Error: foo]).toMatchObject([Error: bar]) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Expected: [Error: bar] -Received: [Error: foo] +Expected: [Error: bar] +Received: [Error: foo] `; exports[`toMatchObject() {pass: false} expect({"a": "a", "c": "d"}).toMatchObject({"a": Any}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": Any, -+ "a": "a", - } + Object { +- "a": Any, ++ "a": "a", + } `; exports[`toMatchObject() {pass: false} expect({"a": "b", "c": "d", Symbol(jest): "jest"}).toMatchObject({"a": "c", Symbol(jest): Any}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": "c", -+ "a": "b", - Symbol(jest): Any, - } + Object { +- "a": "c", ++ "a": "b", + Symbol(jest): Any, + } `; exports[`toMatchObject() {pass: false} expect({"a": "b", "c": "d"}).toMatchObject({"a": "b!", "c": "d"}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": "b!", -+ "a": "b", - "c": "d", - } + Object { +- "a": "b!", ++ "a": "b", + "c": "d", + } `; exports[`toMatchObject() {pass: false} expect({"a": "b", "c": "d"}).toMatchObject({"e": "b"}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 2 +- Expected - 1 ++ Received + 2 - Object { -- "e": "b", -+ "a": "b", -+ "c": "d", - } + Object { +- "e": "b", ++ "a": "b", ++ "c": "d", + } `; exports[`toMatchObject() {pass: false} expect({"a": "b", "t": {"x": {"r": "r"}, "z": "z"}}).toMatchObject({"a": "b", "t": {"z": [3]}}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 3 -+ Received + 1 +- Expected - 3 ++ Received + 1 - Object { - "a": "b", - "t": Object { -- "z": Array [ -- 3, -- ], -+ "z": "z", - }, - } + Object { + "a": "b", + "t": Object { +- "z": Array [ +- 3, +- ], ++ "z": "z", + }, + } `; exports[`toMatchObject() {pass: false} expect({"a": "b", "t": {"x": {"r": "r"}, "z": "z"}}).toMatchObject({"t": {"l": {"r": "r"}}}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 2 +- Expected - 1 ++ Received + 2 - Object { - "t": Object { -- "l": Object { -+ "x": Object { - "r": "r", - }, -+ "z": "z", - }, - } + Object { + "t": Object { +- "l": Object { ++ "x": Object { + "r": "r", + }, ++ "z": "z", + }, + } `; exports[`toMatchObject() {pass: false} expect({"a": "b"}).toMatchObject({"c": "d"}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "c": "d", -+ "a": "b", - } + Object { +- "c": "d", ++ "a": "b", + } `; exports[`toMatchObject() {pass: false} expect({"a": "b"}).toMatchObject({"toString": Any}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 0 -+ Received + 1 +- Expected - 0 ++ Received + 1 - Object { -+ "a": "b", - "toString": Any, - } + Object { ++ "a": "b", + "toString": Any, + } `; exports[`toMatchObject() {pass: false} expect({"a": [{"a": "a", "b": "b"}]}).toMatchObject({"a": [{"a": "c"}]}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { - "a": Array [ - Object { -- "a": "c", -+ "a": "a", - }, - ], - } + Object { + "a": Array [ + Object { +- "a": "c", ++ "a": "a", + }, + ], + } `; exports[`toMatchObject() {pass: false} expect({"a": [3, 4, "v"], "b": "b"}).toMatchObject({"a": ["v"]}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 0 -+ Received + 2 +- Expected - 0 ++ Received + 2 - Object { - "a": Array [ -+ 3, -+ 4, - "v", - ], - } + Object { + "a": Array [ ++ 3, ++ 4, + "v", + ], + } `; exports[`toMatchObject() {pass: false} expect({"a": [3, 4, 5], "b": "b"}).toMatchObject({"a": [3, 4, 5, 6]}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 0 +- Expected - 1 ++ Received + 0 - Object { - "a": Array [ - 3, - 4, - 5, -- 6, - ], - } + Object { + "a": Array [ + 3, + 4, + 5, +- 6, + ], + } `; exports[`toMatchObject() {pass: false} expect({"a": [3, 4, 5], "b": "b"}).toMatchObject({"a": [3, 4]}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 0 -+ Received + 1 +- Expected - 0 ++ Received + 1 - Object { - "a": Array [ - 3, - 4, -+ 5, - ], - } + Object { + "a": Array [ + 3, + 4, ++ 5, + ], + } `; exports[`toMatchObject() {pass: false} expect({"a": [3, 4, 5], "b": "b"}).toMatchObject({"a": {"b": 4}}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 3 -+ Received + 5 +- Expected - 3 ++ Received + 5 - Object { -- "a": Object { -- "b": 4, -- }, -+ "a": Array [ -+ 3, -+ 4, -+ 5, -+ ], - } + Object { +- "a": Object { +- "b": 4, +- }, ++ "a": Array [ ++ 3, ++ 4, ++ 5, ++ ], + } `; exports[`toMatchObject() {pass: false} expect({"a": [3, 4, 5], "b": "b"}).toMatchObject({"a": {"b": Any}}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 3 -+ Received + 5 +- Expected - 3 ++ Received + 5 - Object { -- "a": Object { -- "b": Any, -- }, -+ "a": Array [ -+ 3, -+ 4, -+ 5, -+ ], - } + Object { +- "a": Object { +- "b": Any, +- }, ++ "a": Array [ ++ 3, ++ 4, ++ 5, ++ ], + } `; exports[`toMatchObject() {pass: false} expect({"a": 1, "b": 1, "c": 1, "d": {"e": {"f": 555}}}).toMatchObject({"d": {"e": {"f": 222}}}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { - "d": Object { - "e": Object { -- "f": 222, -+ "f": 555, - }, - }, - } + Object { + "d": Object { + "e": Object { +- "f": 222, ++ "f": 555, + }, + }, + } `; exports[`toMatchObject() {pass: false} expect({"a": 2015-11-30T00:00:00.000Z, "b": "b"}).toMatchObject({"a": 2015-10-10T00:00:00.000Z}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": 2015-10-10T00:00:00.000Z, -+ "a": 2015-11-30T00:00:00.000Z, - } + Object { +- "a": 2015-10-10T00:00:00.000Z, ++ "a": 2015-11-30T00:00:00.000Z, + } `; exports[`toMatchObject() {pass: false} expect({"a": null, "b": "b"}).toMatchObject({"a": "4"}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": "4", -+ "a": null, - } + Object { +- "a": "4", ++ "a": null, + } `; exports[`toMatchObject() {pass: false} expect({"a": null, "b": "b"}).toMatchObject({"a": undefined}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": undefined, -+ "a": null, - } + Object { +- "a": undefined, ++ "a": null, + } `; exports[`toMatchObject() {pass: false} expect({"a": undefined}).toMatchObject({"a": null}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": null, -+ "a": undefined, - } + Object { +- "a": null, ++ "a": undefined, + } `; exports[`toMatchObject() {pass: false} expect({}).toMatchObject({"a": undefined}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 3 -+ Received + 1 +- Expected - 3 ++ Received + 1 -- Object { -- "a": undefined, -- } -+ Object {} +- Object { +- "a": undefined, +- } ++ Object {} `; exports[`toMatchObject() {pass: false} expect(2015-11-30T00:00:00.000Z).toMatchObject(2015-10-10T00:00:00.000Z) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Expected: 2015-10-10T00:00:00.000Z -Received: 2015-11-30T00:00:00.000Z +Expected: 2015-10-10T00:00:00.000Z +Received: 2015-11-30T00:00:00.000Z `; exports[`toMatchObject() {pass: false} expect(Set {1, 2}).toMatchObject(Set {2}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 0 -+ Received + 1 +- Expected - 0 ++ Received + 1 - Set { -+ 1, - 2, - } + Set { ++ 1, + 2, + } `; exports[`toMatchObject() {pass: true} expect([]).toMatchObject([]) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not [] +Expected: not [] `; exports[`toMatchObject() {pass: true} expect([1, 2]).toMatchObject([1, 2]) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not [1, 2] +Expected: not [1, 2] `; exports[`toMatchObject() {pass: true} expect([Error: bar]).toMatchObject({"message": "bar"}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"message": "bar"} -Received: [Error: bar] +Expected: not {"message": "bar"} +Received: [Error: bar] `; exports[`toMatchObject() {pass: true} expect([Error: foo]).toMatchObject([Error: foo]) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not [Error: foo] +Expected: not [Error: foo] `; exports[`toMatchObject() {pass: true} expect({"a": "b", "c": "d", Symbol(jest): "jest"}).toMatchObject({"a": "b", "c": "d", Symbol(jest): "jest"}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": "b", "c": "d", Symbol(jest): "jest"} +Expected: not {"a": "b", "c": "d", Symbol(jest): "jest"} `; exports[`toMatchObject() {pass: true} expect({"a": "b", "c": "d", Symbol(jest): "jest"}).toMatchObject({"a": "b", Symbol(jest): "jest"}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": "b", Symbol(jest): "jest"} -Received: {"a": "b", "c": "d", Symbol(jest): "jest"} +Expected: not {"a": "b", Symbol(jest): "jest"} +Received: {"a": "b", "c": "d", Symbol(jest): "jest"} `; exports[`toMatchObject() {pass: true} expect({"a": "b", "c": "d"}).toMatchObject({"a": "b", "c": "d"}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": "b", "c": "d"} +Expected: not {"a": "b", "c": "d"} `; exports[`toMatchObject() {pass: true} expect({"a": "b", "c": "d"}).toMatchObject({"a": "b"}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": "b"} -Received: {"a": "b", "c": "d"} +Expected: not {"a": "b"} +Received: {"a": "b", "c": "d"} `; exports[`toMatchObject() {pass: true} expect({"a": "b", "t": {"x": {"r": "r"}, "z": "z"}}).toMatchObject({"a": "b", "t": {"z": "z"}}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": "b", "t": {"z": "z"}} -Received: {"a": "b", "t": {"x": {"r": "r"}, "z": "z"}} +Expected: not {"a": "b", "t": {"z": "z"}} +Received: {"a": "b", "t": {"x": {"r": "r"}, "z": "z"}} `; exports[`toMatchObject() {pass: true} expect({"a": "b", "t": {"x": {"r": "r"}, "z": "z"}}).toMatchObject({"t": {"x": {"r": "r"}}}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"t": {"x": {"r": "r"}}} -Received: {"a": "b", "t": {"x": {"r": "r"}, "z": "z"}} +Expected: not {"t": {"x": {"r": "r"}}} +Received: {"a": "b", "t": {"x": {"r": "r"}, "z": "z"}} `; exports[`toMatchObject() {pass: true} expect({"a": "b", "toString": [Function toString]}).toMatchObject({"toString": Any}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"toString": Any} -Received: {"a": "b", "toString": [Function toString]} +Expected: not {"toString": Any} +Received: {"a": "b", "toString": [Function toString]} `; exports[`toMatchObject() {pass: true} expect({"a": "b"}).toMatchObject({"a": "b"}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": "b"} +Expected: not {"a": "b"} `; exports[`toMatchObject() {pass: true} expect({"a": [{"a": "a", "b": "b"}]}).toMatchObject({"a": [{"a": "a"}]}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": [{"a": "a"}]} -Received: {"a": [{"a": "a", "b": "b"}]} +Expected: not {"a": [{"a": "a"}]} +Received: {"a": [{"a": "a", "b": "b"}]} `; exports[`toMatchObject() {pass: true} expect({"a": [3, 4, 5, "v"], "b": "b"}).toMatchObject({"a": [3, 4, 5, "v"]}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": [3, 4, 5, "v"]} -Received: {"a": [3, 4, 5, "v"], "b": "b"} +Expected: not {"a": [3, 4, 5, "v"]} +Received: {"a": [3, 4, 5, "v"], "b": "b"} `; exports[`toMatchObject() {pass: true} expect({"a": [3, 4, 5], "b": "b"}).toMatchObject({"a": [3, 4, 5]}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": [3, 4, 5]} -Received: {"a": [3, 4, 5], "b": "b"} +Expected: not {"a": [3, 4, 5]} +Received: {"a": [3, 4, 5], "b": "b"} `; exports[`toMatchObject() {pass: true} expect({"a": {"x": "x", "y": "y"}}).toMatchObject({"a": {"x": Any}}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": {"x": Any}} -Received: {"a": {"x": "x", "y": "y"}} +Expected: not {"a": {"x": Any}} +Received: {"a": {"x": "x", "y": "y"}} `; exports[`toMatchObject() {pass: true} expect({"a": 1, "c": 2}).toMatchObject({"a": Any}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": Any} -Received: {"a": 1, "c": 2} +Expected: not {"a": Any} +Received: {"a": 1, "c": 2} `; exports[`toMatchObject() {pass: true} expect({"a": 2015-11-30T00:00:00.000Z, "b": "b"}).toMatchObject({"a": 2015-11-30T00:00:00.000Z}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": 2015-11-30T00:00:00.000Z} -Received: {"a": 2015-11-30T00:00:00.000Z, "b": "b"} +Expected: not {"a": 2015-11-30T00:00:00.000Z} +Received: {"a": 2015-11-30T00:00:00.000Z, "b": "b"} `; exports[`toMatchObject() {pass: true} expect({"a": null, "b": "b"}).toMatchObject({"a": null}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": null} -Received: {"a": null, "b": "b"} +Expected: not {"a": null} +Received: {"a": null, "b": "b"} `; exports[`toMatchObject() {pass: true} expect({"a": undefined, "b": "b"}).toMatchObject({"a": undefined}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": undefined} -Received: {"a": undefined, "b": "b"} +Expected: not {"a": undefined} +Received: {"a": undefined, "b": "b"} `; exports[`toMatchObject() {pass: true} expect({"a": undefined}).toMatchObject({"a": undefined}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": undefined} +Expected: not {"a": undefined} `; exports[`toMatchObject() {pass: true} expect({}).toMatchObject({"a": undefined, "b": "b", "c": "c"}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": undefined, "b": "b", "c": "c"} -Received: {} +Expected: not {"a": undefined, "b": "b", "c": "c"} +Received: {} `; exports[`toMatchObject() {pass: true} expect({}).toMatchObject({"a": undefined, "b": "b"}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": undefined, "b": "b"} -Received: {} +Expected: not {"a": undefined, "b": "b"} +Received: {} `; exports[`toMatchObject() {pass: true} expect({}).toMatchObject({"d": 4}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"d": 4} -Received: {} +Expected: not {"d": 4} +Received: {} `; exports[`toMatchObject() {pass: true} expect(2015-11-30T00:00:00.000Z).toMatchObject(2015-11-30T00:00:00.000Z) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not 2015-11-30T00:00:00.000Z +Expected: not 2015-11-30T00:00:00.000Z `; exports[`toMatchObject() {pass: true} expect(Set {1, 2}).toMatchObject(Set {1, 2}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not Set {1, 2} +Expected: not Set {1, 2} `; exports[`toMatchObject() {pass: true} expect(Set {1, 2}).toMatchObject(Set {2, 1}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not Set {2, 1} -Received: Set {1, 2} +Expected: not Set {2, 1} +Received: Set {1, 2} `; exports[`toMatchObject() circular references simple circular references {pass: false} expect({"a": "hello", "ref": [Circular]}).toMatchObject({"a": "world", "ref": [Circular]}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": "world", -+ "a": "hello", - "ref": [Circular], - } + Object { +- "a": "world", ++ "a": "hello", + "ref": [Circular], + } `; exports[`toMatchObject() circular references simple circular references {pass: false} expect({"ref": "not a ref"}).toMatchObject({"a": "hello", "ref": [Circular]}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 2 -+ Received + 1 +- Expected - 2 ++ Received + 1 - Object { -- "a": "hello", -- "ref": [Circular], -+ "ref": "not a ref", - } + Object { +- "a": "hello", +- "ref": [Circular], ++ "ref": "not a ref", + } `; exports[`toMatchObject() circular references simple circular references {pass: false} expect({}).toMatchObject({"a": "hello", "ref": [Circular]}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 4 -+ Received + 1 +- Expected - 4 ++ Received + 1 -- Object { -- "a": "hello", -- "ref": [Circular], -- } -+ Object {} +- Object { +- "a": "hello", +- "ref": [Circular], +- } ++ Object {} `; exports[`toMatchObject() circular references simple circular references {pass: true} expect({"a": "hello", "ref": [Circular]}).toMatchObject({"a": "hello", "ref": [Circular]}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": "hello", "ref": [Circular]} +Expected: not {"a": "hello", "ref": [Circular]} `; exports[`toMatchObject() circular references simple circular references {pass: true} expect({"a": "hello", "ref": [Circular]}).toMatchObject({}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {} -Received: {"a": "hello", "ref": [Circular]} +Expected: not {} +Received: {"a": "hello", "ref": [Circular]} `; exports[`toMatchObject() circular references transitive circular references {pass: false} expect({"a": "world", "nestedObj": {"parentObj": [Circular]}}).toMatchObject({"a": "hello", "nestedObj": {"parentObj": [Circular]}}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 1 +- Expected - 1 ++ Received + 1 - Object { -- "a": "hello", -+ "a": "world", - "nestedObj": Object { - "parentObj": [Circular], - }, - } + Object { +- "a": "hello", ++ "a": "world", + "nestedObj": Object { + "parentObj": [Circular], + }, + } `; exports[`toMatchObject() circular references transitive circular references {pass: false} expect({"nestedObj": {"parentObj": "not the parent ref"}}).toMatchObject({"a": "hello", "nestedObj": {"parentObj": [Circular]}}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 2 -+ Received + 1 +- Expected - 2 ++ Received + 1 - Object { -- "a": "hello", - "nestedObj": Object { -- "parentObj": [Circular], -+ "parentObj": "not the parent ref", - }, - } + Object { +- "a": "hello", + "nestedObj": Object { +- "parentObj": [Circular], ++ "parentObj": "not the parent ref", + }, + } `; exports[`toMatchObject() circular references transitive circular references {pass: false} expect({}).toMatchObject({"a": "hello", "nestedObj": {"parentObj": [Circular]}}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 6 -+ Received + 1 +- Expected - 6 ++ Received + 1 -- Object { -- "a": "hello", -- "nestedObj": Object { -- "parentObj": [Circular], -- }, -- } -+ Object {} +- Object { +- "a": "hello", +- "nestedObj": Object { +- "parentObj": [Circular], +- }, +- } ++ Object {} `; exports[`toMatchObject() circular references transitive circular references {pass: true} expect({"a": "hello", "nestedObj": {"parentObj": [Circular]}}).toMatchObject({"a": "hello", "nestedObj": {"parentObj": [Circular]}}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {"a": "hello", "nestedObj": {"parentObj": [Circular]}} +Expected: not {"a": "hello", "nestedObj": {"parentObj": [Circular]}} `; exports[`toMatchObject() circular references transitive circular references {pass: true} expect({"a": "hello", "nestedObj": {"parentObj": [Circular]}}).toMatchObject({}) 1`] = ` -expect(received).not.toMatchObject(expected) +expect(received).not.toMatchObject(expected) -Expected: not {} -Received: {"a": "hello", "nestedObj": {"parentObj": [Circular]}} +Expected: not {} +Received: {"a": "hello", "nestedObj": {"parentObj": [Circular]}} `; exports[`toMatchObject() does not match properties up in the prototype chain 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -- Expected - 1 -+ Received + 0 +- Expected - 1 ++ Received + 0 - Object { - "other": "child", -- "ref": [Circular], - } + Object { + "other": "child", +- "ref": [Circular], + } `; exports[`toMatchObject() throws expect("44").toMatchObject({}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Matcher error: received value must be a non-null object +Matcher error: received value must be a non-null object Received has type: string Received has value: "44" `; exports[`toMatchObject() throws expect({}).toMatchObject("some string") 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Matcher error: expected value must be a non-null object +Matcher error: expected value must be a non-null object Expected has type: string Expected has value: "some string" `; exports[`toMatchObject() throws expect({}).toMatchObject(4) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Matcher error: expected value must be a non-null object +Matcher error: expected value must be a non-null object Expected has type: number Expected has value: 4 `; exports[`toMatchObject() throws expect({}).toMatchObject(null) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Matcher error: expected value must be a non-null object +Matcher error: expected value must be a non-null object Expected has value: null `; exports[`toMatchObject() throws expect({}).toMatchObject(true) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Matcher error: expected value must be a non-null object +Matcher error: expected value must be a non-null object Expected has type: boolean Expected has value: true `; exports[`toMatchObject() throws expect({}).toMatchObject(undefined) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Matcher error: expected value must be a non-null object +Matcher error: expected value must be a non-null object Expected has value: undefined `; exports[`toMatchObject() throws expect(4).toMatchObject({}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Matcher error: received value must be a non-null object +Matcher error: received value must be a non-null object Received has type: number Received has value: 4 `; exports[`toMatchObject() throws expect(null).toMatchObject({}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Matcher error: received value must be a non-null object +Matcher error: received value must be a non-null object Received has value: null `; exports[`toMatchObject() throws expect(true).toMatchObject({}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Matcher error: received value must be a non-null object +Matcher error: received value must be a non-null object Received has type: boolean Received has value: true `; exports[`toMatchObject() throws expect(undefined).toMatchObject({}) 1`] = ` -expect(received).toMatchObject(expected) +expect(received).toMatchObject(expected) -Matcher error: received value must be a non-null object +Matcher error: received value must be a non-null object Received has value: undefined `; diff --git a/packages/expect/src/__tests__/extend.test.ts b/packages/expect/src/__tests__/extend.test.ts index 9298fba80d3c..a2b2434064e8 100644 --- a/packages/expect/src/__tests__/extend.test.ts +++ b/packages/expect/src/__tests__/extend.test.ts @@ -94,6 +94,10 @@ it('exposes matcherUtils in context', () => { const pass: boolean = this.equals( this.utils, Object.assign(matcherUtils, { + diffExpectedColor: matcherUtils.EXPECTED_COLOR, + diffReceivedColor: matcherUtils.RECEIVED_COLOR, + hintExpectedColor: matcherUtils.EXPECTED_COLOR, + hintReceivedColor: matcherUtils.RECEIVED_COLOR, iterableEquality, subsetEquality, }), diff --git a/packages/expect/src/__tests__/matchers.test.js b/packages/expect/src/__tests__/matchers.test.js index 8bee39142ea5..3a7500ecf1e3 100644 --- a/packages/expect/src/__tests__/matchers.test.js +++ b/packages/expect/src/__tests__/matchers.test.js @@ -9,10 +9,58 @@ const chalk = require('chalk'); const Immutable = require('immutable'); const {alignedAnsiStyleSerializer} = require('@jest/test-utils'); const {stringify} = require('jest-matcher-utils'); +const matcherUtils = require('jest-matcher-utils'); const {expect: jestExpect} = require('../'); const chalkEnabled = chalk.enabled; +const matcherHintOptions = { + expectedColor: chalk.yellow, + noDim: true, + receivedColor: chalk.magenta, + secondArgumentColor: chalk.yellow, +}; +const diffOptions = { + aColor: chalk.bgHex(' #0000FF'), + bColor: chalk.magenta, + noDim: true, +}; expect.addSnapshotSerializer(alignedAnsiStyleSerializer); +expect.setState({diffOptions, matcherHintOptions}); + +const registerSpies = () => { + return { + matcherHint: jest.spyOn(matcherUtils, 'matcherHint'), + printDiffOrStringify: jest.spyOn(matcherUtils, 'printDiffOrStringify'), + printExpected: jest.spyOn(matcherUtils, 'printExpected'), + printReceived: jest.spyOn(matcherUtils, 'printReceived'), + }; +}; + +const expectUserColorsAreUsed = ( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, +) => { + matcherHint.mock.calls.forEach(call => { + const passedOptions = call[3]; + Object.keys(matcherHintOptions).forEach(key => { + expect(matcherHintOptions[key]).toEqual(passedOptions[key]); + }); + }); + + printExpected.mock.calls.forEach(call => + expect(call[1]).toEqual(diffOptions.aColor), + ); + + printReceived.mock.calls.forEach(call => + expect(call[1]).toEqual(diffOptions.bColor), + ); + + printDiffOrStringify.mock.calls.forEach(call => + expect(call[5]).toEqual(diffOptions), + ); +}; jestExpect.extend({ optionalFn(fn) { @@ -245,7 +293,17 @@ describe('.toBe()', () => { [-0, +0], ].forEach(([a, b]) => { it(`fails for: ${stringify(a)} and ${stringify(b)}`, () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect(a).toBe(b)).toThrowErrorMatchingSnapshot(); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); @@ -254,32 +312,75 @@ describe('.toBe()', () => { [{a: BigInt(1)}, {a: BigInt(1)}], ].forEach(([a, b]) => { it(`fails for: ${stringify(a)} and ${stringify(b)}`, () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect(a).toBe(b)).toThrow('toBe'); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); [false, 1, 'a', undefined, null, {}, []].forEach(v => { it(`fails for '${stringify(v)}' with '.not'`, () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect(v).not.toBe(v)).toThrowErrorMatchingSnapshot(); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); [BigInt(1), BigInt('1')].forEach(v => { it(`fails for '${stringify(v)}' with '.not'`, () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect(v).not.toBe(v)).toThrow('toBe'); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); it('does not crash on circular references', () => { const obj = {}; obj.circular = obj; + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); expect(() => jestExpect(obj).toBe({})).toThrowErrorMatchingSnapshot(); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); - test('assertion error matcherResult property contains matcher name, expected and actual values', () => { + it('assertion error matcherResult property contains matcher name, expected and actual values', () => { const actual = {a: 1}; const expected = {a: 2}; + + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + try { jestExpect(actual).toBe(expected); } catch (error) { @@ -291,6 +392,13 @@ describe('.toBe()', () => { }), ); } + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); @@ -348,6 +456,9 @@ describe('.toStrictEqual()', () => { }); it('matches the expected snapshot when it fails', () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect({ test: 2, @@ -359,6 +470,13 @@ describe('.toStrictEqual()', () => { test: new TestClassA(1, 2), }).not.toStrictEqual({test: new TestClassA(1, 2)}), ).toThrowErrorMatchingSnapshot(); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); it('displays substring diff', () => { @@ -366,9 +484,20 @@ describe('.toStrictEqual()', () => { 'Another caveat is that Jest will not typecheck your tests.'; const received = 'Because TypeScript support in Babel is just transpilation, Jest will not type-check your tests as they run.'; + + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect(received).toStrictEqual(expected), ).toThrowErrorMatchingSnapshot(); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); it('displays substring diff for multiple lines', () => { @@ -392,9 +521,20 @@ describe('.toStrictEqual()', () => { ' 73 | });', ' at Object.doesNotThrow (__tests__/assertionError.test.js:70:10)', ].join('\n'); + + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect(received).toStrictEqual(expected), ).toThrowErrorMatchingSnapshot(); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); it('does not pass for different types', () => { @@ -687,8 +827,18 @@ describe('.toEqual()', () => { test(`{pass: false} expect(${stringify(a)}).toEqual(${stringify( b, )})`, () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect(a).toEqual(b)).toThrowErrorMatchingSnapshot(); jestExpect(a).not.toEqual(b); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); @@ -699,8 +849,18 @@ describe('.toEqual()', () => { test(`{pass: false} expect(${stringify(a)}).toEqual(${stringify( b, )})`, () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect(a).toEqual(b)).toThrow('toEqual'); jestExpect(a).not.toEqual(b); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); @@ -932,8 +1092,18 @@ describe('.toEqual()', () => { test(`{pass: true} expect(${stringify(a)}).not.toEqual(${stringify( b, )})`, () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + jestExpect(a).toEqual(b); expect(() => jestExpect(a).not.toEqual(b)).toThrowErrorMatchingSnapshot(); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); @@ -952,14 +1122,27 @@ describe('.toEqual()', () => { test(`{pass: true} expect(${stringify(a)}).not.toEqual(${stringify( b, )})`, () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + jestExpect(a).toEqual(b); expect(() => jestExpect(a).not.toEqual(b)).toThrow('toEqual'); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); test('assertion error matcherResult property contains matcher name, expected and actual values', () => { const actual = {a: 1}; const expected = {a: 2}; + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + try { jestExpect(actual).toEqual(expected); } catch (error) { @@ -971,6 +1154,13 @@ describe('.toEqual()', () => { }), ); } + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); test('symbol based keys in arrays are processed correctly', () => { @@ -1103,11 +1293,21 @@ describe('.toBeInstanceOf()', () => { [new HasStaticNameMethod(), HasStaticNameMethod], // Expected ].forEach(([a, b]) => { test(`passing ${stringify(a)} and ${stringify(b)}`, () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect(a).not.toBeInstanceOf(b), ).toThrowErrorMatchingSnapshot(); jestExpect(a).toBeInstanceOf(b); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); @@ -1123,11 +1323,21 @@ describe('.toBeInstanceOf()', () => { [new DefinesNameProp(), RegExp], ].forEach(([a, b]) => { test(`failing ${stringify(a)} and ${stringify(b)}`, () => { + const {matcherHint, printExpected, printReceived, printDiffOrStringify} = + registerSpies(); + expect(() => jestExpect(a).toBeInstanceOf(b), ).toThrowErrorMatchingSnapshot(); jestExpect(a).not.toBeInstanceOf(b); + + expectUserColorsAreUsed( + matcherHint, + printExpected, + printReceived, + printDiffOrStringify, + ); }); }); diff --git a/packages/expect/src/asymmetricMatchers.ts b/packages/expect/src/asymmetricMatchers.ts index 5bd543ac5297..47597a91aeff 100644 --- a/packages/expect/src/asymmetricMatchers.ts +++ b/packages/expect/src/asymmetricMatchers.ts @@ -14,6 +14,7 @@ import { subsetEquality, } from '@jest/expect-utils'; import * as matcherUtils from 'jest-matcher-utils'; +import {EXPECTED_COLOR, RECEIVED_COLOR} from 'jest-matcher-utils'; import {pluralize} from 'jest-util'; import {getCustomEqualityTesters, getState} from './jestMatchersObject'; import type { @@ -35,11 +36,25 @@ function fnNameFor(func: () => unknown) { return matches ? matches[1] : ''; } -const utils = Object.freeze({ - ...matcherUtils, - iterableEquality, - subsetEquality, -}); +const utils = (function () { + const state = getState(); + const hintExpectedColor = + state.matcherHintOptions?.expectedColor ?? EXPECTED_COLOR; + const hintReceivedColor = + state.matcherHintOptions?.receivedColor ?? RECEIVED_COLOR; + const diffExpectedColor = state.diffOptions?.aColor ?? EXPECTED_COLOR; + const diffReceivedColor = state.diffOptions?.bColor ?? RECEIVED_COLOR; + + return Object.freeze({ + ...matcherUtils, + diffExpectedColor, + diffReceivedColor, + hintExpectedColor, + hintReceivedColor, + iterableEquality, + subsetEquality, + }); +})(); function getPrototype(obj: object) { if (Object.getPrototypeOf) { diff --git a/packages/expect/src/extractExpectedAssertionsErrors.ts b/packages/expect/src/extractExpectedAssertionsErrors.ts index 8c7972e1c2aa..1d991ad05f92 100644 --- a/packages/expect/src/extractExpectedAssertionsErrors.ts +++ b/packages/expect/src/extractExpectedAssertionsErrors.ts @@ -35,23 +35,28 @@ const extractExpectedAssertionsErrors: Expect['extractExpectedAssertionsErrors'] expectedAssertionsNumberError, isExpectingAssertions, isExpectingAssertionsError, + matcherHintOptions, } = getState(); + const expectedColor = matcherHintOptions?.expectedColor ?? EXPECTED_COLOR; + const receivedColor = matcherHintOptions?.receivedColor ?? RECEIVED_COLOR; + resetAssertionsLocalState(); if ( typeof expectedAssertionsNumber === 'number' && assertionCalls !== expectedAssertionsNumber ) { - const numOfAssertionsExpected = EXPECTED_COLOR( + const numOfAssertionsExpected = expectedColor( pluralize('assertion', expectedAssertionsNumber), ); expectedAssertionsNumberError!.message = `${matcherHint('.assertions', '', expectedAssertionsNumber.toString(), { + ...matcherHintOptions, isDirectExpectCall: true, })}\n\n` + - `Expected ${numOfAssertionsExpected} to be called but received ${RECEIVED_COLOR( + `Expected ${numOfAssertionsExpected} to be called but received ${receivedColor( pluralize('assertion call', assertionCalls || 0), )}.`; @@ -62,14 +67,17 @@ const extractExpectedAssertionsErrors: Expect['extractExpectedAssertionsErrors'] }); } if (isExpectingAssertions && assertionCalls === 0) { - const expected = EXPECTED_COLOR('at least one assertion'); - const received = RECEIVED_COLOR('received none'); + const expected = expectedColor('at least one assertion'); + const received = receivedColor('received none'); isExpectingAssertionsError!.message = `${matcherHint( '.hasAssertions', '', '', - {isDirectExpectCall: true}, + { + ...matcherHintOptions, + isDirectExpectCall: true, + }, )}\n\nExpected ${expected} to be called but ${received}.`; result.push({ diff --git a/packages/expect/src/index.ts b/packages/expect/src/index.ts index 5cc2cd68f6c3..59592b79ee43 100644 --- a/packages/expect/src/index.ts +++ b/packages/expect/src/index.ts @@ -153,9 +153,15 @@ export const expect: Expect = (actual: any, ...rest: Array) => { return expectation; }; -const getMessage = (message?: () => string) => - (message && message()) || - matcherUtils.RECEIVED_COLOR('No message was specified for this matcher.'); +const getMessage = (message?: () => string) => { + const {matcherHintOptions} = getState(); + const receivedColor = + matcherHintOptions?.receivedColor ?? matcherUtils.RECEIVED_COLOR; + return ( + (message && message()) || + receivedColor('No message was specified for this matcher.') + ); +}; const makeResolveMatcher = ( @@ -166,16 +172,20 @@ const makeResolveMatcher = outerErr: JestAssertionError, ): PromiseMatcherFn => (...args) => { + const {matcherHintOptions} = getState(); const options = { + ...matcherHintOptions, isNot, promise: 'resolves', }; + const receivedColor = options.receivedColor ?? matcherUtils.RECEIVED_COLOR; + if (!isPromise(actual)) { throw new JestAssertionError( matcherUtils.matcherErrorMessage( matcherUtils.matcherHint(matcherName, undefined, '', options), - `${matcherUtils.RECEIVED_COLOR('received')} value must be a promise`, + `${receivedColor('received')} value must be a promise`, matcherUtils.printWithType( 'Received', actual, @@ -217,11 +227,15 @@ const makeRejectMatcher = outerErr: JestAssertionError, ): PromiseMatcherFn => (...args) => { + const {matcherHintOptions} = getState(); const options = { + ...matcherHintOptions, isNot, promise: 'rejects', }; + const receivedColor = options.receivedColor ?? matcherUtils.RECEIVED_COLOR; + const actualWrapper: Promise = typeof actual === 'function' ? actual() : actual; @@ -229,7 +243,7 @@ const makeRejectMatcher = throw new JestAssertionError( matcherUtils.matcherErrorMessage( matcherUtils.matcherHint(matcherName, undefined, '', options), - `${matcherUtils.RECEIVED_COLOR( + `${receivedColor( 'received', )} value must be a promise or a function returning a promise`, matcherUtils.printWithType( @@ -273,8 +287,22 @@ const makeThrowingMatcher = ( ): ThrowingMatcherFn => function throwingMatcher(...args): any { let throws = true; + const state = getState(); + const hintExpectedColor = + state.matcherHintOptions?.expectedColor ?? matcherUtils.EXPECTED_COLOR; + const hintReceivedColor = + state.matcherHintOptions?.receivedColor ?? matcherUtils.RECEIVED_COLOR; + const diffExpectedColor = + state.diffOptions?.aColor ?? matcherUtils.EXPECTED_COLOR; + const diffReceivedColor = + state.diffOptions?.bColor ?? matcherUtils.RECEIVED_COLOR; + const utils: MatcherUtils['utils'] = { ...matcherUtils, + diffExpectedColor, + diffReceivedColor, + hintExpectedColor, + hintReceivedColor, iterableEquality, subsetEquality, }; diff --git a/packages/expect/src/matchers.ts b/packages/expect/src/matchers.ts index 0ea9c04501ae..b0a5b726febd 100644 --- a/packages/expect/src/matchers.ts +++ b/packages/expect/src/matchers.ts @@ -19,12 +19,11 @@ import { subsetEquality, typeEquality, } from '@jest/expect-utils'; +import {noColor} from 'jest-diff'; import {getType, isPrimitive} from 'jest-get-type'; import { DIM_COLOR, - EXPECTED_COLOR, MatcherHintOptions, - RECEIVED_COLOR, SUGGEST_TO_CONTAIN_EQUAL, ensureExpectedIsNonNegativeInteger, ensureNoExpected, @@ -77,6 +76,7 @@ const matchers: MatchersObject = { toBe(received: unknown, expected: unknown) { const matcherName = 'toBe'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, comment: 'Object.is equality', isNot: this.isNot, promise: this.promise, @@ -89,7 +89,7 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected: not ${printExpected(expected)}` + `Expected: not ${printExpected(expected, this.diffOptions?.aColor)}` : () => { const expectedType = getType(expected); @@ -116,13 +116,15 @@ const matchers: MatchersObject = { } } + const hintMessage = `If it should pass with deep equality, replace "${matcherName}" with "${deepEqualityName}"`; + return ( // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + (deepEqualityName !== null - ? `${DIM_COLOR( - `If it should pass with deep equality, replace "${matcherName}" with "${deepEqualityName}"`, + ? `${(this.diffOptions?.noDim ? noColor : DIM_COLOR)( + hintMessage, )}\n\n` : '') + printDiffOrStringify( @@ -131,6 +133,7 @@ const matchers: MatchersObject = { EXPECTED_LABEL, RECEIVED_LABEL, isExpand(this.expand), + this.diffOptions, ) ); }; @@ -146,6 +149,7 @@ const matchers: MatchersObject = { const secondArgument = arguments.length === 3 ? 'precision' : undefined; const isNot = this.isNot; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot, promise: this.promise, secondArgument, @@ -156,7 +160,7 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${EXPECTED_COLOR('expected')} value must be a number`, + `${this.utils.hintExpectedColor('expected')} value must be a number`, printWithType('Expected', expected, printExpected), ), ); @@ -166,7 +170,7 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${RECEIVED_COLOR('received')} value must be a number`, + `${this.utils.hintReceivedColor('received')} value must be a number`, printWithType('Received', received, printReceived), ), ); @@ -191,17 +195,23 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected: not ${printExpected(expected)}\n` + + `Expected: not ${printExpected( + expected, + this.diffOptions?.aColor, + )}\n` + (receivedDiff === 0 ? '' - : `Received: ${printReceived(received)}\n` + + : `Received: ${printReceived( + received, + this.diffOptions?.bColor, + )}\n` + `\n${printCloseTo(receivedDiff, expectedDiff, precision, isNot)}`) : () => // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected: ${printExpected(expected)}\n` + - `Received: ${printReceived(received)}\n` + + `Expected: ${printExpected(expected, this.diffOptions?.aColor)}\n` + + `Received: ${printReceived(received, this.diffOptions?.bColor)}\n` + '\n' + printCloseTo(receivedDiff, expectedDiff, precision, isNot); @@ -211,6 +221,7 @@ const matchers: MatchersObject = { toBeDefined(received: unknown, expected: void) { const matcherName = 'toBeDefined'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, }; @@ -222,7 +233,7 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, '', options) + '\n\n' + - `Received: ${printReceived(received)}`; + `Received: ${printReceived(received, this.diffOptions?.bColor)}`; return {message, pass}; }, @@ -230,6 +241,7 @@ const matchers: MatchersObject = { toBeFalsy(received: unknown, expected: void) { const matcherName = 'toBeFalsy'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, }; @@ -241,7 +253,7 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, '', options) + '\n\n' + - `Received: ${printReceived(received)}`; + `Received: ${printReceived(received, this.diffOptions?.bColor)}`; return {message, pass}; }, @@ -250,6 +262,7 @@ const matchers: MatchersObject = { const matcherName = 'toBeGreaterThan'; const isNot = this.isNot; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot, promise: this.promise, }; @@ -261,8 +274,14 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected:${isNot ? ' not' : ''} > ${printExpected(expected)}\n` + - `Received:${isNot ? ' ' : ''} ${printReceived(received)}`; + `Expected:${isNot ? ' not' : ''} > ${printExpected( + expected, + this.diffOptions?.aColor, + )}\n` + + `Received:${isNot ? ' ' : ''} ${printReceived( + received, + this.diffOptions?.bColor, + )}`; return {message, pass}; }, @@ -271,6 +290,7 @@ const matchers: MatchersObject = { const matcherName = 'toBeGreaterThanOrEqual'; const isNot = this.isNot; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot, promise: this.promise, }; @@ -282,8 +302,14 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected:${isNot ? ' not' : ''} >= ${printExpected(expected)}\n` + - `Received:${isNot ? ' ' : ''} ${printReceived(received)}`; + `Expected:${isNot ? ' not' : ''} >= ${printExpected( + expected, + this.diffOptions?.aColor, + )}\n` + + `Received:${isNot ? ' ' : ''} ${printReceived( + received, + this.diffOptions?.bColor, + )}`; return {message, pass}; }, @@ -291,6 +317,7 @@ const matchers: MatchersObject = { toBeInstanceOf(received: any, expected: Function) { const matcherName = 'toBeInstanceOf'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, }; @@ -299,7 +326,9 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${EXPECTED_COLOR('expected')} value must be a function`, + `${this.utils.hintExpectedColor( + 'expected', + )} value must be a function`, printWithType('Expected', expected, printExpected), ), ); @@ -329,9 +358,13 @@ const matchers: MatchersObject = { (isPrimitive(received) || Object.getPrototypeOf(received) === null ? `\nReceived value has no prototype\nReceived value: ${printReceived( received, + this.diffOptions?.bColor, )}` : typeof received.constructor !== 'function' - ? `\nReceived value: ${printReceived(received)}` + ? `\nReceived value: ${printReceived( + received, + this.diffOptions?.bColor, + )}` : printReceivedConstructorName( 'Received constructor', received.constructor, @@ -344,6 +377,7 @@ const matchers: MatchersObject = { const matcherName = 'toBeLessThan'; const isNot = this.isNot; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot, promise: this.promise, }; @@ -355,8 +389,14 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected:${isNot ? ' not' : ''} < ${printExpected(expected)}\n` + - `Received:${isNot ? ' ' : ''} ${printReceived(received)}`; + `Expected:${isNot ? ' not' : ''} < ${printExpected( + expected, + this.diffOptions?.aColor, + )}\n` + + `Received:${isNot ? ' ' : ''} ${printReceived( + received, + this.diffOptions?.bColor, + )}`; return {message, pass}; }, @@ -365,6 +405,7 @@ const matchers: MatchersObject = { const matcherName = 'toBeLessThanOrEqual'; const isNot = this.isNot; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot, promise: this.promise, }; @@ -376,8 +417,14 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected:${isNot ? ' not' : ''} <= ${printExpected(expected)}\n` + - `Received:${isNot ? ' ' : ''} ${printReceived(received)}`; + `Expected:${isNot ? ' not' : ''} <= ${printExpected( + expected, + this.diffOptions?.aColor, + )}\n` + + `Received:${isNot ? ' ' : ''} ${printReceived( + received, + this.diffOptions?.bColor, + )}`; return {message, pass}; }, @@ -385,6 +432,7 @@ const matchers: MatchersObject = { toBeNaN(received: any, expected: void) { const matcherName = 'toBeNaN'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, }; @@ -396,7 +444,7 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, '', options) + '\n\n' + - `Received: ${printReceived(received)}`; + `Received: ${printReceived(received, this.diffOptions?.bColor)}`; return {message, pass}; }, @@ -404,6 +452,7 @@ const matchers: MatchersObject = { toBeNull(received: unknown, expected: void) { const matcherName = 'toBeNull'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, }; @@ -415,7 +464,7 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, '', options) + '\n\n' + - `Received: ${printReceived(received)}`; + `Received: ${printReceived(received, this.diffOptions?.bColor)}`; return {message, pass}; }, @@ -423,6 +472,7 @@ const matchers: MatchersObject = { toBeTruthy(received: unknown, expected: void) { const matcherName = 'toBeTruthy'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, }; @@ -434,7 +484,7 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, '', options) + '\n\n' + - `Received: ${printReceived(received)}`; + `Received: ${printReceived(received, this.diffOptions?.bColor)}`; return {message, pass}; }, @@ -442,6 +492,7 @@ const matchers: MatchersObject = { toBeUndefined(received: unknown, expected: void) { const matcherName = 'toBeUndefined'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, }; @@ -453,7 +504,7 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, '', options) + '\n\n' + - `Received: ${printReceived(received)}`; + `Received: ${printReceived(received, this.diffOptions?.bColor)}`; return {message, pass}; }, @@ -462,6 +513,7 @@ const matchers: MatchersObject = { const matcherName = 'toContain'; const isNot = this.isNot; const options: MatcherHintOptions = { + ...this.matcherHintOptions, comment: 'indexOf', isNot, promise: this.promise, @@ -471,16 +523,18 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${RECEIVED_COLOR('received')} value must not be null nor undefined`, + `${this.utils.hintReceivedColor( + 'received', + )} value must not be null nor undefined`, printWithType('Received', received, printReceived), ), ); } if (typeof received === 'string') { - const wrongTypeErrorMessage = `${EXPECTED_COLOR( + const wrongTypeErrorMessage = `${this.utils.hintExpectedColor( 'expected', - )} value must be a string if ${RECEIVED_COLOR( + )} value must be a string if ${this.utils.hintReceivedColor( 'received', )} value is a string`; @@ -513,6 +567,7 @@ const matchers: MatchersObject = { '\n\n' + `${printLabel(labelExpected)}${isNot ? 'not ' : ''}${printExpected( expected, + this.diffOptions?.aColor, )}\n` + `${printLabel(labelReceived)}${isNot ? ' ' : ''}${ isNot @@ -521,7 +576,7 @@ const matchers: MatchersObject = { index, String(expected).length, ) - : printReceived(received) + : printReceived(received, this.diffOptions?.bColor) }` ); }; @@ -544,11 +599,12 @@ const matchers: MatchersObject = { '\n\n' + `${printLabel(labelExpected)}${isNot ? 'not ' : ''}${printExpected( expected, + this.diffOptions?.aColor, )}\n` + `${printLabel(labelReceived)}${isNot ? ' ' : ''}${ isNot && Array.isArray(received) ? printReceivedArrayContainExpectedItem(received, index) - : printReceived(received) + : printReceived(received, this.diffOptions?.bColor) }` + (!isNot && indexable.findIndex(item => @@ -566,6 +622,7 @@ const matchers: MatchersObject = { const matcherName = 'toContainEqual'; const isNot = this.isNot; const options: MatcherHintOptions = { + ...this.matcherHintOptions, comment: 'deep equality', isNot, promise: this.promise, @@ -575,7 +632,9 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${RECEIVED_COLOR('received')} value must not be null nor undefined`, + `${this.utils.hintReceivedColor( + 'received', + )} value must not be null nor undefined`, printWithType('Received', received, printReceived), ), ); @@ -597,11 +656,12 @@ const matchers: MatchersObject = { '\n\n' + `${printLabel(labelExpected)}${isNot ? 'not ' : ''}${printExpected( expected, + this.diffOptions?.aColor, )}\n` + `${printLabel(labelReceived)}${isNot ? ' ' : ''}${ isNot && Array.isArray(received) ? printReceivedArrayContainExpectedItem(received, index) - : printReceived(received) + : printReceived(received, this.diffOptions?.bColor) }` ); }; @@ -612,6 +672,7 @@ const matchers: MatchersObject = { toEqual(received: unknown, expected: unknown) { const matcherName = 'toEqual'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, comment: 'deep equality', isNot: this.isNot, promise: this.promise, @@ -627,9 +688,15 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected: not ${printExpected(expected)}\n` + + `Expected: not ${printExpected( + expected, + this.diffOptions?.aColor, + )}\n` + (stringify(expected) !== stringify(received) - ? `Received: ${printReceived(received)}` + ? `Received: ${printReceived( + received, + this.diffOptions?.bColor, + )}` : '') : () => // eslint-disable-next-line prefer-template @@ -641,6 +708,7 @@ const matchers: MatchersObject = { EXPECTED_LABEL, RECEIVED_LABEL, isExpand(this.expand), + this.diffOptions, ); // Passing the actual and expected objects so that a custom reporter @@ -653,6 +721,7 @@ const matchers: MatchersObject = { const matcherName = 'toHaveLength'; const isNot = this.isNot; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot, promise: this.promise, }; @@ -661,7 +730,7 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${RECEIVED_COLOR( + `${this.utils.hintReceivedColor( 'received', )} value must have a length property whose value must be a number`, printWithType('Received', received, printReceived), @@ -689,14 +758,17 @@ const matchers: MatchersObject = { '\n\n' + `${printLabel(labelExpected)}${isNot ? 'not ' : ''}${printExpected( expected, + this.diffOptions?.aColor, )}\n` + (isNot ? '' : `${printLabel(labelReceivedLength)}${printReceived( received.length, + this.diffOptions?.bColor, )}\n`) + `${printLabel(labelReceivedValue)}${isNot ? ' ' : ''}${printReceived( received, + this.diffOptions?.bColor, )}` ); }; @@ -713,6 +785,7 @@ const matchers: MatchersObject = { const expectedArgument = 'path'; const hasValue = arguments.length === 3; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, secondArgument: hasValue ? 'value' : '', @@ -722,7 +795,9 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, expectedArgument, options), - `${RECEIVED_COLOR('received')} value must not be null nor undefined`, + `${this.utils.hintReceivedColor( + 'received', + )} value must not be null nor undefined`, printWithType('Received', received, printReceived), ), ); @@ -734,7 +809,9 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, expectedArgument, options), - `${EXPECTED_COLOR('expected')} path must be a string or array`, + `${this.utils.hintExpectedColor( + 'expected', + )} path must be a string or array`, printWithType('Expected', expectedPath, printExpected), ), ); @@ -749,7 +826,9 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, expectedArgument, options), - `${EXPECTED_COLOR('expected')} path must not be an empty array`, + `${this.utils.hintExpectedColor( + 'expected', + )} path must not be an empty array`, printWithType('Expected', expectedPath, printExpected), ), ); @@ -775,14 +854,29 @@ const matchers: MatchersObject = { matcherHint(matcherName, undefined, expectedArgument, options) + '\n\n' + (hasValue - ? `Expected path: ${printExpected(expectedPath)}\n\n` + - `Expected value: not ${printExpected(expectedValue)}${ + ? `Expected path: ${printExpected( + expectedPath, + this.diffOptions?.aColor, + )}\n\n` + + `Expected value: not ${printExpected( + expectedValue, + this.diffOptions?.aColor, + )}${ stringify(expectedValue) !== stringify(receivedValue) - ? `\nReceived value: ${printReceived(receivedValue)}` + ? `\nReceived value: ${printReceived( + receivedValue, + this.diffOptions?.bColor, + )}` : '' }` - : `Expected path: not ${printExpected(expectedPath)}\n\n` + - `Received value: ${printReceived(receivedValue)}`) + : `Expected path: not ${printExpected( + expectedPath, + this.diffOptions?.aColor, + )}\n\n` + + `Received value: ${printReceived( + receivedValue, + this.diffOptions?.bColor, + )}`) : () => // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, expectedArgument, options) + @@ -795,16 +889,24 @@ const matchers: MatchersObject = { EXPECTED_VALUE_LABEL, RECEIVED_VALUE_LABEL, isExpand(this.expand), + this.diffOptions, )}` : `Received path: ${printReceived( expectedPathType === 'array' || receivedPath.length === 0 ? receivedPath : receivedPath.join('.'), + this.diffOptions?.bColor, )}\n\n${ hasValue - ? `Expected value: ${printExpected(expectedValue)}\n` + ? `Expected value: ${printExpected( + expectedValue, + this.diffOptions?.aColor, + )}\n` : '' - }Received value: ${printReceived(receivedValue)}`); + }Received value: ${printReceived( + receivedValue, + this.diffOptions?.bColor, + )}`); return {message, pass}; }, @@ -812,6 +914,7 @@ const matchers: MatchersObject = { toMatch(received: string, expected: string | RegExp) { const matcherName = 'toMatch'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, }; @@ -820,7 +923,7 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${RECEIVED_COLOR('received')} value must be a string`, + `${this.utils.hintReceivedColor('received')} value must be a string`, printWithType('Received', received, printReceived), ), ); @@ -833,7 +936,7 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${EXPECTED_COLOR( + `${this.utils.hintExpectedColor( 'expected', )} value must be a string or regular expression`, printWithType('Expected', expected, printExpected), @@ -852,7 +955,10 @@ const matchers: MatchersObject = { ? // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected substring: not ${printExpected(expected)}\n` + + `Expected substring: not ${printExpected( + expected, + this.diffOptions?.aColor, + )}\n` + `Received string: ${printReceivedStringContainExpectedSubstring( received, received.indexOf(expected), @@ -861,7 +967,10 @@ const matchers: MatchersObject = { : // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected pattern: not ${printExpected(expected)}\n` + + `Expected pattern: not ${printExpected( + expected, + this.diffOptions?.aColor, + )}\n` + `Received string: ${printReceivedStringContainExpectedResult( received, typeof expected.exec === 'function' @@ -879,8 +988,14 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `${printLabel(labelExpected)}${printExpected(expected)}\n` + - `${printLabel(labelReceived)}${printReceived(received)}` + `${printLabel(labelExpected)}${printExpected( + expected, + this.diffOptions?.aColor, + )}\n` + + `${printLabel(labelReceived)}${printReceived( + received, + this.diffOptions?.bColor, + )}` ); }; @@ -890,6 +1005,7 @@ const matchers: MatchersObject = { toMatchObject(received: object, expected: object) { const matcherName = 'toMatchObject'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, }; @@ -898,7 +1014,9 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${RECEIVED_COLOR('received')} value must be a non-null object`, + `${this.utils.hintReceivedColor( + 'received', + )} value must be a non-null object`, printWithType('Received', received, printReceived), ), ); @@ -908,7 +1026,9 @@ const matchers: MatchersObject = { throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${EXPECTED_COLOR('expected')} value must be a non-null object`, + `${this.utils.hintExpectedColor( + 'expected', + )} value must be a non-null object`, printWithType('Expected', expected, printExpected), ), ); @@ -925,9 +1045,12 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected: not ${printExpected(expected)}` + + `Expected: not ${printExpected(expected, this.diffOptions?.aColor)}` + (stringify(expected) !== stringify(received) - ? `\nReceived: ${printReceived(received)}` + ? `\nReceived: ${printReceived( + received, + this.diffOptions?.bColor, + )}` : '') : () => // eslint-disable-next-line prefer-template @@ -939,6 +1062,7 @@ const matchers: MatchersObject = { EXPECTED_LABEL, RECEIVED_LABEL, isExpand(this.expand), + this.diffOptions, ); return {message, pass}; @@ -947,6 +1071,7 @@ const matchers: MatchersObject = { toStrictEqual(received: unknown, expected: unknown) { const matcherName = 'toStrictEqual'; const options: MatcherHintOptions = { + ...this.matcherHintOptions, comment: 'deep equality', isNot: this.isNot, promise: this.promise, @@ -964,9 +1089,15 @@ const matchers: MatchersObject = { // eslint-disable-next-line prefer-template matcherHint(matcherName, undefined, undefined, options) + '\n\n' + - `Expected: not ${printExpected(expected)}\n` + + `Expected: not ${printExpected( + expected, + this.diffOptions?.aColor, + )}\n` + (stringify(expected) !== stringify(received) - ? `Received: ${printReceived(received)}` + ? `Received: ${printReceived( + received, + this.diffOptions?.bColor, + )}` : '') : () => // eslint-disable-next-line prefer-template @@ -978,6 +1109,7 @@ const matchers: MatchersObject = { EXPECTED_LABEL, RECEIVED_LABEL, isExpand(this.expand), + this.diffOptions, ); // Passing the actual and expected objects so that a custom reporter diff --git a/packages/expect/src/print.ts b/packages/expect/src/print.ts index 167ef57ca25e..773c2c827467 100644 --- a/packages/expect/src/print.ts +++ b/packages/expect/src/print.ts @@ -15,6 +15,7 @@ import { printReceived, stringify, } from 'jest-matcher-utils'; +import {getState} from './jestMatchersObject'; // Format substring but do not enclose in double quote marks. // The replacement is compatible with pretty-format package. @@ -24,12 +25,18 @@ export const printReceivedStringContainExpectedSubstring = ( received: string, start: number, length: number, // not end -): string => - RECEIVED_COLOR( - `"${printSubstring(received.slice(0, start))}${INVERTED_COLOR( +): string => { + const {diffOptions} = getState(); + + const receivedColor = diffOptions?.bColor ?? RECEIVED_COLOR; + const invertedColor = diffOptions?.changeColor ?? INVERTED_COLOR; + + return receivedColor( + `"${printSubstring(received.slice(0, start))}${invertedColor( printSubstring(received.slice(start, start + length)), )}${printSubstring(received.slice(start + length))}"`, ); +}; export const printReceivedStringContainExpectedResult = ( received: string, @@ -49,15 +56,21 @@ export const printReceivedStringContainExpectedResult = ( export const printReceivedArrayContainExpectedItem = ( received: Array, index: number, -): string => - RECEIVED_COLOR( +): string => { + const {diffOptions} = getState(); + + const receivedColor = diffOptions?.bColor ?? RECEIVED_COLOR; + const invertedColor = diffOptions?.changeColor ?? INVERTED_COLOR; + + return receivedColor( `[${received .map((item, i) => { const stringified = stringify(item); - return i === index ? INVERTED_COLOR(stringified) : stringified; + return i === index ? invertedColor(stringified) : stringified; }) .join(', ')}]`, ); +}; export const printCloseTo = ( receivedDiff: number, @@ -76,12 +89,17 @@ export const printCloseTo = ( expectedDiff.toFixed(precision + 1) : stringify(expectedDiff); + const {diffOptions} = getState(); + + const expectedColor = diffOptions?.aColor ?? EXPECTED_COLOR; + const receivedColor = diffOptions?.bColor ?? RECEIVED_COLOR; + return ( `Expected precision: ${isNot ? ' ' : ''} ${stringify(precision)}\n` + - `Expected difference: ${isNot ? 'not ' : ''}< ${EXPECTED_COLOR( + `Expected difference: ${isNot ? 'not ' : ''}< ${expectedColor( expectedDiffString, )}\n` + - `Received difference: ${isNot ? ' ' : ''} ${RECEIVED_COLOR( + `Received difference: ${isNot ? ' ' : ''} ${receivedColor( receivedDiffString, )}` ); @@ -107,30 +125,39 @@ export const printReceivedConstructorNameNot = ( label: string, received: Function, expected: Function, -): string => - typeof expected.name === 'string' && - expected.name.length !== 0 && - typeof received.name === 'string' && - received.name.length !== 0 +): string => { + const {diffOptions} = getState(); + const expectedColor = diffOptions?.aColor ?? EXPECTED_COLOR; + + return typeof expected.name === 'string' && + expected.name.length !== 0 && + typeof received.name === 'string' && + received.name.length !== 0 ? `${printConstructorName(label, received, true, false)} ${ Object.getPrototypeOf(received) === expected ? 'extends' : 'extends … extends' - } ${EXPECTED_COLOR(expected.name)}\n` + } ${expectedColor(expected.name)}\n` : `${printConstructorName(label, received, false, false)}\n`; +}; const printConstructorName = ( label: string, constructor: Function, isNot: boolean, isExpected: boolean, -): string => - typeof constructor.name !== 'string' +): string => { + const {diffOptions} = getState(); + const expectedColor = diffOptions?.aColor ?? EXPECTED_COLOR; + const receivedColor = diffOptions?.bColor ?? RECEIVED_COLOR; + + return typeof constructor.name !== 'string' ? `${label} name is not a string` : constructor.name.length === 0 ? `${label} name is an empty string` : `${label}: ${!isNot ? '' : isExpected ? 'not ' : ' '}${ isExpected - ? EXPECTED_COLOR(constructor.name) - : RECEIVED_COLOR(constructor.name) + ? expectedColor(constructor.name) + : receivedColor(constructor.name) }`; +}; diff --git a/packages/expect/src/toThrowMatchers.ts b/packages/expect/src/toThrowMatchers.ts index 77eff9008e8b..fad61c1f2b60 100644 --- a/packages/expect/src/toThrowMatchers.ts +++ b/packages/expect/src/toThrowMatchers.ts @@ -10,9 +10,7 @@ import {isError} from '@jest/expect-utils'; import { - EXPECTED_COLOR, MatcherHintOptions, - RECEIVED_COLOR, matcherErrorMessage, matcherHint, printDiffOrStringify, @@ -79,6 +77,7 @@ export const createMatcher = ( ): MatcherFunction<[any]> => function (received, expected): ExpectationResult { const options = { + ...this.matcherHintOptions, isNot: this.isNot, promise: this.promise, }; @@ -94,7 +93,9 @@ export const createMatcher = ( throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, placeholder, options), - `${RECEIVED_COLOR('received')} value must be a function`, + `${this.utils.hintReceivedColor( + 'received', + )} value must be a function`, printWithType('Received', received, printReceived), ), ); @@ -127,7 +128,7 @@ export const createMatcher = ( throw new Error( matcherErrorMessage( matcherHint(matcherName, undefined, undefined, options), - `${EXPECTED_COLOR( + `${this.utils.hintExpectedColor( 'expected', )} value must be a string or regular expression or class or error`, printWithType('Expected', expected, printExpected), diff --git a/packages/expect/src/types.ts b/packages/expect/src/types.ts index e946ebd11e62..68ef3b455297 100644 --- a/packages/expect/src/types.ts +++ b/packages/expect/src/types.ts @@ -7,7 +7,9 @@ */ import type {EqualsFunction, Tester} from '@jest/expect-utils'; +import type {DiffOptions, DiffOptionsColor} from 'jest-diff'; import type * as jestMatcherUtils from 'jest-matcher-utils'; +import type {MatcherHintColor, MatcherHintOptions} from 'jest-matcher-utils'; import {INTERNAL_MATCHER_FLAG} from './jestMatchersObject'; export type SyncExpectationResult = { @@ -52,6 +54,10 @@ export interface MatcherUtils { utils: typeof jestMatcherUtils & { iterableEquality: Tester; subsetEquality: Tester; + hintExpectedColor: MatcherHintColor; + hintReceivedColor: MatcherHintColor; + diffExpectedColor: DiffOptionsColor; + diffReceivedColor: DiffOptionsColor; }; } @@ -59,6 +65,7 @@ export interface MatcherState { assertionCalls: number; currentConcurrentTestName?: () => string | undefined; currentTestName?: string; + diffOptions?: DiffOptions; error?: Error; expand?: boolean; expectedAssertionsNumber: number | null; @@ -66,6 +73,7 @@ export interface MatcherState { isExpectingAssertions: boolean; isExpectingAssertionsError?: Error; isNot?: boolean; + matcherHintOptions?: MatcherHintOptions; numPassingAsserts: number; promise?: string; suppressedErrors: Array; diff --git a/packages/expect/tsconfig.json b/packages/expect/tsconfig.json index 6e4edc6dc4da..c7b343e1185e 100644 --- a/packages/expect/tsconfig.json +++ b/packages/expect/tsconfig.json @@ -9,6 +9,7 @@ "exclude": ["./**/__tests__/**/*"], "references": [ {"path": "../expect-utils"}, + {"path": "../jest-diff"}, {"path": "../jest-get-type"}, {"path": "../jest-matcher-utils"}, {"path": "../jest-message-util"}, diff --git a/packages/jest-diff/README.md b/packages/jest-diff/README.md index d52f821789a3..7eb3fbfcea0a 100644 --- a/packages/jest-diff/README.md +++ b/packages/jest-diff/README.md @@ -391,7 +391,7 @@ For other applications, you can provide an options object as a third argument: | `bIndicator` | `'+'` | | `changeColor` | `chalk.inverse` | | `changeLineTrailingSpaceColor` | `string => string` | -| `commonColor` | `chalk.dim` | +| `noDim` | `false` | | `commonIndicator` | `' '` | | `commonLineTrailingSpaceColor` | `string => string` | | `compareKeys` | `undefined` | @@ -496,7 +496,7 @@ const options = { aColor: noColor, bColor: noColor, changeColor: noColor, - commonColor: noColor, + noDim: noColor, patchColor: noColor, }; ``` 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 de7b8533207f..05d11dbbae77 100644 --- a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.ts.snap +++ b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.ts.snap @@ -249,10 +249,10 @@ exports[`options change color diffStringsUnified 1`] = ` - changed from + changed to + insert - common + common `; -exports[`options change color no diff 1`] = `Compared values have no visual difference.`; +exports[`options change color no diff 1`] = `Compared values have no visual difference.`; exports[`options change indicators diff 1`] = ` < Expected diff --git a/packages/jest-diff/src/__tests__/diff.test.ts b/packages/jest-diff/src/__tests__/diff.test.ts index 0493190626c0..15753b03b2d9 100644 --- a/packages/jest-diff/src/__tests__/diff.test.ts +++ b/packages/jest-diff/src/__tests__/diff.test.ts @@ -26,7 +26,7 @@ const stripped = (a: unknown, b: unknown) => stripAnsi(diff(a, b) ?? ''); const optionsBe: DiffOptions = { aColor: noColor, bColor: noColor, - commonColor: noColor, + noDim: true, omitAnnotationLines: true, }; const unexpandedBe: DiffOptions = { @@ -973,7 +973,7 @@ describe('options', () => { describe('change color', () => { const options = { changeColor: chalk.bold, - commonColor: chalk.yellow, + noDim: true, }; test('diffStringsUnified', () => { @@ -989,8 +989,8 @@ describe('options', () => { describe('common', () => { const options = { - commonColor: noColor, commonIndicator: '=', + noDim: true, }; test('diff', () => { diff --git a/packages/jest-diff/src/__tests__/getAlignedDiffs.test.ts b/packages/jest-diff/src/__tests__/getAlignedDiffs.test.ts index 8e12b1fb8110..483858a2abef 100644 --- a/packages/jest-diff/src/__tests__/getAlignedDiffs.test.ts +++ b/packages/jest-diff/src/__tests__/getAlignedDiffs.test.ts @@ -16,7 +16,7 @@ const options = { aColor: identity, bColor: identity, changeColor, - commonColor: identity, + noDim: true, omitAnnotationLines: true, patchColor: identity, }; diff --git a/packages/jest-diff/src/__tests__/joinAlignedDiffs.test.ts b/packages/jest-diff/src/__tests__/joinAlignedDiffs.test.ts index c435c2f2e161..a634dd9d3b33 100644 --- a/packages/jest-diff/src/__tests__/joinAlignedDiffs.test.ts +++ b/packages/jest-diff/src/__tests__/joinAlignedDiffs.test.ts @@ -20,8 +20,8 @@ const optionsNoColor = { aColor: noColor, bColor: noColor, changeColor, - commonColor: noColor, emptyFirstOrLastLinePlaceholder: '↵', // U+21B5 + noDim: true, patchColor: noColor, }; diff --git a/packages/jest-diff/src/index.ts b/packages/jest-diff/src/index.ts index 09cf306815c2..6e8c425eabf4 100644 --- a/packages/jest-diff/src/index.ts +++ b/packages/jest-diff/src/index.ts @@ -15,7 +15,7 @@ import { import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff} from './cleanupSemantic'; import {NO_DIFF_MESSAGE, SIMILAR_MESSAGE} from './constants'; import {diffLinesRaw, diffLinesUnified, diffLinesUnified2} from './diffLines'; -import {normalizeDiffOptions} from './normalizeDiffOptions'; +import {DIM_COLOR, noColor, normalizeDiffOptions} from './normalizeDiffOptions'; import {diffStringsRaw, diffStringsUnified} from './printDiffs'; import type {DiffOptions} from './types'; @@ -24,10 +24,11 @@ export type {DiffOptions, DiffOptionsColor} from './types'; export {diffLinesRaw, diffLinesUnified, diffLinesUnified2}; export {diffStringsRaw, diffStringsUnified}; export {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff}; +export {noColor}; const getCommonMessage = (message: string, options?: DiffOptions) => { - const {commonColor} = normalizeDiffOptions(options); - return commonColor(message); + const {noDim} = normalizeDiffOptions(options); + return (noDim ? noColor : DIM_COLOR)(message); }; const { diff --git a/packages/jest-diff/src/joinAlignedDiffs.ts b/packages/jest-diff/src/joinAlignedDiffs.ts index 0568033c7f5b..1db0e70642dd 100644 --- a/packages/jest-diff/src/joinAlignedDiffs.ts +++ b/packages/jest-diff/src/joinAlignedDiffs.ts @@ -6,6 +6,7 @@ */ import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff} from './cleanupSemantic'; +import {DIM_COLOR, noColor} from './normalizeDiffOptions'; import type {DiffOptionsColor, DiffOptionsNormalized} from './types'; const formatTrailingSpaces = ( @@ -73,7 +74,7 @@ const printCommonLine = ( line: string, isFirstOrLast: boolean, { - commonColor, + noDim, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder, @@ -82,7 +83,7 @@ const printCommonLine = ( printDiffLine( line, isFirstOrLast, - commonColor, + noDim ? noColor : DIM_COLOR, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder, diff --git a/packages/jest-diff/src/normalizeDiffOptions.ts b/packages/jest-diff/src/normalizeDiffOptions.ts index 3072bea01597..8ecfb9bc4139 100644 --- a/packages/jest-diff/src/normalizeDiffOptions.ts +++ b/packages/jest-diff/src/normalizeDiffOptions.ts @@ -10,6 +10,7 @@ import type {CompareKeys} from 'pretty-format'; import type {DiffOptions, DiffOptionsNormalized} from './types'; export const noColor = (string: string): string => string; +export const DIM_COLOR = chalk.dim; const DIFF_CONTEXT_DEFAULT = 5; @@ -22,7 +23,6 @@ const OPTIONS_DEFAULT: DiffOptionsNormalized = { bIndicator: '+', changeColor: chalk.inverse, changeLineTrailingSpaceColor: noColor, - commonColor: chalk.dim, commonIndicator: ' ', commonLineTrailingSpaceColor: noColor, compareKeys: undefined, @@ -30,6 +30,7 @@ const OPTIONS_DEFAULT: DiffOptionsNormalized = { emptyFirstOrLastLinePlaceholder: '', expand: true, includeChangeCounts: false, + noDim: false, omitAnnotationLines: false, patchColor: chalk.yellow, }; diff --git a/packages/jest-diff/src/types.ts b/packages/jest-diff/src/types.ts index 8e09ca357ca6..3bb680a1d3c8 100644 --- a/packages/jest-diff/src/types.ts +++ b/packages/jest-diff/src/types.ts @@ -17,13 +17,13 @@ export type DiffOptions = { bIndicator?: string; changeColor?: DiffOptionsColor; changeLineTrailingSpaceColor?: DiffOptionsColor; - commonColor?: DiffOptionsColor; commonIndicator?: string; commonLineTrailingSpaceColor?: DiffOptionsColor; contextLines?: number; emptyFirstOrLastLinePlaceholder?: string; expand?: boolean; includeChangeCounts?: boolean; + noDim?: boolean; omitAnnotationLines?: boolean; patchColor?: DiffOptionsColor; compareKeys?: CompareKeys; @@ -38,7 +38,6 @@ export type DiffOptionsNormalized = { bIndicator: string; changeColor: DiffOptionsColor; changeLineTrailingSpaceColor: DiffOptionsColor; - commonColor: DiffOptionsColor; commonIndicator: string; commonLineTrailingSpaceColor: DiffOptionsColor; compareKeys: CompareKeys; @@ -46,6 +45,7 @@ export type DiffOptionsNormalized = { emptyFirstOrLastLinePlaceholder: string; expand: boolean; includeChangeCounts: boolean; + noDim: boolean; omitAnnotationLines: boolean; patchColor: DiffOptionsColor; }; diff --git a/packages/jest-matcher-utils/src/index.ts b/packages/jest-matcher-utils/src/index.ts index e910f7a99039..27e8ec5f4142 100644 --- a/packages/jest-matcher-utils/src/index.ts +++ b/packages/jest-matcher-utils/src/index.ts @@ -13,10 +13,12 @@ import { DIFF_EQUAL, DIFF_INSERT, Diff, + DiffOptionsColor, DiffOptions as ImportDiffOptions, diff as diffDefault, diffStringsRaw, diffStringsUnified, + noColor, } from 'jest-diff'; import {getType, isPrimitive} from 'jest-get-type'; import { @@ -44,13 +46,15 @@ const PLUGINS = [ AsymmetricMatcher, ]; -type MatcherHintColor = (arg: string) => string; // subset of Chalk type +export type MatcherHintColor = (arg: string) => string; // subset of Chalk type export type MatcherHintOptions = { comment?: string; expectedColor?: MatcherHintColor; + inverseColor?: MatcherHintColor; isDirectExpectCall?: boolean; isNot?: boolean; + noDim?: boolean; promise?: string; receivedColor?: MatcherHintColor; secondArgument?: string; @@ -131,10 +135,15 @@ export const highlightTrailingWhitespace = (text: string): string => const replaceTrailingSpaces = (text: string): string => text.replace(/\s+$/gm, spaces => SPACE_SYMBOL.repeat(spaces.length)); -export const printReceived = (object: unknown): string => - RECEIVED_COLOR(replaceTrailingSpaces(stringify(object))); -export const printExpected = (value: unknown): string => - EXPECTED_COLOR(replaceTrailingSpaces(stringify(value))); +export const printReceived = ( + object: unknown, + color: DiffOptionsColor = RECEIVED_COLOR, +): string => color(replaceTrailingSpaces(stringify(object))); + +export const printExpected = ( + value: unknown, + color: DiffOptionsColor = EXPECTED_COLOR, +): string => color(replaceTrailingSpaces(stringify(value))); export function printWithType( name: string, @@ -178,13 +187,15 @@ export const ensureActualIsNumber = ( matcherName: string, options?: MatcherHintOptions, ): void => { + const receivedColor = options?.receivedColor ?? RECEIVED_COLOR; + if (typeof actual !== 'number' && typeof actual !== 'bigint') { // Prepend maybe not only for backward compatibility. const matcherString = (options ? '' : '[.not]') + matcherName; throw new Error( matcherErrorMessage( matcherHint(matcherString, undefined, undefined, options), - `${RECEIVED_COLOR('received')} value must be a number or bigint`, + `${receivedColor('received')} value must be a number or bigint`, printWithType('Received', actual, printReceived), ), ); @@ -199,13 +210,15 @@ export const ensureExpectedIsNumber = ( matcherName: string, options?: MatcherHintOptions, ): void => { + const hintExpectedColor = options?.receivedColor ?? EXPECTED_COLOR; + if (typeof expected !== 'number' && typeof expected !== 'bigint') { // Prepend maybe not only for backward compatibility. const matcherString = (options ? '' : '[.not]') + matcherName; throw new Error( matcherErrorMessage( matcherHint(matcherString, undefined, undefined, options), - `${EXPECTED_COLOR('expected')} value must be a number or bigint`, + `${hintExpectedColor('expected')} value must be a number or bigint`, printWithType('Expected', expected, printExpected), ), ); @@ -230,6 +243,8 @@ export const ensureExpectedIsNonNegativeInteger = ( matcherName: string, options?: MatcherHintOptions, ): void => { + const hintExpectedColor = options?.receivedColor ?? EXPECTED_COLOR; + if ( typeof expected !== 'number' || !Number.isSafeInteger(expected) || @@ -240,7 +255,7 @@ export const ensureExpectedIsNonNegativeInteger = ( throw new Error( matcherErrorMessage( matcherHint(matcherString, undefined, undefined, options), - `${EXPECTED_COLOR('expected')} value must be a non-negative integer`, + `${hintExpectedColor('expected')} value must be a non-negative integer`, printWithType('Expected', expected, printExpected), ), ); @@ -256,6 +271,7 @@ const getCommonAndChangedSubstrings = ( diffs: Array, op: number, hasCommonDiff: boolean, + invertedColor: DiffOptionsColor = INVERTED_COLOR, ): string => diffs.reduce( (reduced: string, diff: Diff): string => @@ -265,7 +281,7 @@ const getCommonAndChangedSubstrings = ( : diff[0] !== op ? '' : hasCommonDiff - ? INVERTED_COLOR(diff[1]) + ? invertedColor(diff[1]) : diff[1]), '', ); @@ -321,6 +337,7 @@ export const printDiffOrStringify = ( expectedLabel: string, receivedLabel: string, expand: boolean, // CLI options: true if `--expand` or false if `--no-expand` + diffOptions?: DiffOptions, ): string => { if ( typeof expected === 'string' && @@ -333,6 +350,7 @@ export const printDiffOrStringify = ( ) { if (expected.includes('\n') || received.includes('\n')) { return diffStringsUnified(expected, received, { + ...diffOptions, aAnnotation: expectedLabel, bAnnotation: receivedLabel, changeLineTrailingSpaceColor: chalk.bgYellow, @@ -350,12 +368,24 @@ export const printDiffOrStringify = ( const expectedLine = printLabel(expectedLabel) + printExpected( - getCommonAndChangedSubstrings(diffs, DIFF_DELETE, hasCommonDiff), + getCommonAndChangedSubstrings( + diffs, + DIFF_DELETE, + hasCommonDiff, + diffOptions?.changeColor, + ), + diffOptions?.aColor, ); const receivedLine = printLabel(receivedLabel) + printReceived( - getCommonAndChangedSubstrings(diffs, DIFF_INSERT, hasCommonDiff), + getCommonAndChangedSubstrings( + diffs, + DIFF_INSERT, + hasCommonDiff, + diffOptions?.changeColor, + ), + diffOptions?.bColor, ); return `${expectedLine}\n${receivedLine}`; @@ -365,6 +395,7 @@ export const printDiffOrStringify = ( const {replacedExpected, replacedReceived} = replaceMatchedToAsymmetricMatcher(expected, received, [], []); const difference = diffDefault(replacedExpected, replacedReceived, { + ...diffOptions, aAnnotation: expectedLabel, bAnnotation: receivedLabel, expand, @@ -381,12 +412,13 @@ export const printDiffOrStringify = ( } const printLabel = getLabelPrinter(expectedLabel, receivedLabel); - const expectedLine = printLabel(expectedLabel) + printExpected(expected); + const expectedLine = + printLabel(expectedLabel) + printExpected(expected, diffOptions?.aColor); const receivedLine = printLabel(receivedLabel) + (stringify(expected) === stringify(received) ? 'serializes to the same string' - : printReceived(received)); + : printReceived(received, diffOptions?.bColor)); return `${expectedLine}\n${receivedLine}`; }; @@ -526,29 +558,31 @@ export const matcherHint = ( ): string => { const { comment = '', - expectedColor = EXPECTED_COLOR, + expectedColor = options.expectedColor ?? EXPECTED_COLOR, isDirectExpectCall = false, // seems redundant with received === '' isNot = false, promise = '', - receivedColor = RECEIVED_COLOR, + receivedColor = options.receivedColor ?? RECEIVED_COLOR, secondArgument = '', - secondArgumentColor = EXPECTED_COLOR, + secondArgumentColor = options.secondArgumentColor ?? EXPECTED_COLOR, + noDim = options.noDim ?? false, } = options; let hint = ''; let dimString = 'expect'; // concatenate adjacent dim substrings + const dimStyle = noDim ? noColor : DIM_COLOR; if (!isDirectExpectCall && received !== '') { - hint += DIM_COLOR(`${dimString}(`) + receivedColor(received); + hint += dimStyle(`${dimString}(`) + receivedColor(received); dimString = ')'; } if (promise !== '') { - hint += DIM_COLOR(`${dimString}.`) + promise; + hint += dimStyle(`${dimString}.`) + promise; dimString = ''; } if (isNot) { - hint += `${DIM_COLOR(`${dimString}.`)}not`; + hint += `${dimStyle(`${dimString}.`)}not`; dimString = ''; } @@ -558,16 +592,16 @@ export const matcherHint = ( dimString += matcherName; } else { // New format: omit period from matcherName arg - hint += DIM_COLOR(`${dimString}.`) + matcherName; + hint += dimStyle(`${dimString}.`) + matcherName; dimString = ''; } if (expected === '') { dimString += '()'; } else { - hint += DIM_COLOR(`${dimString}(`) + expectedColor(expected); + hint += dimStyle(`${dimString}(`) + expectedColor(expected); if (secondArgument) { - hint += DIM_COLOR(', ') + secondArgumentColor(secondArgument); + hint += dimStyle(', ') + secondArgumentColor(secondArgument); } dimString = ')'; } @@ -577,7 +611,7 @@ export const matcherHint = ( } if (dimString !== '') { - hint += DIM_COLOR(dimString); + hint += dimStyle(dimString); } return hint; diff --git a/yarn.lock b/yarn.lock index e7445ca9f96a..60228e3f66bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2971,6 +2971,7 @@ __metadata: istanbul-reports: ^3.1.3 jest: "workspace:^" jest-changed-files: "workspace:^" + jest-diff: "workspace:^" jest-junit: ^16.0.0 jest-mock: "workspace:^" jest-runner-tsd: ^5.0.0 @@ -9868,6 +9869,7 @@ __metadata: "@tsd/typescript": ^5.0.4 chalk: ^4.0.0 immutable: ^4.0.0 + jest-diff: "workspace:^" jest-get-type: "workspace:^" jest-matcher-utils: "workspace:^" jest-message-util: "workspace:^"