From 6e41bcd5b7db6876e8b2618f034e5a17e8df9e49 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 12:45:01 -0500 Subject: [PATCH 01/97] feat: adds error when using it or test without proper arguments --- packages/jest-jasmine2/src/jasmine/Env.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/jest-jasmine2/src/jasmine/Env.js b/packages/jest-jasmine2/src/jasmine/Env.js index 179529922ada..4c4d6502b24a 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.js +++ b/packages/jest-jasmine2/src/jasmine/Env.js @@ -424,6 +424,15 @@ export default function(j$) { }; this.it = function(description, fn, timeout) { + if (typeof description !== 'string') { + throw new Error(`first argument, "name", must be a string`); + } + if (fn === undefined) { + throw new Error('missing second argument function'); + } + if (typeof fn !== 'function') { + throw new Error(`second argument must be a function`); + } const spec = specFactory( description, fn, From b5519408a444a244e279cee2ca3aad6572451386 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 14:13:32 -0500 Subject: [PATCH 02/97] fix: adds more descriptive error message --- packages/jest-jasmine2/src/jasmine/Env.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/jest-jasmine2/src/jasmine/Env.js b/packages/jest-jasmine2/src/jasmine/Env.js index 4c4d6502b24a..1f382ddb3e96 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.js +++ b/packages/jest-jasmine2/src/jasmine/Env.js @@ -425,13 +425,19 @@ export default function(j$) { this.it = function(description, fn, timeout) { if (typeof description !== 'string') { - throw new Error(`first argument, "name", must be a string`); + throw new Error( + `Invalid first argument, ${description}. It must be a string.`, + ); } if (fn === undefined) { - throw new Error('missing second argument function'); + throw new Error( + 'Missing second argument. It must be a callback function.', + ); } if (typeof fn !== 'function') { - throw new Error(`second argument must be a function`); + throw new Error( + `Invalid second argument, ${fn}. It must be a callback function.`, + ); } const spec = specFactory( description, From 1de43aff2004cc4c0d2372769128c9b4b83c39a0 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 14:16:56 -0500 Subject: [PATCH 03/97] feat: adds tests for errors --- .../src/__tests__/it_argument_errors.test.js | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js diff --git a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js new file mode 100644 index 000000000000..7e3450b5468a --- /dev/null +++ b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +'use strict'; + +import Env from '../jasmine/Env'; +import ReportDispatcher from '../jasmine/report_dispatcher'; +const options = {ReportDispatcher}; +const testEnv = Env(options); +console.log(testEnv()); + +describe('it/test invalid argument errors', () => { + xit(`doesn't throw errors with correct arguments`, () => { + expect(testEnv.it('good', () => {})).toBeTruthy(); + }); + xit('throws an error when missing a callback', () => { + expect(testEnv.it('missing callback')).toThrowError(); + }); + + xit('throws an error if first argument is not a string', () => { + expect(testEnv.it(() => {})).toThrowError(); + }); + + xit('throws an error if the second argument is not a function', () => { + expect(testEnv.it('no', 'function')).toThrowError(); + }); +}); From f4a012e2b341e20a3a4622317beebc0e25a716b4 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 16:42:08 -0500 Subject: [PATCH 04/97] fix: removes bad test --- .../src/__tests__/it_argument_errors.test.js | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js diff --git a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js deleted file mode 100644 index 7e3450b5468a..000000000000 --- a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -'use strict'; - -import Env from '../jasmine/Env'; -import ReportDispatcher from '../jasmine/report_dispatcher'; -const options = {ReportDispatcher}; -const testEnv = Env(options); -console.log(testEnv()); - -describe('it/test invalid argument errors', () => { - xit(`doesn't throw errors with correct arguments`, () => { - expect(testEnv.it('good', () => {})).toBeTruthy(); - }); - xit('throws an error when missing a callback', () => { - expect(testEnv.it('missing callback')).toThrowError(); - }); - - xit('throws an error if first argument is not a string', () => { - expect(testEnv.it(() => {})).toThrowError(); - }); - - xit('throws an error if the second argument is not a function', () => { - expect(testEnv.it('no', 'function')).toThrowError(); - }); -}); From a84007f30d045d32c760ed398b61629cf7d33684 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 21:21:30 -0500 Subject: [PATCH 05/97] feat: adds tests for circus and jasmine2 --- .../__tests__/circus_it_test_error.test.js | 44 +++++++++++++++++++ packages/jest-circus/src/index.js | 18 +++++++- .../src/__tests__/it_test_error.test.js | 29 ++++++++++++ 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 packages/jest-circus/src/__tests__/circus_it_test_error.test.js create mode 100644 packages/jest-jasmine2/src/__tests__/it_test_error.test.js diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js new file mode 100644 index 000000000000..d7a3413beae9 --- /dev/null +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + */ + +'use strict'; + +let testIt; + +const itAliaser = () => { + const {it} = require('../index.js'); + testIt = it; +}; + +itAliaser(); + +describe('test/it error throwing', () => { + it(`doesn't throw an error with valid arguments`, () => { + expect(() => { + testIt('test', () => {}); + }).not.toThrowError(); + }); + it(`throws error with missing callback function`, () => { + expect(() => { + testIt('test'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + it(`throws an error when first argument isn't a string`, () => { + expect(() => { + testIt(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + it('throws an error when callback function is not a function', () => { + expect(() => { + testIt('test', 'test2'); + }).toThrowError( + `Invalid second argument, test2. It must be a callback function.`, + ); + }); +}); diff --git a/packages/jest-circus/src/index.js b/packages/jest-circus/src/index.js index e77a72f79518..0fbdfd218c0b 100644 --- a/packages/jest-circus/src/index.js +++ b/packages/jest-circus/src/index.js @@ -38,8 +38,22 @@ const beforeAll = (fn: HookFn) => _addHook(fn, 'beforeAll'); const afterEach = (fn: HookFn) => _addHook(fn, 'afterEach'); const afterAll = (fn: HookFn) => _addHook(fn, 'afterAll'); -const test = (testName: TestName, fn?: TestFn) => - dispatch({fn, name: 'add_test', testName}); +const test = (testName: TestName, fn: TestFn) => { + if (typeof testName !== 'string') { + throw new Error( + `Invalid first argument, ${testName}. It must be a string.`, + ); + } + if (fn === undefined) { + throw new Error('Missing second argument. It must be a callback function.'); + } + if (typeof fn !== 'function') { + throw new Error( + `Invalid second argument, ${fn}. It must be a callback function.`, + ); + } + return dispatch({fn, name: 'add_test', testName}); +}; const it = test; test.skip = (testName: TestName, fn?: TestFn) => dispatch({fn, mode: 'skip', name: 'add_test', testName}); diff --git a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js new file mode 100644 index 000000000000..4642c95335be --- /dev/null +++ b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +'use strict'; + +describe('test/it error throwing', () => { + it(`throws error with missing callback function`, () => { + expect(() => { + it('test2'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + it(`throws an error when first argument isn't a string`, () => { + expect(() => { + it(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + it('throws an error when callback function is not a function', () => { + expect(() => { + it('test3', 'test4'); + }).toThrowError( + `Invalid second argument, test4. It must be a callback function.`, + ); + }); +}); From 85587bd13c82fcb1ba65c2e23f78d85d3f1b7ef2 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 21:24:20 -0500 Subject: [PATCH 06/97] fix: small tweaks to test names --- packages/jest-jasmine2/src/__tests__/it_test_error.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js index 4642c95335be..27b95d4d59fc 100644 --- a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js +++ b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js @@ -11,7 +11,7 @@ describe('test/it error throwing', () => { it(`throws error with missing callback function`, () => { expect(() => { - it('test2'); + it('test1'); }).toThrowError('Missing second argument. It must be a callback function.'); }); it(`throws an error when first argument isn't a string`, () => { @@ -21,9 +21,9 @@ describe('test/it error throwing', () => { }); it('throws an error when callback function is not a function', () => { expect(() => { - it('test3', 'test4'); + it('test2', 'test3'); }).toThrowError( - `Invalid second argument, test4. It must be a callback function.`, + `Invalid second argument, test3. It must be a callback function.`, ); }); }); From 325fe11fd86e9cd7c33619f0f17c8696ca6a68b3 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 22:11:22 -0500 Subject: [PATCH 07/97] fix: adds circus test to flow ignore --- .flowconfig | 1 + .../jest-circus/src/__tests__/circus_it_test_error.test.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.flowconfig b/.flowconfig index 18facbe37888..d746d121a5d3 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,6 +1,7 @@ [ignore] .*/examples/.* .*/node_modules/metro-bundler/.* +.*/circus_it_test_error.test.js*. [options] module.name_mapper='^pretty-format$' -> '/packages/pretty-format/src/index.js' diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index d7a3413beae9..c9ba16f6603c 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -1,10 +1,10 @@ /** - * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow + * *@flow */ 'use strict'; From 363e5903cda0094a542b1210ab20f841d1aac4a6 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 09:38:40 -0500 Subject: [PATCH 08/97] fix: variable names for circus it --- .../__tests__/circus_it_test_error.test.js | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index c9ba16f6603c..068a3f80a804 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -9,34 +9,41 @@ 'use strict'; -let testIt; +let circusIt; -const itAliaser = () => { +//using jest-jasmine2's 'it' to test jest-circus's 'it'. Had to differentiate +//the two with this aliaser. + +const aliasCircusIt = () => { const {it} = require('../index.js'); - testIt = it; + circusIt = it; }; -itAliaser(); +aliasCircusIt(); + +//A few of these tests require incorrect types to throw errors and thus pass +//the test. The typechecks on jest-circus would prevent that, so +//this file has been listed in the .flowconfig ignore section. describe('test/it error throwing', () => { it(`doesn't throw an error with valid arguments`, () => { expect(() => { - testIt('test', () => {}); + circusIt('test', () => {}); }).not.toThrowError(); }); it(`throws error with missing callback function`, () => { expect(() => { - testIt('test'); + circusIt('test'); }).toThrowError('Missing second argument. It must be a callback function.'); }); it(`throws an error when first argument isn't a string`, () => { expect(() => { - testIt(() => {}); + circusIt(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); it('throws an error when callback function is not a function', () => { expect(() => { - testIt('test', 'test2'); + circusIt('test', 'test2'); }).toThrowError( `Invalid second argument, test2. It must be a callback function.`, ); From bf07249a6d5ae23ffff19e2824ee3b894525d909 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 09:57:10 -0500 Subject: [PATCH 09/97] chore: updates changelog. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16319cd3e275..850faed82e00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ### Features +* `[jest-jasmine2]` Adds error throwing and descriptive errors to `it`/ `test` + for invalid arguements. `[jest-circus]` Adds error throwing and descriptive + errors to `it`/ `test` for invalid arguements. * `[jest-util]` Add the following methods to the "console" implementations: `assert`, `count`, `countReset`, `dir`, `dirxml`, `group`, `groupCollapsed`, `groupEnd`, `time`, `timeEnd` From 918ad6d07537bed74f1c4ea37ab02b0f93d7cee9 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 10:49:40 -0500 Subject: [PATCH 10/97] fixes: lint error --- website/pages/en/videos.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/pages/en/videos.js b/website/pages/en/videos.js index 3253ed548944..b68d4c3f753c 100644 --- a/website/pages/en/videos.js +++ b/website/pages/en/videos.js @@ -36,7 +36,9 @@ class Videos extends React.Component { ({title, description, type, url}, index) => { const textMarkup = (
-

{title}

+

+ {title} +

{description}
From d2a36685a45c3ab8161aa104a6a3574843c598a4 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 14:27:18 -0500 Subject: [PATCH 11/97] updates: globals tests and snapshots --- .../__snapshots__/globals.test.js.snap | 75 ++++++++++++------- integration-tests/__tests__/globals.test.js | 4 +- 2 files changed, 50 insertions(+), 29 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 809211cb5725..9fe405a36eea 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -20,6 +20,23 @@ Ran all test suites. " `; +exports[`function as descriptor 1`] = ` +"PASS __tests__/function-as-descriptor.test.js + Foo + ✓ it + +" +`; + +exports[`function as descriptor 2`] = ` +"Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + exports[`only 1`] = ` "PASS __tests__/only-constructs.test.js ✓ test.only @@ -123,16 +140,27 @@ Ran all test suites. `; exports[`tests with no implementation 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ skipped 2 tests +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run + + Missing second argument. It must be a callback function. + + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | } + + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; exports[`tests with no implementation 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total +"Test Suites: 1 failed, 1 total +Tests: 0 total Snapshots: 0 total Time: <> Ran all test suites. @@ -140,34 +168,27 @@ Ran all test suites. `; exports[`tests with no implementation with expand arg 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ it, no implementation - ○ test, no implementation +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run -" -`; + Missing second argument. It must be a callback function. -exports[`tests with no implementation with expand arg 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - -exports[`function as descriptor 1`] = ` -"PASS __tests__/function-as-descriptor.test.js - Foo - ✓ it + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | } + + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; -exports[`function as descriptor 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 1 passed, 1 total +exports[`tests with no implementation with expand arg 2`] = ` +"Test Suites: 1 failed, 1 total +Tests: 0 total Snapshots: 0 total Time: <> Ran all test suites. diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index 7c41819f0b6b..9d0df5172b3a 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -120,7 +120,7 @@ test('tests with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); @@ -198,7 +198,7 @@ test('tests with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); From b489b375d95bdd4687c68478bdb3ed5cd0e2eecc Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 16:23:20 -0500 Subject: [PATCH 12/97] fix: resets snapshot file --- .../__snapshots__/globals.test.js.snap | 77 +++++++------------ 1 file changed, 28 insertions(+), 49 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 9fe405a36eea..6bc34bc7f4a3 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -20,23 +20,6 @@ Ran all test suites. " `; -exports[`function as descriptor 1`] = ` -"PASS __tests__/function-as-descriptor.test.js - Foo - ✓ it - -" -`; - -exports[`function as descriptor 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 1 passed, 1 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - exports[`only 1`] = ` "PASS __tests__/only-constructs.test.js ✓ test.only @@ -140,27 +123,16 @@ Ran all test suites. `; exports[`tests with no implementation 1`] = ` -"FAIL __tests__/only-constructs.test.js - ● Test suite failed to run - - Missing second argument. It must be a callback function. - - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | - 436 | } - - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 - at __tests__/only-constructs.test.js:3:5 +"PASS __tests__/only-constructs.test.js + ✓ it + ○ skipped 2 tests " `; exports[`tests with no implementation 2`] = ` -"Test Suites: 1 failed, 1 total -Tests: 0 total +"Test Suites: 1 passed, 1 total +Tests: 2 skipped, 1 passed, 3 total Snapshots: 0 total Time: <> Ran all test suites. @@ -168,29 +140,36 @@ Ran all test suites. `; exports[`tests with no implementation with expand arg 1`] = ` -"FAIL __tests__/only-constructs.test.js - ● Test suite failed to run - - Missing second argument. It must be a callback function. - - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | - 436 | } - - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 - at __tests__/only-constructs.test.js:3:5 +"PASS __tests__/only-constructs.test.js + ✓ it + ○ it, no implementation + ○ test, no implementation " `; exports[`tests with no implementation with expand arg 2`] = ` -"Test Suites: 1 failed, 1 total -Tests: 0 total +"Test Suites: 1 passed, 1 total +Tests: 2 skipped, 1 passed, 3 total Snapshots: 0 total Time: <> Ran all test suites. " `; + +exports[`function as descriptor 1`] = ` +"PASS __tests__/function-as-descriptor.test.js + Foo + ✓ it + +" +`; + +exports[`function as descriptor 2`] = ` +"Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; \ No newline at end of file From a873a75599705b02bd8b758a25036acac23f4130 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 16:27:00 -0500 Subject: [PATCH 13/97] fix: temp skips failing tests until further direction --- integration-tests/__tests__/globals.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index 9d0df5172b3a..da20569c38db 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -110,7 +110,7 @@ test('only', () => { expect(summary).toMatchSnapshot(); }); -test('tests with no implementation', () => { +xtest('tests with no implementation', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -120,7 +120,7 @@ test('tests with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(1); + expect(status).toBe(0); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); @@ -188,7 +188,7 @@ test('only with expand arg', () => { expect(summary).toMatchSnapshot(); }); -test('tests with no implementation with expand arg', () => { +xtest('tests with no implementation with expand arg', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -198,7 +198,7 @@ test('tests with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(1); + expect(status).toBe(0); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); From 119130cc6a475b0362556c58f752e1b208dbee61 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 18:55:26 -0500 Subject: [PATCH 14/97] feat: adds tests for test alias --- .../__tests__/circus_it_test_error.test.js | 42 +++++++++++++++---- .../src/__tests__/it_test_error.test.js | 27 +++++++++--- 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index 068a3f80a804..7b72fef20015 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -10,13 +10,15 @@ 'use strict'; let circusIt; +let circusTest; //using jest-jasmine2's 'it' to test jest-circus's 'it'. Had to differentiate //the two with this aliaser. const aliasCircusIt = () => { - const {it} = require('../index.js'); + const {it, test} = require('../index.js'); circusIt = it; + circusTest = test; }; aliasCircusIt(); @@ -26,26 +28,48 @@ aliasCircusIt(); //this file has been listed in the .flowconfig ignore section. describe('test/it error throwing', () => { - it(`doesn't throw an error with valid arguments`, () => { + it(`it doesn't throw an error with valid arguments`, () => { expect(() => { - circusIt('test', () => {}); + circusIt('test1', () => {}); }).not.toThrowError(); }); - it(`throws error with missing callback function`, () => { + it(`it throws error with missing callback function`, () => { expect(() => { - circusIt('test'); + circusIt('test2'); }).toThrowError('Missing second argument. It must be a callback function.'); }); - it(`throws an error when first argument isn't a string`, () => { + it(`it throws an error when first argument isn't a string`, () => { expect(() => { circusIt(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); - it('throws an error when callback function is not a function', () => { + it('it throws an error when callback function is not a function', () => { expect(() => { - circusIt('test', 'test2'); + circusIt('test4', 'test4b'); }).toThrowError( - `Invalid second argument, test2. It must be a callback function.`, + `Invalid second argument, test4b. It must be a callback function.`, + ); + }); + it(`test doesn't throw an error with valid arguments`, () => { + expect(() => { + circusTest('test5', () => {}); + }).not.toThrowError(); + }); + it(`test throws error with missing callback function`, () => { + expect(() => { + circusTest('test6'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + it(`test throws an error when first argument isn't a string`, () => { + expect(() => { + circusTest(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + it('test throws an error when callback function is not a function', () => { + expect(() => { + circusTest('test8', 'test8b'); + }).toThrowError( + `Invalid second argument, test8b. It must be a callback function.`, ); }); }); diff --git a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js index 27b95d4d59fc..9f1727645ffd 100644 --- a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js +++ b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js @@ -9,21 +9,38 @@ 'use strict'; describe('test/it error throwing', () => { - it(`throws error with missing callback function`, () => { + it(`it throws error with missing callback function`, () => { expect(() => { it('test1'); }).toThrowError('Missing second argument. It must be a callback function.'); }); - it(`throws an error when first argument isn't a string`, () => { + it(`it throws an error when first argument isn't a string`, () => { expect(() => { it(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); - it('throws an error when callback function is not a function', () => { + it('it throws an error when callback function is not a function', () => { expect(() => { - it('test2', 'test3'); + it('test3', 'test3b'); }).toThrowError( - `Invalid second argument, test3. It must be a callback function.`, + `Invalid second argument, test3b. It must be a callback function.`, + ); + }); + test(`test throws error with missing callback function`, () => { + expect(() => { + test('test4'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + test(`test throws an error when first argument isn't a string`, () => { + expect(() => { + test(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + test('test throws an error when callback function is not a function', () => { + expect(() => { + test('test6', 'test6b'); + }).toThrowError( + `Invalid second argument, test6b. It must be a callback function.`, ); }); }); From 1d6e12c2a34afee7f60f45810803b57a37993870 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 19:56:28 -0500 Subject: [PATCH 15/97] fix: renamed unimplemented test. Comments out rest snapshot for now. --- .../__snapshots__/globals.test.js.snap | 87 ++++++++----------- integration-tests/__tests__/globals.test.js | 12 +-- 2 files changed, 41 insertions(+), 58 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 6bc34bc7f4a3..2122883d094d 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -20,6 +20,41 @@ Ran all test suites. " `; +exports[`cannot test with no implementation 1`] = ` +"Test Suites: 1 failed, 1 total +Tests: 0 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + +exports[`cannot test with no implementation with expand arg 1`] = ` +"Test Suites: 1 failed, 1 total +Tests: 0 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + +exports[`function as descriptor 1`] = ` +"PASS __tests__/function-as-descriptor.test.js + Foo + ✓ it + +" +`; + +exports[`function as descriptor 2`] = ` +"Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + exports[`only 1`] = ` "PASS __tests__/only-constructs.test.js ✓ test.only @@ -121,55 +156,3 @@ Time: <> Ran all test suites. " `; - -exports[`tests with no implementation 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ skipped 2 tests - -" -`; - -exports[`tests with no implementation 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - -exports[`tests with no implementation with expand arg 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ it, no implementation - ○ test, no implementation - -" -`; - -exports[`tests with no implementation with expand arg 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - -exports[`function as descriptor 1`] = ` -"PASS __tests__/function-as-descriptor.test.js - Foo - ✓ it - -" -`; - -exports[`function as descriptor 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 1 passed, 1 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; \ No newline at end of file diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index da20569c38db..bb3f028e3d5f 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -110,7 +110,7 @@ test('only', () => { expect(summary).toMatchSnapshot(); }); -xtest('tests with no implementation', () => { +test('cannot test with no implementation', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -120,10 +120,10 @@ xtest('tests with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - expect(rest).toMatchSnapshot(); + // expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); @@ -188,7 +188,7 @@ test('only with expand arg', () => { expect(summary).toMatchSnapshot(); }); -xtest('tests with no implementation with expand arg', () => { +test('cannot test with no implementation with expand arg', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -198,10 +198,10 @@ xtest('tests with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - expect(rest).toMatchSnapshot(); + // expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From 29a0f0adc63244915f8bb4489709059a84abc391 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 11:28:37 -0500 Subject: [PATCH 16/97] fix: restores rest snapshot and removes abs path from snapshot stack --- .../__snapshots__/globals.test.js.snap | 28 +++++++++++++++++++ integration-tests/__tests__/globals.test.js | 6 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 2122883d094d..416c9eb30100 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -21,6 +21,20 @@ Ran all test suites. `; exports[`cannot test with no implementation 1`] = ` +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run + + Missing second argument. It must be a callback function. + + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | }" +`; + +exports[`cannot test with no implementation 2`] = ` "Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total @@ -30,6 +44,20 @@ Ran all test suites. `; exports[`cannot test with no implementation with expand arg 1`] = ` +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run + + Missing second argument. It must be a callback function. + + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | }" +`; + +exports[`cannot test with no implementation with expand arg 2`] = ` "Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index bb3f028e3d5f..da79125e0f2f 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -123,7 +123,8 @@ test('cannot test with no implementation', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - // expect(rest).toMatchSnapshot(); + const restWithoutStack = rest.slice(0, 343); + expect(restWithoutStack).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); @@ -201,7 +202,8 @@ test('cannot test with no implementation with expand arg', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - // expect(rest).toMatchSnapshot(); + const restWithoutStack = rest.slice(0, 343); + expect(restWithoutStack).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From d8eac51810bf56b2106948a63fd1dbe06e02107b Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 13:02:56 -0500 Subject: [PATCH 17/97] fix: cleans up stack using cleanUpStackTrace --- .../__tests__/__snapshots__/globals.test.js.snap | 14 ++++++++++++-- integration-tests/__tests__/globals.test.js | 7 +++---- integration-tests/utils.js | 6 ++++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 416c9eb30100..495c1001d42d 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -31,7 +31,12 @@ exports[`cannot test with no implementation 1`] = ` > 433 | throw new Error( 434 | 'Missing second argument. It must be a callback function.'); 435 | - 436 | }" + 436 | } + + + at __tests__/only-constructs.test.js:3:5 + +" `; exports[`cannot test with no implementation 2`] = ` @@ -54,7 +59,12 @@ exports[`cannot test with no implementation with expand arg 1`] = ` > 433 | throw new Error( 434 | 'Missing second argument. It must be a callback function.'); 435 | - 436 | }" + 436 | } + + + at __tests__/only-constructs.test.js:3:5 + +" `; exports[`cannot test with no implementation with expand arg 2`] = ` diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index da79125e0f2f..9e3a1ad1fdd2 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -123,8 +123,8 @@ test('cannot test with no implementation', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - const restWithoutStack = rest.slice(0, 343); - expect(restWithoutStack).toMatchSnapshot(); + + expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); @@ -202,8 +202,7 @@ test('cannot test with no implementation with expand arg', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - const restWithoutStack = rest.slice(0, 343); - expect(restWithoutStack).toMatchSnapshot(); + expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); diff --git a/integration-tests/utils.js b/integration-tests/utils.js index 06454d81d817..3b9770f97715 100644 --- a/integration-tests/utils.js +++ b/integration-tests/utils.js @@ -145,10 +145,12 @@ const extractSummary = (stdout: string) => { const summary = match[0] .replace(/\d*\.?\d+m?s/g, '<>') .replace(/, estimated <>/g, ''); - const rest = cleanupStackTrace( // remove all timestamps - stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), + stdout + .slice(0, -match[0].length) + .replace(/\s*\(\d*\.?\d+m?s\)$/gm, '') + .replace(/^.*\b(at Env.it)\b.*$/gm, ''), ); return {rest, summary}; From e09303fa4b1e2d8e70e8473f78a7f0d27bb2e4c5 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 13:43:29 -0500 Subject: [PATCH 18/97] fix: modifies regex in utils --- .../__tests__/__snapshots__/globals.test.js.snap | 8 ++++---- integration-tests/utils.js | 8 ++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 495c1001d42d..2fe104a0cf75 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -33,8 +33,8 @@ exports[`cannot test with no implementation 1`] = ` 435 | 436 | } - - at __tests__/only-constructs.test.js:3:5 + at at + at at " `; @@ -61,8 +61,8 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - - at __tests__/only-constructs.test.js:3:5 + at at + at at " `; diff --git a/integration-tests/utils.js b/integration-tests/utils.js index 3b9770f97715..99ab9998ca39 100644 --- a/integration-tests/utils.js +++ b/integration-tests/utils.js @@ -147,12 +147,8 @@ const extractSummary = (stdout: string) => { .replace(/, estimated <>/g, ''); const rest = cleanupStackTrace( // remove all timestamps - stdout - .slice(0, -match[0].length) - .replace(/\s*\(\d*\.?\d+m?s\)$/gm, '') - .replace(/^.*\b(at Env.it)\b.*$/gm, ''), + stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), ); - return {rest, summary}; }; @@ -160,7 +156,7 @@ const extractSummary = (stdout: string) => { // unifies their output to make it possible to snapshot them. // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { - return output.replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); + return output.replace(/^.*\b(at)\b.*$/gm, ' at $1'); }; module.exports = { From 5106800aa5cf089b608de425e63b3e5846968af2 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 14:10:22 -0500 Subject: [PATCH 19/97] fix: reverts utils regex --- .../__tests__/__snapshots__/globals.test.js.snap | 8 ++++---- integration-tests/utils.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 2fe104a0cf75..b14324eb7a8b 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -33,8 +33,8 @@ exports[`cannot test with no implementation 1`] = ` 435 | 436 | } - at at - at at + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; @@ -61,8 +61,8 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - at at - at at + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; diff --git a/integration-tests/utils.js b/integration-tests/utils.js index 99ab9998ca39..9c437f7e8232 100644 --- a/integration-tests/utils.js +++ b/integration-tests/utils.js @@ -156,7 +156,7 @@ const extractSummary = (stdout: string) => { // unifies their output to make it possible to snapshot them. // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { - return output.replace(/^.*\b(at)\b.*$/gm, ' at $1'); + return output.replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); }; module.exports = { From 84d9a9b210be56786cf24d7ff61991b1f13826cc Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 14:18:06 -0500 Subject: [PATCH 20/97] fix: reverts line deletion in utils. --- integration-tests/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration-tests/utils.js b/integration-tests/utils.js index 9c437f7e8232..06454d81d817 100644 --- a/integration-tests/utils.js +++ b/integration-tests/utils.js @@ -145,10 +145,12 @@ const extractSummary = (stdout: string) => { const summary = match[0] .replace(/\d*\.?\d+m?s/g, '<>') .replace(/, estimated <>/g, ''); + const rest = cleanupStackTrace( // remove all timestamps stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), ); + return {rest, summary}; }; From 781560222562474f5d8a2ce51c8c1d8ab8b06429 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 15:14:49 -0500 Subject: [PATCH 21/97] fix: replaces env in cleanup stack trace --- .../__tests__/__snapshots__/globals.test.js.snap | 4 ++-- integration-tests/utils.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index b14324eb7a8b..495c1001d42d 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -33,7 +33,7 @@ exports[`cannot test with no implementation 1`] = ` 435 | 436 | } - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " @@ -61,7 +61,7 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " diff --git a/integration-tests/utils.js b/integration-tests/utils.js index 06454d81d817..23a0b4ceb9e4 100644 --- a/integration-tests/utils.js +++ b/integration-tests/utils.js @@ -158,7 +158,9 @@ const extractSummary = (stdout: string) => { // unifies their output to make it possible to snapshot them. // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { - return output.replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); + return output + .replace(/^.*\b(at Env.it)\b.*$/gm, '') + .replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); }; module.exports = { From 0728d30e0864d3c2052f9d46715839b0ea96fab6 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 15:24:34 -0500 Subject: [PATCH 22/97] fix: updates utils to current version --- integration-tests/utils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/integration-tests/utils.js b/integration-tests/utils.js index 23a0b4ceb9e4..b500c078a2a5 100644 --- a/integration-tests/utils.js +++ b/integration-tests/utils.js @@ -11,7 +11,7 @@ import type {Path} from 'types/Config'; -const {spawnSync} = require('child_process'); +const {sync: spawnSync} = require('cross-spawn'); const fs = require('fs'); const path = require('path'); const mkdirp = require('mkdirp'); @@ -43,8 +43,9 @@ const linkJestPackage = (packageName: string, cwd: Path) => { const packagesDir = path.resolve(__dirname, '../packages'); const packagePath = path.resolve(packagesDir, packageName); const destination = path.resolve(cwd, 'node_modules/'); - run(`mkdir -p ${destination}`); - return run(`ln -sf ${packagePath} ${destination}`); + mkdirp.sync(destination); + rimraf.sync(destination); + fs.symlinkSync(packagePath, destination, 'dir'); }; const fileExists = (filePath: Path) => { From b10ad04cba9b6de8ed84c932521527b565da6d0f Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Fri, 16 Feb 2018 10:00:34 -0500 Subject: [PATCH 23/97] fix: updates master --- .circleci/rn | 0 .../__snapshots__/extend.test.js.snap | 2 +- .../__snapshots__/matchers.test.js.snap | 3182 ++++++++--------- .../__snapshots__/spy_matchers.test.js.snap | 228 +- .../to_throw_matchers.test.js.snap | 136 +- .../snapshot_interactive_mode.test.js.snap | 28 +- .../format_test_name_by_pattern.test.js.snap | 26 +- .../get_snapshot_status.test.js.snap | 24 +- .../get_snapshot_summary.test.js.snap | 38 +- .../summary_reporter.test.js.snap | 28 +- .../__snapshots__/utils.test.js.snap | 20 +- .../__snapshots__/normalize.test.js.snap | 104 +- .../__tests__/__snapshots__/diff.test.js.snap | 328 +- .../__snapshots__/matchers.test.js.snap | 6 +- .../__snapshots__/index.test.js.snap | 20 +- .../__snapshots__/messages.test.js.snap | 20 +- .../validate_cli_options.test.js.snap | 30 +- .../__snapshots__/validate.test.js.snap | 214 +- 18 files changed, 2217 insertions(+), 2217 deletions(-) create mode 100644 .circleci/rn diff --git a/.circleci/rn b/.circleci/rn new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap b/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap index 7565cb732261..c804d6c84014 100644 --- a/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap @@ -2,4 +2,4 @@ exports[`is available globally 1`] = `"expected 15 to be divisible by 2"`; -exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`; +exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`; diff --git a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap index 7a1471e697b2..52c4c69de4ae 100644 --- a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap @@ -1,4213 +1,4213 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`.rejects fails for promise that resolves 1`] = ` -"expect(received).rejects.toBe() +"expect(received).rejects.toBe() -Expected received Promise to reject, instead it resolved to value - 4" +Expected received Promise to reject, instead it resolved to value + 4" `; exports[`.rejects fails non-promise value "a" 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - string: \\"a\\"" + string: \\"a\\"" `; exports[`.rejects fails non-promise value [1] 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - array: [1]" + array: [1]" `; exports[`.rejects fails non-promise value [Function anonymous] 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.rejects fails non-promise value {"a": 1} 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - object: {\\"a\\": 1}" + object: {\\"a\\": 1}" `; exports[`.rejects fails non-promise value 4 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - number: 4" + number: 4" `; exports[`.rejects fails non-promise value null 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. -Received: null" +received value must be a Promise. +Received: null" `; exports[`.rejects fails non-promise value true 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - boolean: true" + boolean: true" `; exports[`.rejects fails non-promise value undefined 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. -Received: undefined" +received value must be a Promise. +Received: undefined" `; exports[`.resolves fails for promise that rejects 1`] = ` -"expect(received).resolves.toBe() +"expect(received).resolves.toBe() -Expected received Promise to resolve, instead it rejected to value - 4" +Expected received Promise to resolve, instead it rejected to value + 4" `; exports[`.resolves fails non-promise value "a" 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - string: \\"a\\"" + string: \\"a\\"" `; exports[`.resolves fails non-promise value "a" synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - string: \\"a\\"" + string: \\"a\\"" `; exports[`.resolves fails non-promise value [1] 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - array: [1]" + array: [1]" `; exports[`.resolves fails non-promise value [1] synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - array: [1]" + array: [1]" `; exports[`.resolves fails non-promise value [Function anonymous] 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.resolves fails non-promise value [Function anonymous] synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.resolves fails non-promise value {"a": 1} 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - object: {\\"a\\": 1}" + object: {\\"a\\": 1}" `; exports[`.resolves fails non-promise value {"a": 1} synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - object: {\\"a\\": 1}" + object: {\\"a\\": 1}" `; exports[`.resolves fails non-promise value 4 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - number: 4" + number: 4" `; exports[`.resolves fails non-promise value 4 synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - number: 4" + number: 4" `; exports[`.resolves fails non-promise value null 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: null" +received value must be a Promise. +Received: null" `; exports[`.resolves fails non-promise value null synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: null" +received value must be a Promise. +Received: null" `; exports[`.resolves fails non-promise value true 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - boolean: true" + boolean: true" `; exports[`.resolves fails non-promise value true synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - boolean: true" + boolean: true" `; exports[`.resolves fails non-promise value undefined 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: undefined" +received value must be a Promise. +Received: undefined" `; exports[`.resolves fails non-promise value undefined synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: undefined" +received value must be a Promise. +Received: 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 value to be: - {} + {} Received: - {\\"circular\\": [Circular]} + {\\"circular\\": [Circular]} Difference: -- Expected -+ Received +- Expected ++ Received -- 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 value to not be: - \\"a\\" + \\"a\\" Received: - \\"a\\"" + \\"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 value to not be: - [] + [] Received: - []" + []" `; exports[`.toBe() fails for '{}' with '.not' 1`] = ` -"expect(received).not.toBe(expected) // Object.is equality +"expect(received).not.toBe(expected) // Object.is equality Expected value to not be: - {} + {} Received: - {}" + {}" `; 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 value to not be: - 1 + 1 Received: - 1" + 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 value to not be: - false + false Received: - false" + 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 value to not be: - null + null Received: - null" + 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 value to not be: - undefined + undefined Received: - undefined" + undefined" `; exports[`.toBe() fails for: "abc" and "cde" 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - \\"cde\\" + \\"cde\\" Received: - \\"abc\\"" + \\"abc\\"" `; 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 value to be: - \\"without trailing space\\" + \\"without trailing space\\" Received: - \\"with -trailing space\\"" + \\"with +trailing space\\"" `; exports[`.toBe() fails for: [] and [] 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - [] + [] Received: - [] + [] Difference: -Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." +Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." `; exports[`.toBe() fails for: {"a": 1} and {"a": 1} 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - {\\"a\\": 1} + {\\"a\\": 1} Received: - {\\"a\\": 1} + {\\"a\\": 1} Difference: -Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." +Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." `; 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 value to be: - {\\"a\\": 5} + {\\"a\\": 5} Received: - {\\"a\\": 1} + {\\"a\\": 1} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"a\\": 5, -+ \\"a\\": 1, - }" + Object { +- \\"a\\": 5, ++ \\"a\\": 1, + }" `; exports[`.toBe() fails for: {} and {} 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - {} + {} Received: - {} + {} Difference: -Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." +Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." `; exports[`.toBe() fails for: -0 and 0 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - 0 + 0 Received: - -0 + -0 Difference: -Compared values have no visual difference." +Compared values have no visual difference." `; exports[`.toBe() fails for: 1 and 2 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - 2 + 2 Received: - 1" + 1" `; exports[`.toBe() fails for: null and undefined 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - undefined + undefined Received: - null + null Difference: - Comparing two different types of values. Expected undefined but received null." + Comparing two different types of values. Expected undefined but 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 value to be: - false + false Received: - true" + true" `; exports[`.toBeCloseTo() {pass: true} expect(0)toBeCloseTo( 0) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 0 +Expected value not to be close to (with 2-digit precision): + 0 Received: - 0" + 0" `; exports[`.toBeCloseTo() {pass: true} expect(0)toBeCloseTo( 0.001) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 0.001 +Expected value not to be close to (with 2-digit precision): + 0.001 Received: - 0" + 0" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.225) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.225 +Expected value not to be close to (with 2-digit precision): + 1.225 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.226) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.226 +Expected value not to be close to (with 2-digit precision): + 1.226 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.229) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.229 +Expected value not to be close to (with 2-digit precision): + 1.229 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.234) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.234 +Expected value not to be close to (with 2-digit precision): + 1.234 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() accepts an optional precision argument: [0, 0.000004, 5] 1`] = ` -"expect(received).not.toBeCloseTo(expected, precision) +"expect(received).not.toBeCloseTo(expected, precision) -Expected value not to be close to (with 5-digit precision): - 0.000004 +Expected value not to be close to (with 5-digit precision): + 0.000004 Received: - 0" + 0" `; exports[`.toBeCloseTo() accepts an optional precision argument: [0, 0.0001, 3] 1`] = ` -"expect(received).not.toBeCloseTo(expected, precision) +"expect(received).not.toBeCloseTo(expected, precision) -Expected value not to be close to (with 3-digit precision): - 0.0001 +Expected value not to be close to (with 3-digit precision): + 0.0001 Received: - 0" + 0" `; exports[`.toBeCloseTo() accepts an optional precision argument: [0, 0.1, 0] 1`] = ` -"expect(received).not.toBeCloseTo(expected, precision) +"expect(received).not.toBeCloseTo(expected, precision) -Expected value not to be close to (with 0-digit precision): - 0.1 +Expected value not to be close to (with 0-digit precision): + 0.1 Received: - 0" + 0" `; exports[`.toBeCloseTo() throws: [0, 0.01] 1`] = ` -"expect(received).toBeCloseTo(expected) +"expect(received).toBeCloseTo(expected) -Expected value to be close to (with 2-digit precision): - 0.01 +Expected value to be close to (with 2-digit precision): + 0.01 Received: - 0" + 0" `; exports[`.toBeCloseTo() throws: [1, 1.23] 1`] = ` -"expect(received).toBeCloseTo(expected) +"expect(received).toBeCloseTo(expected) -Expected value to be close to (with 2-digit precision): - 1.23 +Expected value to be close to (with 2-digit precision): + 1.23 Received: - 1" + 1" `; exports[`.toBeCloseTo() throws: [1.23, 1.2249999] 1`] = ` -"expect(received).toBeCloseTo(expected) +"expect(received).toBeCloseTo(expected) -Expected value to be close to (with 2-digit precision): - 1.2249999 +Expected value to be close to (with 2-digit precision): + 1.2249999 Received: - 1.23" + 1.23" `; exports[`.toBeDefined(), .toBeUndefined() '"a"' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeDefined(), .toBeUndefined() '"a"' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeDefined(), .toBeUndefined() '[]' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - []" + []" `; exports[`.toBeDefined(), .toBeUndefined() '[]' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - []" + []" `; exports[`.toBeDefined(), .toBeUndefined() '[Function anonymous]' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeDefined(), .toBeUndefined() '[Function anonymous]' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeDefined(), .toBeUndefined() '{}' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - {}" + {}" `; exports[`.toBeDefined(), .toBeUndefined() '{}' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - {}" + {}" `; exports[`.toBeDefined(), .toBeUndefined() '0.5' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - 0.5" + 0.5" `; exports[`.toBeDefined(), .toBeUndefined() '0.5' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - 0.5" + 0.5" `; exports[`.toBeDefined(), .toBeUndefined() '1' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - 1" + 1" `; exports[`.toBeDefined(), .toBeUndefined() '1' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - 1" + 1" `; exports[`.toBeDefined(), .toBeUndefined() 'Infinity' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - Infinity" + Infinity" `; exports[`.toBeDefined(), .toBeUndefined() 'Infinity' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - Infinity" + Infinity" `; exports[`.toBeDefined(), .toBeUndefined() 'Map {}' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - Map {}" + Map {}" `; exports[`.toBeDefined(), .toBeUndefined() 'Map {}' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - Map {}" + Map {}" `; exports[`.toBeDefined(), .toBeUndefined() 'true' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - true" + true" `; exports[`.toBeDefined(), .toBeUndefined() 'true' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - true" + true" `; exports[`.toBeDefined(), .toBeUndefined() undefined is undefined 1`] = ` -"expect(received).toBeDefined() +"expect(received).toBeDefined() Expected value to be defined, instead received - undefined" + undefined" `; exports[`.toBeDefined(), .toBeUndefined() undefined is undefined 2`] = ` -"expect(received).not.toBeUndefined() +"expect(received).not.toBeUndefined() Expected value not to be undefined, instead received - undefined" + undefined" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [-Infinity, -Infinity] 1`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - -Infinity + -Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [-Infinity, -Infinity] 2`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - -Infinity + -Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [1, 1] 1`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 1 + 1 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [1, 1] 2`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 1 + 1 Received: - 1" + 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 value not to be greater than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 1.7976931348623157e+308" + 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 value not to be less than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 1.7976931348623157e+308" + 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 value not to be greater than or equal: - 5e-324 + 5e-324 Received: - 5e-324" + 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 value not to be less than or equal: - 5e-324 + 5e-324 Received: - 5e-324" + 5e-324" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [Infinity, Infinity] 1`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - Infinity + Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [Infinity, Infinity] 2`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - Infinity + Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be less than: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be greater than: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be less than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be greater than or equal: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeInstanceOf() failing "a" and [Function String] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"String\\" + \\"String\\" Received: - \\"a\\" + \\"a\\" Constructor: - \\"String\\"" + \\"String\\"" `; exports[`.toBeInstanceOf() failing {} and [Function A] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"A\\" + \\"A\\" Received: - {} + {} Constructor: - undefined" + undefined" `; exports[`.toBeInstanceOf() failing {} and [Function B] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"B\\" + \\"B\\" Received: - {} + {} Constructor: - \\"A\\"" + \\"A\\"" `; exports[`.toBeInstanceOf() failing 1 and [Function Number] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"Number\\" + \\"Number\\" Received: - 1 + 1 Constructor: - \\"Number\\"" + \\"Number\\"" `; exports[`.toBeInstanceOf() failing true and [Function Boolean] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"Boolean\\" + \\"Boolean\\" Received: - true + true Constructor: - \\"Boolean\\"" + \\"Boolean\\"" `; exports[`.toBeInstanceOf() passing [] and [Function Array] 1`] = ` -"expect(value).not.toBeInstanceOf(constructor) +"expect(value).not.toBeInstanceOf(constructor) Expected value not to be an instance of: - \\"Array\\" + \\"Array\\" Received: - [] + [] " `; exports[`.toBeInstanceOf() passing {} and [Function A] 1`] = ` -"expect(value).not.toBeInstanceOf(constructor) +"expect(value).not.toBeInstanceOf(constructor) Expected value not to be an instance of: - \\"A\\" + \\"A\\" Received: - {} + {} " `; exports[`.toBeInstanceOf() passing Map {} and [Function Map] 1`] = ` -"expect(value).not.toBeInstanceOf(constructor) +"expect(value).not.toBeInstanceOf(constructor) Expected value not to be an instance of: - \\"Map\\" + \\"Map\\" Received: - Map {} + Map {} " `; exports[`.toBeInstanceOf() throws if constructor is not a function 1`] = ` -"expect(value)[.not].toBeInstanceOf(constructor) +"expect(value)[.not].toBeInstanceOf(constructor) Expected constructor to be a function. Instead got: - \\"number\\"" + \\"number\\"" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 1`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 2`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 3`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 4`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() throws 1`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - 1" + 1" `; exports[`.toBeNaN() throws 2`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - \\"\\"" + \\"\\"" `; exports[`.toBeNaN() throws 3`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - null" + null" `; exports[`.toBeNaN() throws 4`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - undefined" + undefined" `; exports[`.toBeNaN() throws 5`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - {}" + {}" `; exports[`.toBeNaN() throws 6`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - []" + []" `; exports[`.toBeNaN() throws 7`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - 0.2" + 0.2" `; exports[`.toBeNaN() throws 8`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - 0" + 0" `; exports[`.toBeNaN() throws 9`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - Infinity" + Infinity" `; exports[`.toBeNaN() throws 10`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - -Infinity" + -Infinity" `; exports[`.toBeNull() fails for '"a"' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeNull() fails for '[]' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - []" + []" `; exports[`.toBeNull() fails for '[Function anonymous]' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeNull() fails for '{}' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - {}" + {}" `; exports[`.toBeNull() fails for '0.5' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - 0.5" + 0.5" `; exports[`.toBeNull() fails for '1' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - 1" + 1" `; exports[`.toBeNull() fails for 'Infinity' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - Infinity" + Infinity" `; exports[`.toBeNull() fails for 'Map {}' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - Map {}" + Map {}" `; exports[`.toBeNull() fails for 'true' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - true" + true" `; exports[`.toBeNull() pass for null 1`] = ` -"expect(received).not.toBeNull() +"expect(received).not.toBeNull() Expected value not to be null, instead received - null" + null" `; exports[`.toBeTruthy(), .toBeFalsy() '""' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - \\"\\"" + \\"\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '""' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - \\"\\"" + \\"\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '"a"' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '"a"' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '[]' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - []" + []" `; exports[`.toBeTruthy(), .toBeFalsy() '[]' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - []" + []" `; exports[`.toBeTruthy(), .toBeFalsy() '[Function anonymous]' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeTruthy(), .toBeFalsy() '[Function anonymous]' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeTruthy(), .toBeFalsy() '{}' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - {}" + {}" `; exports[`.toBeTruthy(), .toBeFalsy() '{}' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - {}" + {}" `; exports[`.toBeTruthy(), .toBeFalsy() '0' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - 0" + 0" `; exports[`.toBeTruthy(), .toBeFalsy() '0' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - 0" + 0" `; exports[`.toBeTruthy(), .toBeFalsy() '0.5' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - 0.5" + 0.5" `; exports[`.toBeTruthy(), .toBeFalsy() '0.5' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - 0.5" + 0.5" `; exports[`.toBeTruthy(), .toBeFalsy() '1' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - 1" + 1" `; exports[`.toBeTruthy(), .toBeFalsy() '1' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - 1" + 1" `; exports[`.toBeTruthy(), .toBeFalsy() 'Infinity' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - Infinity" + Infinity" `; exports[`.toBeTruthy(), .toBeFalsy() 'Infinity' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - Infinity" + Infinity" `; exports[`.toBeTruthy(), .toBeFalsy() 'Map {}' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - Map {}" + Map {}" `; exports[`.toBeTruthy(), .toBeFalsy() 'Map {}' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - Map {}" + Map {}" `; exports[`.toBeTruthy(), .toBeFalsy() 'NaN' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - NaN" + NaN" `; exports[`.toBeTruthy(), .toBeFalsy() 'NaN' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - NaN" + NaN" `; exports[`.toBeTruthy(), .toBeFalsy() 'false' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - false" + false" `; exports[`.toBeTruthy(), .toBeFalsy() 'false' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - false" + false" `; exports[`.toBeTruthy(), .toBeFalsy() 'null' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - null" + null" `; exports[`.toBeTruthy(), .toBeFalsy() 'null' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - null" + null" `; exports[`.toBeTruthy(), .toBeFalsy() 'true' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - true" + true" `; exports[`.toBeTruthy(), .toBeFalsy() 'true' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - true" + true" `; exports[`.toBeTruthy(), .toBeFalsy() 'undefined' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - undefined" + undefined" `; exports[`.toBeTruthy(), .toBeFalsy() 'undefined' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - undefined" + undefined" `; exports[`.toBeTruthy(), .toBeFalsy() does not accept arguments 1`] = ` -"expect(received)[.not].toBeTruthy() +"expect(received)[.not].toBeTruthy() Matcher does not accept any arguments. -Got: null" +Got: null" `; exports[`.toBeTruthy(), .toBeFalsy() does not accept arguments 2`] = ` -"expect(received)[.not].toBeFalsy() +"expect(received)[.not].toBeFalsy() Matcher does not accept any arguments. -Got: null" +Got: null" `; exports[`.toContain(), .toContainEqual() '"11112111"' contains '"2"' 1`] = ` -"expect(string).not.toContain(value) +"expect(string).not.toContain(value) Expected string: - \\"11112111\\" + \\"11112111\\" Not to contain value: - \\"2\\" + \\"2\\" " `; exports[`.toContain(), .toContainEqual() '"abcdef"' contains '"abc"' 1`] = ` -"expect(string).not.toContain(value) +"expect(string).not.toContain(value) Expected string: - \\"abcdef\\" + \\"abcdef\\" Not to contain value: - \\"abc\\" + \\"abc\\" " `; exports[`.toContain(), .toContainEqual() '["a", "b", "c", "d"]' contains '"a"' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] Not to contain value: - \\"a\\" + \\"a\\" " `; exports[`.toContain(), .toContainEqual() '["a", "b", "c", "d"]' contains a value equal to '"a"' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] Not to contain a value equal to: - \\"a\\" + \\"a\\" " `; exports[`.toContain(), .toContainEqual() '[{"a": "b"}, {"a": "c"}]' contains a value equal to '{"a": "b"}' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] + [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] Not to contain a value equal to: - {\\"a\\": \\"b\\"} + {\\"a\\": \\"b\\"} " `; exports[`.toContain(), .toContainEqual() '[{"a": "b"}, {"a": "c"}]' does not contain a value equal to'{"a": "d"}' 1`] = ` -"expect(array).toContainEqual(value) +"expect(array).toContainEqual(value) Expected array: - [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] + [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] To contain a value equal to: - {\\"a\\": \\"d\\"}" + {\\"a\\": \\"d\\"}" `; exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '[]' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [{}, []] + [{}, []] To contain value: - []" + []" `; exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '{}' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [{}, []] + [{}, []] To contain value: - {}" + {}" `; exports[`.toContain(), .toContainEqual() '[0, 1]' contains '1' 1`] = ` -"expect(object).not.toContain(value) +"expect(object).not.toContain(value) Expected object: - [0, 1] + [0, 1] Not to contain value: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[0, 1]' contains a value equal to '1' 1`] = ` -"expect(object).not.toContainEqual(value) +"expect(object).not.toContainEqual(value) Expected object: - [0, 1] + [0, 1] Not to contain a value equal to: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[1, 2, 3, 4]' contains '1' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [1, 2, 3, 4] + [1, 2, 3, 4] Not to contain value: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[1, 2, 3, 4]' contains a value equal to '1' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [1, 2, 3, 4] + [1, 2, 3, 4] Not to contain a value equal to: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[1, 2, 3]' does not contain '4' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [1, 2, 3] + [1, 2, 3] To contain value: - 4" + 4" `; exports[`.toContain(), .toContainEqual() '[Symbol(a)]' contains 'Symbol(a)' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [Symbol(a)] + [Symbol(a)] Not to contain value: - Symbol(a) + Symbol(a) " `; exports[`.toContain(), .toContainEqual() '[Symbol(a)]' contains a value equal to 'Symbol(a)' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [Symbol(a)] + [Symbol(a)] Not to contain a value equal to: - Symbol(a) + Symbol(a) " `; exports[`.toContain(), .toContainEqual() '[null, undefined]' does not contain '1' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [null, undefined] + [null, undefined] To contain value: - 1" + 1" `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains 'null' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [undefined, null] + [undefined, null] Not to contain value: - null + null " `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains 'undefined' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [undefined, null] + [undefined, null] Not to contain value: - undefined + undefined " `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains a value equal to 'null' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [undefined, null] + [undefined, null] Not to contain a value equal to: - null + null " `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains a value equal to 'undefined' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [undefined, null] + [undefined, null] Not to contain a value equal to: - undefined + undefined " `; exports[`.toContain(), .toContainEqual() 'Set {"abc", "def"}' contains '"abc"' 1`] = ` -"expect(set).not.toContain(value) +"expect(set).not.toContain(value) Expected set: - Set {\\"abc\\", \\"def\\"} + Set {\\"abc\\", \\"def\\"} Not to contain value: - \\"abc\\" + \\"abc\\" " `; exports[`.toContain(), .toContainEqual() 'Set {1, 2, 3, 4}' contains a value equal to '1' 1`] = ` -"expect(set).not.toContainEqual(value) +"expect(set).not.toContainEqual(value) Expected set: - Set {1, 2, 3, 4} + Set {1, 2, 3, 4} Not to contain a value equal to: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() error cases 1`] = ` -"expect(collection)[.not].toContainEqual(value) +"expect(collection)[.not].toContainEqual(value) -Expected collection to be an array-like structure. -Received: null" +Expected collection to be an array-like structure. +Received: null" `; exports[`.toContain(), .toContainEqual() error cases for toContainEqual 1`] = ` -"expect(collection)[.not].toContainEqual(value) +"expect(collection)[.not].toContainEqual(value) -Expected collection to be an array-like structure. -Received: null" +Expected collection to be an array-like structure. +Received: null" `; exports[`.toEqual() {pass: false} expect("Alice").not.toEqual({"asymmetricMatch": [Function asymmetricMatch]}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {\\"asymmetricMatch\\": [Function asymmetricMatch]} + {\\"asymmetricMatch\\": [Function asymmetricMatch]} Received: - \\"Alice\\"" + \\"Alice\\"" `; exports[`.toEqual() {pass: false} expect("Eve").toEqual({"asymmetricMatch": [Function asymmetricMatch]}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - {\\"asymmetricMatch\\": [Function asymmetricMatch]} + {\\"asymmetricMatch\\": [Function asymmetricMatch]} Received: - \\"Eve\\"" + \\"Eve\\"" `; exports[`.toEqual() {pass: false} expect("abc").not.toEqual("abc") 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - \\"abc\\" + \\"abc\\" Received: - \\"abc\\"" + \\"abc\\"" `; exports[`.toEqual() {pass: false} expect("abcd").not.toEqual(StringContaining "bc") 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - StringContaining \\"bc\\" + StringContaining \\"bc\\" Received: - \\"abcd\\"" + \\"abcd\\"" `; exports[`.toEqual() {pass: false} expect("abcd").not.toEqual(StringMatching /bc/) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - StringMatching /bc/ + StringMatching /bc/ Received: - \\"abcd\\"" + \\"abcd\\"" `; exports[`.toEqual() {pass: false} expect("abd").toEqual(StringContaining "bc") 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - StringContaining \\"bc\\" + StringContaining \\"bc\\" Received: - \\"abd\\"" + \\"abd\\"" `; exports[`.toEqual() {pass: false} expect("abd").toEqual(StringMatching /bc/i) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - StringMatching /bc/i + StringMatching /bc/i Received: - \\"abd\\"" + \\"abd\\"" `; exports[`.toEqual() {pass: false} expect("banana").toEqual("apple") 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - \\"apple\\" + \\"apple\\" Received: - \\"banana\\"" + \\"banana\\"" `; exports[`.toEqual() {pass: false} expect([1, 2, 3]).not.toEqual(ArrayContaining [2, 3]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - ArrayContaining [2, 3] + ArrayContaining [2, 3] Received: - [1, 2, 3]" + [1, 2, 3]" `; exports[`.toEqual() {pass: false} expect([1, 2]).not.toEqual([1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - [1, 2] + [1, 2] Received: - [1, 2]" + [1, 2]" `; exports[`.toEqual() {pass: false} expect([1, 2]).toEqual([2, 1]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - [2, 1] + [2, 1] Received: - [1, 2] + [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - Array [ -+ 1, - 2, -- 1, - ]" + Array [ ++ 1, + 2, +- 1, + ]" `; exports[`.toEqual() {pass: false} expect([1, 3]).toEqual(ArrayContaining [1, 2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ArrayContaining [1, 2] + ArrayContaining [1, 2] Received: - [1, 3] + [1, 3] Difference: -- Expected -+ Received +- Expected ++ Received -- ArrayContaining [ -+ Array [ - 1, -- 2, -+ 3, - ]" +- ArrayContaining [ ++ Array [ + 1, +- 2, ++ 3, + ]" `; exports[`.toEqual() {pass: false} expect([1]).not.toEqual([1]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - [1] + [1] Received: - [1]" + [1]" `; exports[`.toEqual() {pass: false} expect([1]).toEqual([2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - [2] + [2] Received: - [1] + [1] Difference: -- Expected -+ Received +- Expected ++ Received - Array [ -- 2, -+ 1, - ]" + Array [ +- 2, ++ 1, + ]" `; exports[`.toEqual() {pass: false} expect([Function anonymous]).not.toEqual(Any) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Any + Any Received: - [Function anonymous]" + [Function anonymous]" `; exports[`.toEqual() {pass: false} expect({"a": 1, "b": [Function b], "c": true}).not.toEqual({"a": 1, "b": Any, "c": Anything}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {\\"a\\": 1, \\"b\\": Any, \\"c\\": Anything} + {\\"a\\": 1, \\"b\\": Any, \\"c\\": Anything} Received: - {\\"a\\": 1, \\"b\\": [Function b], \\"c\\": true}" + {\\"a\\": 1, \\"b\\": [Function b], \\"c\\": true}" `; exports[`.toEqual() {pass: false} expect({"a": 1, "b": 2}).not.toEqual(ObjectContaining {"a": 1}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - ObjectContaining {\\"a\\": 1} + ObjectContaining {\\"a\\": 1} Received: - {\\"a\\": 1, \\"b\\": 2}" + {\\"a\\": 1, \\"b\\": 2}" `; exports[`.toEqual() {pass: false} expect({"a": 1, "b": 2}).toEqual(ObjectContaining {"a": 2}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ObjectContaining {\\"a\\": 2} + ObjectContaining {\\"a\\": 2} Received: - {\\"a\\": 1, \\"b\\": 2} + {\\"a\\": 1, \\"b\\": 2} Difference: -- Expected -+ Received +- Expected ++ Received -- ObjectContaining { -- \\"a\\": 2, -+ Object { -+ \\"a\\": 1, -+ \\"b\\": 2, - }" +- ObjectContaining { +- \\"a\\": 2, ++ Object { ++ \\"a\\": 1, ++ \\"b\\": 2, + }" `; exports[`.toEqual() {pass: false} expect({"a": 5}).toEqual({"b": 6}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - {\\"b\\": 6} + {\\"b\\": 6} Received: - {\\"a\\": 5} + {\\"a\\": 5} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"b\\": 6, -+ \\"a\\": 5, - }" + Object { +- \\"b\\": 6, ++ \\"a\\": 5, + }" `; exports[`.toEqual() {pass: false} expect({"a": 99}).not.toEqual({"a": 99}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {\\"a\\": 99} + {\\"a\\": 99} Received: - {\\"a\\": 99}" + {\\"a\\": 99}" `; exports[`.toEqual() {pass: false} expect({}).not.toEqual({}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {} + {} Received: - {}" + {}" `; exports[`.toEqual() {pass: false} expect(0).toEqual(-0) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - -0 + -0 Received: - 0 + 0 Difference: -Compared values have no visual difference." +Compared values have no visual difference." `; exports[`.toEqual() {pass: false} expect(1).not.toEqual(1) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - 1 + 1 Received: - 1" + 1" `; exports[`.toEqual() {pass: false} expect(1).toEqual(2) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - 2 + 2 Received: - 1" + 1" `; exports[`.toEqual() {pass: false} expect(1).toEqual(ArrayContaining [1, 2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ArrayContaining [1, 2] + ArrayContaining [1, 2] Received: - 1 + 1 Difference: - Comparing two different types of values. Expected array but received number." + Comparing two different types of values. Expected array but received number." `; exports[`.toEqual() {pass: false} expect(Immutable.List [1, 2]).not.toEqual(Immutable.List [1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.List [1, 2] + Immutable.List [1, 2] Received: - Immutable.List [1, 2]" + Immutable.List [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.List [1, 2]).toEqual(Immutable.List [2, 1]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.List [2, 1] + Immutable.List [2, 1] Received: - Immutable.List [1, 2] + Immutable.List [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.List [ -+ 1, - 2, -- 1, - ]" + Immutable.List [ ++ 1, + 2, +- 1, + ]" `; exports[`.toEqual() {pass: false} expect(Immutable.List [1]).not.toEqual(Immutable.List [1]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.List [1] + Immutable.List [1] Received: - Immutable.List [1]" + Immutable.List [1]" `; exports[`.toEqual() {pass: false} expect(Immutable.List [1]).toEqual(Immutable.List [2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.List [2] + Immutable.List [2] Received: - Immutable.List [1] + Immutable.List [1] Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.List [ -- 2, -+ 1, - ]" + Immutable.List [ +- 2, ++ 1, + ]" `; exports[`.toEqual() {pass: false} 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) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} Received: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}}" + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}}" `; 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 11}}} + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 11}}} Received: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Map {\\"b\\": 0} + Immutable.Map {\\"b\\": 0} Received: - Immutable.Map {\\"a\\": 0} + Immutable.Map {\\"a\\": 0} Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Map {\\"v\\": 2} + Immutable.Map {\\"v\\": 2} Received: - Immutable.Map {\\"v\\": 1} + Immutable.Map {\\"v\\": 1} Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.Map { -- \\"v\\": 2, -+ \\"v\\": 1, - }" + Immutable.Map { +- \\"v\\": 2, ++ \\"v\\": 1, + }" `; exports[`.toEqual() {pass: false} expect(Immutable.Map {}).not.toEqual(Immutable.Map {}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {} + Immutable.Map {} Received: - Immutable.Map {}" + Immutable.Map {}" `; exports[`.toEqual() {pass: false} expect(Immutable.Map {1: "one", 2: "two"}).not.toEqual(Immutable.Map {1: "one", 2: "two"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {1: \\"one\\", 2: \\"two\\"} + Immutable.Map {1: \\"one\\", 2: \\"two\\"} Received: - Immutable.Map {1: \\"one\\", 2: \\"two\\"}" + Immutable.Map {1: \\"one\\", 2: \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Immutable.Map {1: "one", 2: "two"}).not.toEqual(Immutable.Map {2: "two", 1: "one"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {2: \\"two\\", 1: \\"one\\"} + Immutable.Map {2: \\"two\\", 1: \\"one\\"} Received: - Immutable.Map {1: \\"one\\", 2: \\"two\\"}" + Immutable.Map {1: \\"one\\", 2: \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedMap {1: "one", 2: "two"}).not.toEqual(Immutable.OrderedMap {1: "one", 2: "two"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} + Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} Received: - Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"}" + Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedMap {1: "one", 2: "two"}).toEqual(Immutable.OrderedMap {2: "two", 1: "one"}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.OrderedMap {2: \\"two\\", 1: \\"one\\"} + Immutable.OrderedMap {2: \\"two\\", 1: \\"one\\"} Received: - Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} + Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.OrderedMap { -+ 1: \\"one\\", - 2: \\"two\\", -- 1: \\"one\\", - }" + Immutable.OrderedMap { ++ 1: \\"one\\", + 2: \\"two\\", +- 1: \\"one\\", + }" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedSet []).not.toEqual(Immutable.OrderedSet []) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.OrderedSet [] + Immutable.OrderedSet [] Received: - Immutable.OrderedSet []" + Immutable.OrderedSet []" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedSet [1, 2]).not.toEqual(Immutable.OrderedSet [1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.OrderedSet [1, 2] + Immutable.OrderedSet [1, 2] Received: - Immutable.OrderedSet [1, 2]" + Immutable.OrderedSet [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedSet [1, 2]).toEqual(Immutable.OrderedSet [2, 1]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.OrderedSet [2, 1] + Immutable.OrderedSet [2, 1] Received: - Immutable.OrderedSet [1, 2] + Immutable.OrderedSet [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.OrderedSet [ -+ 1, - 2, -- 1, - ]" + Immutable.OrderedSet [ ++ 1, + 2, +- 1, + ]" `; exports[`.toEqual() {pass: false} expect(Immutable.Set []).not.toEqual(Immutable.Set []) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Set [] + Immutable.Set [] Received: - Immutable.Set []" + Immutable.Set []" `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).not.toEqual(Immutable.Set [1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Set [1, 2] + Immutable.Set [1, 2] Received: - Immutable.Set [1, 2]" + Immutable.Set [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).not.toEqual(Immutable.Set [2, 1]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Set [2, 1] + Immutable.Set [2, 1] Received: - Immutable.Set [1, 2]" + Immutable.Set [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).toEqual(Immutable.Set []) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Set [] + Immutable.Set [] Received: - Immutable.Set [1, 2] + Immutable.Set [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received -- 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Set [1, 2, 3] + Immutable.Set [1, 2, 3] Received: - Immutable.Set [1, 2] + Immutable.Set [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Map {\\"b\\" => 0} + Map {\\"b\\" => 0} Received: - Map {\\"a\\" => 0} + Map {\\"a\\" => 0} Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Map {\\"v\\" => 2} + Map {\\"v\\" => 2} Received: - Map {\\"v\\" => 1} + Map {\\"v\\" => 1} Difference: -- Expected -+ Received +- Expected ++ Received - Map { -- \\"v\\" => 2, -+ \\"v\\" => 1, - }" + Map { +- \\"v\\" => 2, ++ \\"v\\" => 1, + }" `; exports[`.toEqual() {pass: false} expect(Map {}).not.toEqual(Map {}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Map {} + Map {} Received: - Map {}" + Map {}" `; exports[`.toEqual() {pass: false} expect(Map {}).toEqual(Set {}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Set {} + Set {} Received: - Map {} + Map {} Difference: - Comparing two different types of values. Expected set but received map." + Comparing two different types of values. Expected set but received map." `; exports[`.toEqual() {pass: false} expect(Map {1 => "one", 2 => "two"}).not.toEqual(Map {1 => "one", 2 => "two"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Map {1 => \\"one\\", 2 => \\"two\\"} + Map {1 => \\"one\\", 2 => \\"two\\"} Received: - Map {1 => \\"one\\", 2 => \\"two\\"}" + Map {1 => \\"one\\", 2 => \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Map {1 => "one", 2 => "two"}).not.toEqual(Map {2 => "two", 1 => "one"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Map {2 => \\"two\\", 1 => \\"one\\"} + Map {2 => \\"two\\", 1 => \\"one\\"} Received: - Map {1 => \\"one\\", 2 => \\"two\\"}" + Map {1 => \\"one\\", 2 => \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Map {1 => "one", 2 => "two"}).toEqual(Map {1 => "one"}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Map {1 => \\"one\\"} + Map {1 => \\"one\\"} Received: - Map {1 => \\"one\\", 2 => \\"two\\"} + Map {1 => \\"one\\", 2 => \\"two\\"} Difference: -- Expected -+ Received +- Expected ++ Received - Map { - 1 => \\"one\\", -+ 2 => \\"two\\", - }" + Map { + 1 => \\"one\\", ++ 2 => \\"two\\", + }" `; exports[`.toEqual() {pass: false} expect(Set {}).not.toEqual(Set {}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Set {} + Set {} Received: - Set {}" + Set {}" `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).not.toEqual(Set {1, 2}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Set {1, 2} + Set {1, 2} Received: - Set {1, 2}" + Set {1, 2}" `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).not.toEqual(Set {2, 1}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Set {2, 1} + Set {2, 1} Received: - Set {1, 2}" + Set {1, 2}" `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).toEqual(Set {}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Set {} + Set {} Received: - Set {1, 2} + Set {1, 2} Difference: -- Expected -+ Received +- Expected ++ Received -- 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) +"expect(received).toEqual(expected) Expected value to equal: - Set {1, 2, 3} + Set {1, 2, 3} Received: - Set {1, 2} + Set {1, 2} Difference: -- Expected -+ Received +- Expected ++ Received - Set { - 1, - 2, -- 3, - }" + Set { + 1, + 2, +- 3, + }" `; exports[`.toEqual() {pass: false} expect(false).toEqual(ObjectContaining {"a": 2}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ObjectContaining {\\"a\\": 2} + ObjectContaining {\\"a\\": 2} Received: - false + false Difference: - Comparing two different types of values. Expected object but received boolean." + Comparing two different types of values. Expected object but received boolean." `; exports[`.toEqual() {pass: false} expect(null).toEqual(undefined) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - undefined + undefined Received: - null + null Difference: - Comparing two different types of values. Expected undefined but received null." + Comparing two different types of values. Expected undefined but received null." `; exports[`.toEqual() {pass: false} expect(true).not.toEqual(Anything) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Anything + Anything Received: - true" + true" `; exports[`.toEqual() {pass: false} expect(true).not.toEqual(true) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - true + true Received: - true" + true" `; exports[`.toEqual() {pass: false} expect(true).toEqual(false) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - false + false Received: - true" + true" `; exports[`.toEqual() {pass: false} expect(undefined).toEqual(Any) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Any + Any Received: - undefined + undefined Difference: - Comparing two different types of values. Expected function but received undefined." + Comparing two different types of values. Expected function but received undefined." `; exports[`.toEqual() {pass: false} expect(undefined).toEqual(Anything) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Anything + Anything Received: - undefined" + undefined" `; exports[`.toHaveLength {pass: false} expect("").toHaveLength(1) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 1 + 1 Received: - \\"\\" + \\"\\" received.length: - 0" + 0" `; exports[`.toHaveLength {pass: false} expect("abc").toHaveLength(66) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 66 + 66 Received: - \\"abc\\" + \\"abc\\" received.length: - 3" + 3" `; exports[`.toHaveLength {pass: false} expect(["a", "b"]).toHaveLength(99) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 99 + 99 Received: - [\\"a\\", \\"b\\"] + [\\"a\\", \\"b\\"] received.length: - 2" + 2" `; exports[`.toHaveLength {pass: false} expect([]).toHaveLength(1) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 1 + 1 Received: - [] + [] received.length: - 0" + 0" `; exports[`.toHaveLength {pass: false} expect([1, 2]).toHaveLength(3) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 3 + 3 Received: - [1, 2] + [1, 2] received.length: - 2" + 2" `; exports[`.toHaveLength {pass: true} expect("").toHaveLength(0) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 0 + 0 Received: - \\"\\" + \\"\\" received.length: - 0" + 0" `; exports[`.toHaveLength {pass: true} expect("abc").toHaveLength(3) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 3 + 3 Received: - \\"abc\\" + \\"abc\\" received.length: - 3" + 3" `; exports[`.toHaveLength {pass: true} expect(["a", "b"]).toHaveLength(2) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 2 + 2 Received: - [\\"a\\", \\"b\\"] + [\\"a\\", \\"b\\"] received.length: - 2" + 2" `; exports[`.toHaveLength {pass: true} expect([]).toHaveLength(0) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 0 + 0 Received: - [] + [] received.length: - 0" + 0" `; exports[`.toHaveLength {pass: true} expect([1, 2]).toHaveLength(2) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 2 + 2 Received: - [1, 2] + [1, 2] received.length: - 2" + 2" `; exports[`.toHaveLength error cases 1`] = ` -"expect(received)[.not].toHaveLength(length) +"expect(received)[.not].toHaveLength(length) Expected value to have a 'length' property that is a number. Received: - {\\"a\\": 9} + {\\"a\\": 9} received.length: - undefined" + undefined" `; exports[`.toHaveLength error cases 2`] = ` -"expect(received)[.not].toHaveLength(length) +"expect(received)[.not].toHaveLength(length) Expected value to have a 'length' property that is a number. Received: - 0 + 0 " `; exports[`.toHaveLength error cases 3`] = ` -"expect(received)[.not].toHaveLength(length) +"expect(received)[.not].toHaveLength(length) Expected value to have a 'length' property that is a number. Received: - undefined + undefined " `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('1') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected path to be a string or an array. Received: - number: 1" +Expected path to be a string or an array. Received: + number: 1" `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('null') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected path to be a string or an array. Received: - null: null" +Expected path to be a string or an array. Received: + null: null" `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('undefined') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected path to be a string or an array. Received: - undefined: undefined" +Expected path to be a string or an array. Received: + undefined: undefined" `; exports[`.toHaveProperty() {error} expect(null).toHaveProperty('a.b') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected object to be an object. Received: - null: null" +Expected object to be an object. Received: + null: null" `; exports[`.toHaveProperty() {error} expect(undefined).toHaveProperty('a') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected object to be an object. Received: - undefined: undefined" +Expected object to be an object. Received: + undefined: undefined" `; exports[`.toHaveProperty() {pass: false} expect("abc").toHaveProperty('a.b.c') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - \\"abc\\" + \\"abc\\" To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" " `; exports[`.toHaveProperty() {pass: false} expect("abc").toHaveProperty('a.b.c', {"a": 5}) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - \\"abc\\" + \\"abc\\" To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" With a value of: - {\\"a\\": 5} + {\\"a\\": 5} " `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d', 2) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} To have a nested property: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] With a value of: - 2 + 2 Received: - 1" + 1" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d', 2) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 2 + 2 Received: - 1" + 1" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.ttt.d', 1) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} To have a nested property: - \\"a.b.ttt.d\\" + \\"a.b.ttt.d\\" With a value of: - 1 + 1 Received: - object.a.b: {\\"c\\": {\\"d\\": 1}}" + object.a.b: {\\"c\\": {\\"d\\": 1}}" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {}}}} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" Received: - object.a.b.c: {}" + object.a.b.c: {}" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('a.b.c.d', 1) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {}}}} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 1 + 1 Received: - object.a.b.c: {}" + object.a.b.c: {}" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": 5}}}).toHaveProperty('a.b', {"c": 4}) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": 5}}} + {\\"a\\": {\\"b\\": {\\"c\\": 5}}} To have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - {\\"c\\": 4} + {\\"c\\": 4} Received: - {\\"c\\": 5} + {\\"c\\": 5} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"c\\": 4, -+ \\"c\\": 5, - }" + Object { +- \\"c\\": 4, ++ \\"c\\": 5, + }" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": 3}}).toHaveProperty('a.b', undefined) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": 3}} + {\\"a\\": {\\"b\\": 3}} To have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - undefined + undefined Received: - 3 + 3 Difference: - Comparing two different types of values. Expected undefined but received number." + Comparing two different types of values. Expected undefined but received number." `; exports[`.toHaveProperty() {pass: false} expect({"a": 1}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - {\\"a\\": 1} + {\\"a\\": 1} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" Received: - object.a: 1" + object.a: 1" `; exports[`.toHaveProperty() {pass: false} expect({"a": 1}).toHaveProperty('a.b.c.d', 5) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": 1} + {\\"a\\": 1} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 5 + 5 Received: - object.a: 1" + object.a: 1" `; exports[`.toHaveProperty() {pass: false} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 2) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 2 + 2 " `; exports[`.toHaveProperty() {pass: false} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 2) 2`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} To have a nested property: - [\\"a.b.c.d\\"] + [\\"a.b.c.d\\"] With a value of: - 2 + 2 Received: - 1" + 1" `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - {} + {} To have a nested property: - \\"a\\" + \\"a\\" " `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a', "a") 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {} + {} To have a nested property: - \\"a\\" + \\"a\\" With a value of: - \\"a\\" + \\"a\\" Received: - undefined + undefined Difference: - Comparing two different types of values. Expected string but received undefined." + Comparing two different types of values. Expected string but received undefined." `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a', "test") 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {} + {} To have a nested property: - \\"a\\" + \\"a\\" With a value of: - \\"test\\" + \\"test\\" " `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('b', undefined) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {} + {} To have a nested property: - \\"b\\" + \\"b\\" With a value of: - undefined + undefined Received: - \\"b\\" + \\"b\\" Difference: - Comparing two different types of values. Expected undefined but received string." + Comparing two different types of values. Expected undefined but received string." `; exports[`.toHaveProperty() {pass: false} expect(1).toHaveProperty('a.b.c') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - 1 + 1 To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" " `; exports[`.toHaveProperty() {pass: false} expect(1).toHaveProperty('a.b.c', "test") 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - 1 + 1 To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" With a value of: - \\"test\\" + \\"test\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": [1, 2, 3]}} + {\\"a\\": {\\"b\\": [1, 2, 3]}} Not to have a nested property: - [\\"a\\", \\"b\\", 1] + [\\"a\\", \\"b\\", 1] " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1', 2) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": [1, 2, 3]}} + {\\"a\\": {\\"b\\": [1, 2, 3]}} Not to have a nested property: - [\\"a\\", \\"b\\", 1] + [\\"a\\", \\"b\\", 1] With a value of: - 2 + 2 " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": 5}}}).toHaveProperty('a.b', {"c": 5}) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": 5}}} + {\\"a\\": {\\"b\\": {\\"c\\": 5}}} Not to have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - {\\"c\\": 5} + {\\"c\\": 5} " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": undefined}}).toHaveProperty('a.b') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": undefined}} + {\\"a\\": {\\"b\\": undefined}} Not to have a nested property: - \\"a.b\\" + \\"a.b\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": undefined}}).toHaveProperty('a.b', undefined) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": undefined}} + {\\"a\\": {\\"b\\": undefined}} Not to have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - undefined + undefined " `; exports[`.toHaveProperty() {pass: true} expect({"a": 0}).toHaveProperty('a') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": 0} + {\\"a\\": 0} Not to have a nested property: - \\"a\\" + \\"a\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": 0}).toHaveProperty('a', 0) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": 0} + {\\"a\\": 0} Not to have a nested property: - \\"a\\" + \\"a\\" With a value of: - 0 + 0 " `; exports[`.toHaveProperty() {pass: true} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} Not to have a nested property: - [\\"a.b.c.d\\"] + [\\"a.b.c.d\\"] " `; exports[`.toHaveProperty() {pass: true} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} Not to have a nested property: - [\\"a.b.c.d\\"] + [\\"a.b.c.d\\"] With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({"property": 1}).toHaveProperty('property', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"property\\": 1} + {\\"property\\": 1} Not to have a nested property: - \\"property\\" + \\"property\\" With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({}).toHaveProperty('a', undefined) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {} + {} Not to have a nested property: - \\"a\\" + \\"a\\" With a value of: - undefined + undefined " `; exports[`.toHaveProperty() {pass: true} expect({}).toHaveProperty('b', "b") 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {} + {} Not to have a nested property: - \\"b\\" + \\"b\\" With a value of: - \\"b\\" + \\"b\\" " `; exports[`.toMatch() {pass: true} expect(Foo bar).toMatch(/^foo/i) 1`] = ` -"expect(received).not.toMatch(expected) +"expect(received).not.toMatch(expected) Expected value not to match: - /^foo/i + /^foo/i Received: - \\"Foo bar\\"" + \\"Foo bar\\"" `; exports[`.toMatch() {pass: true} expect(foo).toMatch(foo) 1`] = ` -"expect(received).not.toMatch(expected) +"expect(received).not.toMatch(expected) Expected value not to match: - \\"foo\\" + \\"foo\\" Received: - \\"foo\\"" + \\"foo\\"" `; exports[`.toMatch() throws if non String actual value passed: [/foo/i, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - regexp: /foo/i" + regexp: /foo/i" `; exports[`.toMatch() throws if non String actual value passed: [[], "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - array: []" + array: []" `; exports[`.toMatch() throws if non String actual value passed: [[Function anonymous], "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.toMatch() throws if non String actual value passed: [{}, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - object: {}" + object: {}" `; exports[`.toMatch() throws if non String actual value passed: [1, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - number: 1" + number: 1" `; exports[`.toMatch() throws if non String actual value passed: [true, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - boolean: true" + boolean: true" `; exports[`.toMatch() throws if non String actual value passed: [undefined, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. -Received: undefined" +string value must be a string. +Received: undefined" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", []] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - array: []" + array: []" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", [Function anonymous]] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", {}] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - object: {}" + object: {}" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", 1] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - number: 1" + number: 1" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", true] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - boolean: true" + boolean: true" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", undefined] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. -Expected: undefined" +expected value must be a string or a regular expression. +Expected: undefined" `; exports[`.toMatch() throws: [bar, /foo/] 1`] = ` -"expect(received).toMatch(expected) +"expect(received).toMatch(expected) Expected value to match: - /foo/ + /foo/ Received: - \\"bar\\"" + \\"bar\\"" `; exports[`.toMatch() throws: [bar, foo] 1`] = ` -"expect(received).toMatch(expected) +"expect(received).toMatch(expected) Expected value to match: - \\"foo\\" + \\"foo\\" Received: - \\"bar\\"" + \\"bar\\"" `; exports[`toMatchObject() {pass: false} expect([0]).toMatchObject([-0]) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - [-0] + [-0] Received: - [0] + [0] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [1, 2, 2] + [1, 2, 2] Received: - [1, 2, 3] + [1, 2, 3] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [2, 3, 1] + [2, 3, 1] Received: - [1, 2, 3] + [1, 2, 3] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [1, 3] + [1, 3] Received: - [1, 2] + [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [Error: bar] + [Error: bar] Received: - [Error: foo] + [Error: foo] Difference: -- Expected -+ Received +- Expected ++ Received -- [Error: bar] -+ [Error: foo]" +- [Error: bar] ++ [Error: foo]" `; exports[`toMatchObject() {pass: false} expect({"a": "a", "c": "d"}).toMatchObject({"a": Any}) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - {\\"a\\": Any} + {\\"a\\": Any} Received: - {\\"a\\": \\"a\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"a\\", \\"c\\": \\"d\\"} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"a\\": Any, -+ \\"a\\": \\"a\\", - }" + Object { +- \\"a\\": Any, ++ \\"a\\": \\"a\\", + }" `; exports[`toMatchObject() {pass: false} expect({"a": "b", "c": "d"}).toMatchObject({"a": "b!", "c": "d"}) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - {\\"a\\": \\"b!\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b!\\", \\"c\\": \\"d\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"e\\": \\"b\\"} + {\\"e\\": \\"b\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": [3]}} + {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": [3]}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} + {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"t\\": {\\"l\\": {\\"r\\": \\"r\\"}}} + {\\"t\\": {\\"l\\": {\\"r\\": \\"r\\"}}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} + {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} Difference: -- Expected -+ Received +- Expected ++ Received - 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": [{"a": "a", "b": "b"}]}).toMatchObject({"a": [{"a": "c"}]}) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - {\\"a\\": [{\\"a\\": \\"c\\"}]} + {\\"a\\": [{\\"a\\": \\"c\\"}]} Received: - {\\"a\\": [{\\"a\\": \\"a\\", \\"b\\": \\"b\\"}]} + {\\"a\\": [{\\"a\\": \\"a\\", \\"b\\": \\"b\\"}]} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": [\\"v\\"]} + {\\"a\\": [\\"v\\"]} Received: - {\\"a\\": [3, 4, \\"v\\"], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, \\"v\\"], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": [3, 4, 5, 6]} + {\\"a\\": [3, 4, 5, 6]} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": [3, 4]} + {\\"a\\": [3, 4]} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": {\\"b\\": 4}} + {\\"a\\": {\\"b\\": 4}} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": {\\"b\\": Any}} + {\\"a\\": {\\"b\\": Any}} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"d\\": {\\"e\\": {\\"f\\": 222}}} + {\\"d\\": {\\"e\\": {\\"f\\": 222}}} Received: - {\\"a\\": 1, \\"b\\": 1, \\"c\\": 1, \\"d\\": {\\"e\\": {\\"f\\": 555}}} + {\\"a\\": 1, \\"b\\": 1, \\"c\\": 1, \\"d\\": {\\"e\\": {\\"f\\": 555}}} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": 2015-10-10T00:00:00.000Z} + {\\"a\\": 2015-10-10T00:00:00.000Z} Received: - {\\"a\\": 2015-11-30T00:00:00.000Z, \\"b\\": \\"b\\"} + {\\"a\\": 2015-11-30T00:00:00.000Z, \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": \\"4\\"} + {\\"a\\": \\"4\\"} Received: - {\\"a\\": null, \\"b\\": \\"b\\"} + {\\"a\\": null, \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {\\"a\\": null, \\"b\\": \\"b\\"} + {\\"a\\": null, \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": null} + {\\"a\\": null} Received: - {\\"a\\": undefined} + {\\"a\\": undefined} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {} + {} Difference: -- Expected -+ Received +- Expected ++ Received -- 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 value to match object: - 2015-10-10T00:00:00.000Z + 2015-10-10T00:00:00.000Z Received: - 2015-11-30T00:00:00.000Z + 2015-11-30T00:00:00.000Z Difference: -- Expected -+ Received +- Expected ++ Received -- 2015-10-10T00:00:00.000Z -+ 2015-11-30T00:00:00.000Z" +- 2015-10-10T00:00:00.000Z ++ 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 value to match object: - Set {2} + Set {2} Received: - Set {1, 2} + Set {1, 2} Difference: -- Expected -+ Received +- Expected ++ Received - Set { -+ 1, - 2, - }" + Set { ++ 1, + 2, + }" `; exports[`toMatchObject() {pass: true} expect([]).toMatchObject([]) 1`] = ` -"expect(received).not.toMatchObject(expected) +"expect(received).not.toMatchObject(expected) Expected value not to match object: - [] + [] Received: - []" + []" `; exports[`toMatchObject() {pass: true} expect([1, 2]).toMatchObject([1, 2]) 1`] = ` -"expect(received).not.toMatchObject(expected) +"expect(received).not.toMatchObject(expected) Expected value not to match object: - [1, 2] + [1, 2] Received: - [1, 2]" + [1, 2]" `; exports[`toMatchObject() {pass: true} expect([Error: foo]).toMatchObject([Error: foo]) 1`] = ` -"expect(received).not.toMatchObject(expected) +"expect(received).not.toMatchObject(expected) Expected value not to match object: - [Error: foo] + [Error: foo] Received: - [Error: foo]" + [Error: foo]" `; 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 value not to match object: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"}" + {\\"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 value not to match object: - {\\"a\\": \\"b\\"} + {\\"a\\": \\"b\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"}" + {\\"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 value not to match object: - {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": \\"z\\"}} + {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": \\"z\\"}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}}" + {\\"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 value not to match object: - {\\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}}} + {\\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}}" + {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}}" `; 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 value not to match object: - {\\"a\\": [{\\"a\\": \\"a\\"}]} + {\\"a\\": [{\\"a\\": \\"a\\"}]} Received: - {\\"a\\": [{\\"a\\": \\"a\\", \\"b\\": \\"b\\"}]}" + {\\"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 value not to match object: - {\\"a\\": [3, 4, 5, \\"v\\"]} + {\\"a\\": [3, 4, 5, \\"v\\"]} Received: - {\\"a\\": [3, 4, 5, \\"v\\"], \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": [3, 4, 5]} + {\\"a\\": [3, 4, 5]} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": {\\"x\\": Any}} + {\\"a\\": {\\"x\\": Any}} Received: - {\\"a\\": {\\"x\\": \\"x\\", \\"y\\": \\"y\\"}}" + {\\"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 value not to match object: - {\\"a\\": Any} + {\\"a\\": Any} Received: - {\\"a\\": 1, \\"c\\": 2}" + {\\"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 value not to match object: - {\\"a\\": 2015-11-30T00:00:00.000Z} + {\\"a\\": 2015-11-30T00:00:00.000Z} Received: - {\\"a\\": 2015-11-30T00:00:00.000Z, \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": null} + {\\"a\\": null} Received: - {\\"a\\": null, \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {\\"a\\": undefined, \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {\\"a\\": undefined}" + {\\"a\\": undefined}" `; 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 value not to match object: - 2015-11-30T00:00:00.000Z + 2015-11-30T00:00:00.000Z Received: - 2015-11-30T00:00:00.000Z" + 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 value not to match object: - Set {1, 2} + Set {1, 2} Received: - Set {1, 2}" + 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 value not to match object: - Set {2, 1} + Set {2, 1} Received: - Set {1, 2}" + Set {1, 2}" `; exports[`toMatchObject() throws expect("44").toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. +received value must be an object. Received: - string: \\"44\\"" + string: \\"44\\"" `; exports[`toMatchObject() throws expect({}).toMatchObject("some string") 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. +expected value must be an object. Expected: - string: \\"some string\\"" + string: \\"some string\\"" `; exports[`toMatchObject() throws expect({}).toMatchObject(4) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. +expected value must be an object. Expected: - number: 4" + number: 4" `; exports[`toMatchObject() throws expect({}).toMatchObject(null) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. -Expected: null" +expected value must be an object. +Expected: null" `; exports[`toMatchObject() throws expect({}).toMatchObject(true) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. +expected value must be an object. Expected: - boolean: true" + boolean: true" `; exports[`toMatchObject() throws expect({}).toMatchObject(undefined) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. -Expected: undefined" +expected value must be an object. +Expected: undefined" `; exports[`toMatchObject() throws expect(4).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. +received value must be an object. Received: - number: 4" + number: 4" `; exports[`toMatchObject() throws expect(null).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. -Received: null" +received value must be an object. +Received: null" `; exports[`toMatchObject() throws expect(true).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. +received value must be an object. Received: - boolean: true" + boolean: true" `; exports[`toMatchObject() throws expect(undefined).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. -Received: undefined" +received value must be an object. +Received: undefined" `; diff --git a/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap index 65e5ae9dd4bc..6c440a42ecab 100644 --- a/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap @@ -1,382 +1,382 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`lastCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].lastCalledWith() +"expect(jest.fn())[.not].lastCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`lastCalledWith works when not called 1`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - [\\"foo\\", \\"bar\\"] -But it was not called." + [\\"foo\\", \\"bar\\"] +But it was not called." `; exports[`lastCalledWith works with Immutable.js objects 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" + [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" `; exports[`lastCalledWith works with Map 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [Map {1 => 2, 2 => 1}]" + [Map {1 => 2, 2 => 1}]" `; exports[`lastCalledWith works with Map 2`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." + Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." `; exports[`lastCalledWith works with Set 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [Set {1, 2}]" + [Set {1, 2}]" `; exports[`lastCalledWith works with Set 2`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - Set {3, 4} as argument 1, but it was called with Set {1, 2}." + Set {3, 4} as argument 1, but it was called with Set {1, 2}." `; exports[`lastCalledWith works with arguments that don't match 1`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`lastCalledWith works with arguments that match 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`lastCalledWith works with many arguments 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`lastCalledWith works with many arguments that don't match 1`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar3\\"." + \\"bar\\" as argument 2, but it was called with \\"bar3\\"." `; exports[`toBeCalled works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toBeCalled() +"expect(jest.fn())[.not].toBeCalled() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toBeCalled works with jest.fn 1`] = ` -"expect(jest.fn()).toBeCalled() +"expect(jest.fn()).toBeCalled() Expected mock function to have been called." `; exports[`toBeCalled works with jest.fn 2`] = ` -"expect(jest.fn()).not.toBeCalled() +"expect(jest.fn()).not.toBeCalled() Expected mock function not to be called but it was called with: - []" + []" `; exports[`toBeCalled works with jest.fn 3`] = ` -"expect(received)[.not].toBeCalled() +"expect(received)[.not].toBeCalled() Matcher does not accept any arguments. Got: - number: 555" + number: 555" `; exports[`toBeCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toBeCalledWith() +"expect(jest.fn())[.not].toBeCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalled works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toHaveBeenCalled() +"expect(jest.fn())[.not].toHaveBeenCalled() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalled works with jest.fn 1`] = ` -"expect(jest.fn()).toHaveBeenCalled() +"expect(jest.fn()).toHaveBeenCalled() Expected mock function to have been called." `; exports[`toHaveBeenCalled works with jest.fn 2`] = ` -"expect(jest.fn()).not.toHaveBeenCalled() +"expect(jest.fn()).not.toHaveBeenCalled() Expected mock function not to be called but it was called with: - []" + []" `; exports[`toHaveBeenCalled works with jest.fn 3`] = ` -"expect(received)[.not].toHaveBeenCalled() +"expect(received)[.not].toHaveBeenCalled() Matcher does not accept any arguments. Got: - number: 555" + number: 555" `; exports[`toHaveBeenCalledTimes accepts only numbers 1`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - object: {}" + object: {}" `; exports[`toHaveBeenCalledTimes accepts only numbers 2`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - array: []" + array: []" `; exports[`toHaveBeenCalledTimes accepts only numbers 3`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - boolean: true" + boolean: true" `; exports[`toHaveBeenCalledTimes accepts only numbers 4`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - string: \\"a\\"" + string: \\"a\\"" `; exports[`toHaveBeenCalledTimes accepts only numbers 5`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - map: Map {}" + map: Map {}" `; exports[`toHaveBeenCalledTimes accepts only numbers 6`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`toHaveBeenCalledTimes fails if function called less than expected times 1`] = ` -"expect(jest.fn()).toHaveBeenCalledTimes(2) +"expect(jest.fn()).toHaveBeenCalledTimes(2) -Expected mock function to have been called two times, but it was called one time." +Expected mock function to have been called two times, but it was called one time." `; exports[`toHaveBeenCalledTimes fails if function called more than expected times 1`] = ` -"expect(jest.fn()).toHaveBeenCalledTimes(2) +"expect(jest.fn()).toHaveBeenCalledTimes(2) -Expected mock function to have been called two times, but it was called three times." +Expected mock function to have been called two times, but it was called three times." `; exports[`toHaveBeenCalledTimes passes if function called equal to expected times 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledTimes(2) +"expect(jest.fn()).not.toHaveBeenCalledTimes(2) -Expected mock function not to be called two times, but it was called exactly two times." +Expected mock function not to be called two times, but it was called exactly two times." `; exports[`toHaveBeenCalledTimes verifies that actual is a Spy 1`] = ` -"expect(jest.fn())[.not].toHaveBeenCalledTimes() +"expect(jest.fn())[.not].toHaveBeenCalledTimes() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toHaveBeenCalledWith() +"expect(jest.fn())[.not].toHaveBeenCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalledWith works when not called 1`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - [\\"foo\\", \\"bar\\"] -But it was not called." + [\\"foo\\", \\"bar\\"] +But it was not called." `; exports[`toHaveBeenCalledWith works with Immutable.js objects 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" + [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" `; exports[`toHaveBeenCalledWith works with Map 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [Map {1 => 2, 2 => 1}]" + [Map {1 => 2, 2 => 1}]" `; exports[`toHaveBeenCalledWith works with Map 2`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." + Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." `; exports[`toHaveBeenCalledWith works with Set 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [Set {1, 2}]" + [Set {1, 2}]" `; exports[`toHaveBeenCalledWith works with Set 2`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - Set {3, 4} as argument 1, but it was called with Set {1, 2}." + Set {3, 4} as argument 1, but it was called with Set {1, 2}." `; exports[`toHaveBeenCalledWith works with arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`toHaveBeenCalledWith works with arguments that match 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenCalledWith works with many arguments 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenCalledWith works with many arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - \\"bar\\" as argument 2, but it was called with \\"bar3\\". + \\"bar\\" as argument 2, but it was called with \\"bar3\\". - \\"bar\\" as argument 2, but it was called with \\"bar2\\". + \\"bar\\" as argument 2, but it was called with \\"bar2\\". - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`toHaveBeenLastCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toHaveBeenLastCalledWith() +"expect(jest.fn())[.not].toHaveBeenLastCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenLastCalledWith works when not called 1`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - [\\"foo\\", \\"bar\\"] -But it was not called." + [\\"foo\\", \\"bar\\"] +But it was not called." `; exports[`toHaveBeenLastCalledWith works with Immutable.js objects 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" + [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" `; exports[`toHaveBeenLastCalledWith works with Map 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [Map {1 => 2, 2 => 1}]" + [Map {1 => 2, 2 => 1}]" `; exports[`toHaveBeenLastCalledWith works with Map 2`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." + Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." `; exports[`toHaveBeenLastCalledWith works with Set 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [Set {1, 2}]" + [Set {1, 2}]" `; exports[`toHaveBeenLastCalledWith works with Set 2`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - Set {3, 4} as argument 1, but it was called with Set {1, 2}." + Set {3, 4} as argument 1, but it was called with Set {1, 2}." `; exports[`toHaveBeenLastCalledWith works with arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`toHaveBeenLastCalledWith works with arguments that match 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenLastCalledWith works with many arguments 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenLastCalledWith works with many arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar3\\"." + \\"bar\\" as argument 2, but it was called with \\"bar3\\"." `; diff --git a/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap index 3c7fd01c7f58..33966504aec7 100644 --- a/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap @@ -1,199 +1,199 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`.toThrow() error class did not throw at all 1`] = ` -"expect(function).toThrow(type) +"expect(function).toThrow(type) Expected the function to throw an error of type: - \\"Err\\" + \\"Err\\" But it didn't throw anything." `; exports[`.toThrow() error class threw, but class did not match 1`] = ` -"expect(function).toThrow(type) +"expect(function).toThrow(type) Expected the function to throw an error of type: - \\"Err2\\" + \\"Err2\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() error class threw, but should not have 1`] = ` -"expect(function).not.toThrow(type) +"expect(function).not.toThrow(type) Expected the function not to throw an error of type: - \\"Err\\" + \\"Err\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() invalid actual 1`] = ` -"expect(function).toThrow(undefined) +"expect(function).toThrow(undefined) Received value must be a function, but instead \\"string\\" was found" `; exports[`.toThrow() invalid arguments 1`] = ` -"expect(function).not.toThrow(number) +"expect(function).not.toThrow(number) Unexpected argument passed. -Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". +Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". Got: - string: \\"111\\"" + string: \\"111\\"" `; exports[`.toThrow() regexp did not throw at all 1`] = ` -"expect(function).toThrow(regexp) +"expect(function).toThrow(regexp) Expected the function to throw an error matching: - /apple/ + /apple/ But it didn't throw anything." `; exports[`.toThrow() regexp threw, but message did not match 1`] = ` -"expect(function).toThrow(regexp) +"expect(function).toThrow(regexp) Expected the function to throw an error matching: - /banana/ + /banana/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() regexp threw, but should not have 1`] = ` -"expect(function).not.toThrow(regexp) +"expect(function).not.toThrow(regexp) Expected the function not to throw an error matching: - /apple/ + /apple/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() strings did not throw at all 1`] = ` -"expect(function).toThrow(string) +"expect(function).toThrow(string) Expected the function to throw an error matching: - \\"apple\\" + \\"apple\\" But it didn't throw anything." `; exports[`.toThrow() strings threw, but message did not match 1`] = ` -"expect(function).toThrow(string) +"expect(function).toThrow(string) Expected the function to throw an error matching: - \\"banana\\" + \\"banana\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() strings threw, but should not have 1`] = ` -"expect(function).not.toThrow(string) +"expect(function).not.toThrow(string) Expected the function not to throw an error matching: - \\"apple\\" + \\"apple\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() error class did not throw at all 1`] = ` -"expect(function).toThrowError(type) +"expect(function).toThrowError(type) Expected the function to throw an error of type: - \\"Err\\" + \\"Err\\" But it didn't throw anything." `; exports[`.toThrowError() error class threw, but class did not match 1`] = ` -"expect(function).toThrowError(type) +"expect(function).toThrowError(type) Expected the function to throw an error of type: - \\"Err2\\" + \\"Err2\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() error class threw, but should not have 1`] = ` -"expect(function).not.toThrowError(type) +"expect(function).not.toThrowError(type) Expected the function not to throw an error of type: - \\"Err\\" + \\"Err\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() invalid actual 1`] = ` -"expect(function).toThrowError(undefined) +"expect(function).toThrowError(undefined) Received value must be a function, but instead \\"string\\" was found" `; exports[`.toThrowError() invalid arguments 1`] = ` -"expect(function).not.toThrowError(number) +"expect(function).not.toThrowError(number) Unexpected argument passed. -Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". +Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". Got: - string: \\"111\\"" + string: \\"111\\"" `; exports[`.toThrowError() regexp did not throw at all 1`] = ` -"expect(function).toThrowError(regexp) +"expect(function).toThrowError(regexp) Expected the function to throw an error matching: - /apple/ + /apple/ But it didn't throw anything." `; exports[`.toThrowError() regexp threw, but message did not match 1`] = ` -"expect(function).toThrowError(regexp) +"expect(function).toThrowError(regexp) Expected the function to throw an error matching: - /banana/ + /banana/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() regexp threw, but should not have 1`] = ` -"expect(function).not.toThrowError(regexp) +"expect(function).not.toThrowError(regexp) Expected the function not to throw an error matching: - /apple/ + /apple/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() strings did not throw at all 1`] = ` -"expect(function).toThrowError(string) +"expect(function).toThrowError(string) Expected the function to throw an error matching: - \\"apple\\" + \\"apple\\" But it didn't throw anything." `; exports[`.toThrowError() strings threw, but message did not match 1`] = ` -"expect(function).toThrowError(string) +"expect(function).toThrowError(string) Expected the function to throw an error matching: - \\"banana\\" + \\"banana\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() strings threw, but should not have 1`] = ` -"expect(function).not.toThrowError(string) +"expect(function).not.toThrowError(string) Expected the function not to throw an error matching: - \\"apple\\" + \\"apple\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; diff --git a/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap b/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap index fd47bf1ef31f..57879e05ccdb 100644 --- a/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap +++ b/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap @@ -7,14 +7,14 @@ exports[`SnapshotInteractiveMode updateWithResults overlay handle progress UI 1` [MOCK - cursorUp] [MOCK - eraseDown] -Interactive Snapshot Progress - › 2 suites failed, 1 suite passed - -Watch Usage - › Press u to update failing snapshots for this test. - › Press s to skip the current test suite. - › Press q to quit Interactive Snapshot Update Mode. - › Press Enter to trigger a test run. +Interactive Snapshot Progress + › 2 suites failed, 1 suite passed + +Watch Usage + › Press u to update failing snapshots for this test. + › Press s to skip the current test suite. + › Press q to quit Interactive Snapshot Update Mode. + › Press Enter to trigger a test run. " `; @@ -23,13 +23,13 @@ exports[`SnapshotInteractiveMode updateWithResults with a test failure simply up [MOCK - cursorUp] [MOCK - eraseDown] -Interactive Snapshot Progress - › 1 suite failed +Interactive Snapshot Progress + › 1 suite failed -Watch Usage - › Press u to update failing snapshots for this test. - › Press q to quit Interactive Snapshot Update Mode. - › Press Enter to trigger a test run. +Watch Usage + › Press u to update failing snapshots for this test. + › Press q to quit Interactive Snapshot Update Mode. + › Press Enter to trigger a test run. " `; diff --git a/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap b/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap index 64210a3277f4..9051a1b9174d 100644 --- a/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap +++ b/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap @@ -1,27 +1,27 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 1`] = `"should⏎ name the ⏎function you at..."`; +exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 1`] = `"should⏎ name the ⏎function you at..."`; -exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 2`] = `"should⏎ name the ⏎function you at..."`; +exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 2`] = `"should⏎ name the ⏎function you at..."`; -exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 3`] = `"should⏎ name the ⏎function you at..."`; +exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 3`] = `"should⏎ name the ⏎function you at..."`; -exports[`for one line test name pattern in the middle test name with cutted tail and cutted highlighted pattern 1`] = `"should nam..."`; +exports[`for one line test name pattern in the middle test name with cutted tail and cutted highlighted pattern 1`] = `"should nam..."`; -exports[`for one line test name pattern in the middle test name with cutted tail and highlighted pattern 1`] = `"should name the functi..."`; +exports[`for one line test name pattern in the middle test name with cutted tail and highlighted pattern 1`] = `"should name the functi..."`; -exports[`for one line test name pattern in the middle test name with highlighted cutted 1`] = `"sho..."`; +exports[`for one line test name pattern in the middle test name with highlighted cutted 1`] = `"sho..."`; -exports[`for one line test name pattern in the middle test name with highlighted pattern returns 1`] = `"should name the function you attach"`; +exports[`for one line test name pattern in the middle test name with highlighted pattern returns 1`] = `"should name the function you attach"`; -exports[`for one line test name pattern in the tail returns test name with cutted tail and cutted highlighted pattern 1`] = `"should name the function you a..."`; +exports[`for one line test name pattern in the tail returns test name with cutted tail and cutted highlighted pattern 1`] = `"should name the function you a..."`; -exports[`for one line test name pattern in the tail returns test name with highlighted cutted 1`] = `"sho..."`; +exports[`for one line test name pattern in the tail returns test name with highlighted cutted 1`] = `"sho..."`; -exports[`for one line test name pattern in the tail returns test name with highlighted pattern 1`] = `"should name the function you attach"`; +exports[`for one line test name pattern in the tail returns test name with highlighted pattern 1`] = `"should name the function you attach"`; -exports[`for one line test name with pattern in the head returns test name with cutted tail and cutted highlighted pattern 1`] = `"shoul..."`; +exports[`for one line test name with pattern in the head returns test name with cutted tail and cutted highlighted pattern 1`] = `"shoul..."`; -exports[`for one line test name with pattern in the head returns test name with cutted tail and highlighted pattern 1`] = `"should name the function yo..."`; +exports[`for one line test name with pattern in the head returns test name with cutted tail and highlighted pattern 1`] = `"should name the function yo..."`; -exports[`for one line test name with pattern in the head returns test name with highlighted pattern 1`] = `"should name the function you attach"`; +exports[`for one line test name with pattern in the head returns test name with highlighted pattern 1`] = `"should name the function you attach"`; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap index 45a0d0760608..735c56ff9c78 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap @@ -2,23 +2,23 @@ exports[`Retrieves the snapshot status 1`] = ` Array [ - " › 1 snapshot written.", - " › 1 snapshot updated.", - " › 1 obsolete snapshot found.", - " - test suite with unchecked snapshot", - " › 1 snapshot test failed.", + " › 1 snapshot written.", + " › 1 snapshot updated.", + " › 1 obsolete snapshot found.", + " - test suite with unchecked snapshot", + " › 1 snapshot test failed.", ] `; exports[`Retrieves the snapshot status after a snapshot update 1`] = ` Array [ - " › 2 snapshots written.", - " › 2 snapshots updated.", - " › 2 obsolete snapshots removed.", - " - first test suite with unchecked snapshot", - " - second test suite with unchecked snapshot", - " › Obsolete snapshot file removed.", - " › 2 snapshot tests failed.", + " › 2 snapshots written.", + " › 2 snapshots updated.", + " › 2 obsolete snapshots removed.", + " - first test suite with unchecked snapshot", + " - second test suite with unchecked snapshot", + " › Obsolete snapshot file removed.", + " › 2 snapshot tests failed.", ] `; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap index ceb2aa87d21b..dafc55777837 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap @@ -2,39 +2,39 @@ exports[`creates a snapshot summary 1`] = ` Array [ - "Snapshot Summary", - " › 1 snapshot written in 1 test suite.", - " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", - " › 1 snapshot updated in 1 test suite.", - " › 1 obsolete snapshot file found, press --u to remove it.", - " › 1 obsolete snapshot found, press --u to remove it.", + "Snapshot Summary", + " › 1 snapshot written in 1 test suite.", + " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", + " › 1 snapshot updated in 1 test suite.", + " › 1 obsolete snapshot file found, press --u to remove it.", + " › 1 obsolete snapshot found, press --u to remove it.", ] `; exports[`creates a snapshot summary after an update 1`] = ` Array [ - "Snapshot Summary", - " › 1 snapshot written in 1 test suite.", - " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", - " › 1 snapshot updated in 1 test suite.", - " › 1 obsolete snapshot file removed.", - " › 1 obsolete snapshot removed.", + "Snapshot Summary", + " › 1 snapshot written in 1 test suite.", + " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", + " › 1 snapshot updated in 1 test suite.", + " › 1 obsolete snapshot file removed.", + " › 1 obsolete snapshot removed.", ] `; exports[`creates a snapshot summary with multiple snapshot being written/updated 1`] = ` Array [ - "Snapshot Summary", - " › 2 snapshots written in 2 test suites.", - " › 2 snapshot tests failed in 2 test suites. Inspect your code changes or press --u to update them.", - " › 2 snapshots updated in 2 test suites.", - " › 2 obsolete snapshot files found, press --u to remove them..", - " › 2 obsolete snapshots found, press --u to remove them.", + "Snapshot Summary", + " › 2 snapshots written in 2 test suites.", + " › 2 snapshot tests failed in 2 test suites. Inspect your code changes or press --u to update them.", + " › 2 snapshots updated in 2 test suites.", + " › 2 obsolete snapshot files found, press --u to remove them..", + " › 2 obsolete snapshots found, press --u to remove them.", ] `; exports[`returns nothing if there are no updates 1`] = ` Array [ - "Snapshot Summary", + "Snapshot Summary", ] `; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap index 55fb2f7428f7..5b0c9b3800dc 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap @@ -1,25 +1,25 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`snapshots needs update with npm test 1`] = ` -"Snapshot Summary - › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`npm test -- -u\` to update them. +"Snapshot Summary + › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`npm test -- -u\` to update them. -Test Suites: 1 failed, 1 total -Tests: 1 failed, 1 total -Snapshots: 2 failed, 2 total -Time: 0.01s -Ran all test suites. +Test Suites: 1 failed, 1 total +Tests: 1 failed, 1 total +Snapshots: 2 failed, 2 total +Time: 0.01s +Ran all test suites. " `; exports[`snapshots needs update with yarn test 1`] = ` -"Snapshot Summary - › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`yarn test -u\` to update them. +"Snapshot Summary + › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`yarn test -u\` to update them. -Test Suites: 1 failed, 1 total -Tests: 1 failed, 1 total -Snapshots: 2 failed, 2 total -Time: 0.01s -Ran all test suites. +Test Suites: 1 failed, 1 total +Tests: 1 failed, 1 total +Snapshots: 2 failed, 2 total +Time: 0.01s +Ran all test suites. " `; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap index 4c7556f9f5f0..d063c2f9bfc8 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap @@ -1,23 +1,23 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`trimAndFormatPath() does not trim anything 1`] = `"1234567890/1234567890/1234.js"`; +exports[`trimAndFormatPath() does not trim anything 1`] = `"1234567890/1234567890/1234.js"`; -exports[`trimAndFormatPath() split at the path.sep index 1`] = `".../1234.js"`; +exports[`trimAndFormatPath() split at the path.sep index 1`] = `".../1234.js"`; -exports[`trimAndFormatPath() trims dirname (longer line width) 1`] = `"...890/1234567890/1234.js"`; +exports[`trimAndFormatPath() trims dirname (longer line width) 1`] = `"...890/1234567890/1234.js"`; -exports[`trimAndFormatPath() trims dirname 1`] = `"...234567890/1234.js"`; +exports[`trimAndFormatPath() trims dirname 1`] = `"...234567890/1234.js"`; -exports[`trimAndFormatPath() trims dirname and basename 1`] = `"...1234.js"`; +exports[`trimAndFormatPath() trims dirname and basename 1`] = `"...1234.js"`; exports[`wrapAnsiString() returns the string unaltered if given a terminal width of zero 1`] = `"This string shouldn't cause you any trouble"`; exports[`wrapAnsiString() returns the string unaltered if given a terminal width of zero 2`] = `"This string shouldn't cause you any trouble"`; exports[`wrapAnsiString() wraps a long string containing ansi chars 1`] = ` -"abcde red- -bold 12344 -56bcd 123t +"abcde red- +bold 12344 +56bcd 123t tttttththt hththththt hththththt @@ -25,8 +25,8 @@ hththththt hthththtet etetetette tetetetete -tetetestnh -snthsnthss +tetetestnh +snthsnthss ot" `; diff --git a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap index b3c6e240ddd7..d61ef3cce67d 100644 --- a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap +++ b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap @@ -1,73 +1,73 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Upgrade help logs a warning when \`scriptPreprocessor\` and/or \`preprocessorIgnorePatterns\` are used 1`] = ` -" Deprecation Warning: - - Option \\"preprocessorIgnorePatterns\\" was replaced by \\"transformIgnorePatterns\\", which support multiple preprocessors. - - Jest now treats your current configuration as: - { - \\"transformIgnorePatterns\\": [\\"bar/baz\\", \\"qux/quux\\"] - } - - Please update your configuration. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"● Deprecation Warning: + + Option \\"preprocessorIgnorePatterns\\" was replaced by \\"transformIgnorePatterns\\", which support multiple preprocessors. + + Jest now treats your current configuration as: + { + \\"transformIgnorePatterns\\": [\\"bar/baz\\", \\"qux/quux\\"] + } + + Please update your configuration. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`preset throws when preset is invalid 1`] = ` -"Validation Error: - - Preset react-native is invalid: - Unexpected token } in JSON at position 104 - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"● Validation Error: + + Preset react-native is invalid: + Unexpected token } in JSON at position 104 + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`preset throws when preset not found 1`] = ` -"Validation Error: - - Preset doesnt-exist not found. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"● Validation Error: + + Preset doesnt-exist not found. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`rootDir throws if the options is missing a rootDir property 1`] = ` -"Validation Error: - - Configuration option rootDir must be specified. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"● Validation Error: + + Configuration option rootDir must be specified. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`testEnvironment throws on invalid environment names 1`] = ` -"Validation Error: - - Test environment phantom cannot be found. Make sure the testEnvironment configuration option points to an existing node module. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"● Validation Error: + + Test environment phantom cannot be found. Make sure the testEnvironment configuration option points to an existing node module. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`testMatch throws if testRegex and testMatch are both specified 1`] = ` -"Validation Error: - - Configuration options testMatch and testRegex cannot be used together. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"● Validation Error: + + Configuration options testMatch and testRegex cannot be used together. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; -exports[`testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; +exports[`testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; -exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; +exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; diff --git a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap index e6dc7169be86..f2e4a904697a 100644 --- a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap +++ b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap @@ -1,210 +1,210 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`background color of spaces cyan for inchanged (expanded) 1`] = ` -"- Expected -+ Received - -
-+

- - following string consists of a space: - - line has preceding space only - line has both preceding and following space - line has following space only - -+

-
" +"- Expected ++ Received + +
++

+ + following string consists of a space: + + line has preceding space only + line has both preceding and following space + line has following space only + ++

+
" `; exports[`background color of spaces green for removed (expanded) 1`] = ` -"- Expected -+ Received - -
- -- following string consists of a space: -- -- line has preceding space only -- line has both preceding and following space -- line has following space only -+ - -
" +"- Expected ++ Received + +
+ +- following string consists of a space: +- +- line has preceding space only +- line has both preceding and following space +- line has following space only ++ + +
" `; exports[`background color of spaces red for added (expanded) 1`] = ` -"- Expected -+ Received - -
- -- -+ following string consists of a space: -+ -+ line has preceding space only -+ line has both preceding and following space -+ line has following space only - -
" +"- Expected ++ Received + +
+ +- ++ following string consists of a space: ++ ++ line has preceding space only ++ line has both preceding and following space ++ line has following space only + +
" `; exports[`background color of spaces yellow for unchanged (expanded) 1`] = ` -"- Expected -+ Received - -
-- -+

- following string consists of a space: - - line has preceding space only - line has both preceding and following space - line has following space only -- -+

-
" +"- Expected ++ Received + +
+- ++

+ following string consists of a space: + + line has preceding space only + line has both preceding and following space + line has following space only +- ++

+
" `; exports[`collapses big diffs to patch format 1`] = ` -"- Expected -+ Received - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`color of text (expanded) 1`] = ` -"- Expected -+ Received - - Object { - \\"searching\\": \\"\\", -- \\"sorting\\": Object { -+ \\"sorting\\": Array [ -+ Object { - \\"descending\\": false, - \\"fieldKey\\": \\"what\\", - }, -+ ], - }" +"- Expected ++ Received + + Object { + \\"searching\\": \\"\\", +- \\"sorting\\": Object { ++ \\"sorting\\": Array [ ++ Object { + \\"descending\\": false, + \\"fieldKey\\": \\"what\\", + }, ++ ], + }" `; exports[`context number of lines: -1 (5 default) 1`] = ` -"- Expected -+ Received - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`context number of lines: 0 1`] = ` -"- Expected -+ Received +"- Expected ++ Received -@@ -11,0 +11,1 @@ -+ 10, -@@ -12,1 +13,0 @@ -- 10," +@@ -11,0 +11,1 @@ ++ 10, +@@ -12,1 +13,0 @@ +- 10," `; exports[`context number of lines: 1 1`] = ` -"- Expected -+ Received - -@@ -10,4 +10,4 @@ - 8, -+ 10, - 9, -- 10, - ]," +"- Expected ++ Received + +@@ -10,4 +10,4 @@ + 8, ++ 10, + 9, +- 10, + ]," `; exports[`context number of lines: 2 1`] = ` -"- Expected -+ Received - -@@ -9,6 +9,6 @@ - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -9,6 +9,6 @@ + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`context number of lines: null (5 default) 1`] = ` -"- Expected -+ Received - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`falls back to not call toJSON if it throws and then objects have differences 1`] = ` -"- Expected -+ Received - - Object { -- \\"line\\": 1, -+ \\"line\\": 2, - \\"toJSON\\": [Function toJSON], - }" +"- Expected ++ Received + + Object { +- \\"line\\": 1, ++ \\"line\\": 2, + \\"toJSON\\": [Function toJSON], + }" `; exports[`falls back to not call toJSON if serialization has no differences but then objects have differences 1`] = ` -"Compared values serialize to the same structure. -Printing internal object structure without calling \`toJSON\` instead. +"Compared values serialize to the same structure. +Printing internal object structure without calling \`toJSON\` instead. -- Expected -+ Received +- Expected ++ Received - Object { -- \\"line\\": 1, -+ \\"line\\": 2, - \\"toJSON\\": [Function toJSON], - }" + Object { +- \\"line\\": 1, ++ \\"line\\": 2, + \\"toJSON\\": [Function toJSON], + }" `; exports[`highlight only the last in odd length of leading spaces (expanded) 1`] = ` -"- Expected -+ Received - -
--   attributes.reduce(function (props, attribute) {
--    props[attribute.name] = attribute.value;
-+   attributes.reduce((props, {name, value}) => {
-+   props[name] = value;
-    return props;
--  }, {});
-+ }, {});
-  
" +"- Expected ++ Received + +
+-   attributes.reduce(function (props, attribute) {
+-    props[attribute.name] = attribute.value;
++   attributes.reduce((props, {name, value}) => {
++   props[name] = value;
+    return props;
+-  }, {});
++ }, {});
+  
" `; diff --git a/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap index d94175512f98..ffb7743af5ed 100644 --- a/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap @@ -1,10 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`matchers proxies matchers to expect 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - 2 + 2 Received: - 1" + 1" `; diff --git a/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap b/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap index 7a8565648a34..8970f4e993db 100644 --- a/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap +++ b/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap @@ -5,21 +5,21 @@ exports[`.stringify() reduces maxDepth if stringifying very large objects 1`] = exports[`.stringify() reduces maxDepth if stringifying very large objects 2`] = `"{\\"a\\": 1, \\"b\\": {\\"0\\": \\"test\\", \\"1\\": \\"test\\", \\"2\\": \\"test\\", \\"3\\": \\"test\\", \\"4\\": \\"test\\", \\"5\\": \\"test\\", \\"6\\": \\"test\\", \\"7\\": \\"test\\", \\"8\\": \\"test\\", \\"9\\": \\"test\\"}}"`; exports[`.stringify() toJSON errors when comparing two objects 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - {\\"b\\": 1, \\"toJSON\\": [Function toJSON]} + {\\"b\\": 1, \\"toJSON\\": [Function toJSON]} Received: - {\\"a\\": 1, \\"toJSON\\": [Function toJSON]} + {\\"a\\": 1, \\"toJSON\\": [Function toJSON]} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"b\\": 1, -+ \\"a\\": 1, - \\"toJSON\\": [Function toJSON], - }" + Object { +- \\"b\\": 1, ++ \\"a\\": 1, + \\"toJSON\\": [Function toJSON], + }" `; diff --git a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap index b4ebdf847fe3..2d79ba387112 100644 --- a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap +++ b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`.formatExecError() 1`] = ` -" ● Test suite failed to run +" ● Test suite failed to run Whoops! " `; exports[`formatStackTrace should strip node internals 1`] = ` -" Unix test +" ● Unix test Expected value to be of type: @@ -17,19 +17,19 @@ exports[`formatStackTrace should strip node internals 1`] = ` \\"\\" type: \\"string\\" - - - at Object.it (__tests__/test.js:8:14) - + + + at Object.it (__tests__/test.js:8:14) + " `; exports[`should exclude jasmine from stack trace for Unix paths. 1`] = ` -" Unix test +" ● Unix test at stack (../jest-jasmine2/build/jasmine-2.4.1.js:1580:17) - - at Object.addResult (../jest-jasmine2/build/jasmine-2.4.1.js:1550:14) - at Object.it (build/__tests__/messages-test.js:45:41) + + at Object.addResult (../jest-jasmine2/build/jasmine-2.4.1.js:1550:14) + at Object.it (build/__tests__/messages-test.js:45:41) " `; diff --git a/packages/jest-util/src/__tests__/__snapshots__/validate_cli_options.test.js.snap b/packages/jest-util/src/__tests__/__snapshots__/validate_cli_options.test.js.snap index 21a703ef034f..f244b8e2570b 100644 --- a/packages/jest-util/src/__tests__/__snapshots__/validate_cli_options.test.js.snap +++ b/packages/jest-util/src/__tests__/__snapshots__/validate_cli_options.test.js.snap @@ -1,22 +1,22 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`fails for multiple unknown options 1`] = ` -" Unrecognized CLI Parameters: - - Following options were not recognized: - [\\"jest\\", \\"test\\"] - - CLI Options Documentation: - https://facebook.github.io/jest/docs/en/cli.html -" +"● Unrecognized CLI Parameters: + + Following options were not recognized: + [\\"jest\\", \\"test\\"] + + CLI Options Documentation: + https://facebook.github.io/jest/docs/en/cli.html +" `; exports[`fails for unknown option 1`] = ` -" Unrecognized CLI Parameter: - - Unrecognized option \\"unknown\\". - - CLI Options Documentation: - https://facebook.github.io/jest/docs/en/cli.html -" +"● Unrecognized CLI Parameter: + + Unrecognized option \\"unknown\\". + + CLI Options Documentation: + https://facebook.github.io/jest/docs/en/cli.html +" `; diff --git a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap index de79961455f5..af77f3aca1ee 100644 --- a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap +++ b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap @@ -1,138 +1,138 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`displays warning for deprecated config options 1`] = ` -" Deprecation Warning: - - Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. - - Jest now treats your current configuration as: - { - \\"transform\\": {\\".*\\": \\"test\\"} - } - - Please update your configuration. -" +"● Deprecation Warning: + + Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. + + Jest now treats your current configuration as: + { + \\"transform\\": {\\".*\\": \\"test\\"} + } + + Please update your configuration. +" `; exports[`displays warning for unknown config options 1`] = ` -" Validation Warning: - - Unknown option \\"unkwon\\" with value {} was found. Did you mean \\"unknown\\"? - This is probably a typing mistake. Fixing it will remove this message. -" +"● Validation Warning: + + Unknown option \\"unkwon\\" with value {} was found. Did you mean \\"unknown\\"? + This is probably a typing mistake. Fixing it will remove this message. +" `; exports[`pretty prints valid config for Array 1`] = ` -" Validation Error: - - Option \\"coverageReporters\\" must be of type: - array - but instead received: - object - - Example: - { - \\"coverageReporters\\": [\\"json\\", \\"text\\", \\"lcov\\", \\"clover\\"] - } -" +"● Validation Error: + + Option \\"coverageReporters\\" must be of type: + array + but instead received: + object + + Example: + { + \\"coverageReporters\\": [\\"json\\", \\"text\\", \\"lcov\\", \\"clover\\"] + } +" `; exports[`pretty prints valid config for Boolean 1`] = ` -" Validation Error: - - Option \\"automock\\" must be of type: - boolean - but instead received: - array - - Example: - { - \\"automock\\": false - } -" +"● Validation Error: + + Option \\"automock\\" must be of type: + boolean + but instead received: + array + + Example: + { + \\"automock\\": false + } +" `; exports[`pretty prints valid config for Function 1`] = ` -" Validation Error: - - Option \\"fn\\" must be of type: - function - but instead received: - string - - Example: - { - \\"fn\\": (config, option, deprecatedOptions) => true - } -" +"● Validation Error: + + Option \\"fn\\" must be of type: + function + but instead received: + string + + Example: + { + \\"fn\\": (config, option, deprecatedOptions) => true + } +" `; exports[`pretty prints valid config for Object 1`] = ` -" Validation Error: - - Option \\"haste\\" must be of type: - object - but instead received: - number - - Example: - { - \\"haste\\": {\\"providesModuleNodeModules\\": [\\"react\\", \\"react-native\\"]} - } -" +"● Validation Error: + + Option \\"haste\\" must be of type: + object + but instead received: + number + + Example: + { + \\"haste\\": {\\"providesModuleNodeModules\\": [\\"react\\", \\"react-native\\"]} + } +" `; exports[`pretty prints valid config for String 1`] = ` -" Validation Error: - - Option \\"preset\\" must be of type: - string - but instead received: - number - - Example: - { - \\"preset\\": \\"react-native\\" - } -" +"● Validation Error: + + Option \\"preset\\" must be of type: + string + but instead received: + number + + Example: + { + \\"preset\\": \\"react-native\\" + } +" `; exports[`works with custom deprecations 1`] = ` -"My Custom Deprecation Warning: - - Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. - - Jest now treats your current configuration as: - { - \\"transform\\": {\\".*\\": \\"test\\"} - } - - Please update your configuration. - -My custom comment" +"My Custom Deprecation Warning: + + Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. + + Jest now treats your current configuration as: + { + \\"transform\\": {\\".*\\": \\"test\\"} + } + + Please update your configuration. + +My custom comment" `; exports[`works with custom errors 1`] = ` -"My Custom Error: - - Option \\"test\\" must be of type: - array - but instead received: - string - - Example: - { - \\"test\\": [1, 2] - } - -My custom comment" +"My Custom Error: + + Option \\"test\\" must be of type: + array + but instead received: + string + + Example: + { + \\"test\\": [1, 2] + } + +My custom comment" `; exports[`works with custom warnings 1`] = ` -"My Custom Warning: - - Unknown option \\"unknown\\" with value \\"string\\" was found. - This is probably a typing mistake. Fixing it will remove this message. - -My custom comment" +"My Custom Warning: + + Unknown option \\"unknown\\" with value \\"string\\" was found. + This is probably a typing mistake. Fixing it will remove this message. + +My custom comment" `; From 19d8d880bf326cab50d869017fa519b345b72964 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 12:45:01 -0500 Subject: [PATCH 24/97] feat: adds error when using it or test without proper arguments --- packages/jest-jasmine2/src/jasmine/Env.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/jest-jasmine2/src/jasmine/Env.js b/packages/jest-jasmine2/src/jasmine/Env.js index 179529922ada..4c4d6502b24a 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.js +++ b/packages/jest-jasmine2/src/jasmine/Env.js @@ -424,6 +424,15 @@ export default function(j$) { }; this.it = function(description, fn, timeout) { + if (typeof description !== 'string') { + throw new Error(`first argument, "name", must be a string`); + } + if (fn === undefined) { + throw new Error('missing second argument function'); + } + if (typeof fn !== 'function') { + throw new Error(`second argument must be a function`); + } const spec = specFactory( description, fn, From af8efd7a0456f3d644debd987962bb8ad95a82e5 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 14:13:32 -0500 Subject: [PATCH 25/97] fix: adds more descriptive error message --- packages/jest-jasmine2/src/jasmine/Env.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/jest-jasmine2/src/jasmine/Env.js b/packages/jest-jasmine2/src/jasmine/Env.js index 4c4d6502b24a..1f382ddb3e96 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.js +++ b/packages/jest-jasmine2/src/jasmine/Env.js @@ -425,13 +425,19 @@ export default function(j$) { this.it = function(description, fn, timeout) { if (typeof description !== 'string') { - throw new Error(`first argument, "name", must be a string`); + throw new Error( + `Invalid first argument, ${description}. It must be a string.`, + ); } if (fn === undefined) { - throw new Error('missing second argument function'); + throw new Error( + 'Missing second argument. It must be a callback function.', + ); } if (typeof fn !== 'function') { - throw new Error(`second argument must be a function`); + throw new Error( + `Invalid second argument, ${fn}. It must be a callback function.`, + ); } const spec = specFactory( description, From 30ccac2dcbaac1ad1be06ed7c27494fc2bdc836b Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 14:16:56 -0500 Subject: [PATCH 26/97] feat: adds tests for errors --- .../src/__tests__/it_argument_errors.test.js | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js diff --git a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js new file mode 100644 index 000000000000..7e3450b5468a --- /dev/null +++ b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +'use strict'; + +import Env from '../jasmine/Env'; +import ReportDispatcher from '../jasmine/report_dispatcher'; +const options = {ReportDispatcher}; +const testEnv = Env(options); +console.log(testEnv()); + +describe('it/test invalid argument errors', () => { + xit(`doesn't throw errors with correct arguments`, () => { + expect(testEnv.it('good', () => {})).toBeTruthy(); + }); + xit('throws an error when missing a callback', () => { + expect(testEnv.it('missing callback')).toThrowError(); + }); + + xit('throws an error if first argument is not a string', () => { + expect(testEnv.it(() => {})).toThrowError(); + }); + + xit('throws an error if the second argument is not a function', () => { + expect(testEnv.it('no', 'function')).toThrowError(); + }); +}); From 1842a5d7f84c38c105c3dd5147734ef030617d15 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 16:42:08 -0500 Subject: [PATCH 27/97] fix: removes bad test --- .../src/__tests__/it_argument_errors.test.js | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js diff --git a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js deleted file mode 100644 index 7e3450b5468a..000000000000 --- a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -'use strict'; - -import Env from '../jasmine/Env'; -import ReportDispatcher from '../jasmine/report_dispatcher'; -const options = {ReportDispatcher}; -const testEnv = Env(options); -console.log(testEnv()); - -describe('it/test invalid argument errors', () => { - xit(`doesn't throw errors with correct arguments`, () => { - expect(testEnv.it('good', () => {})).toBeTruthy(); - }); - xit('throws an error when missing a callback', () => { - expect(testEnv.it('missing callback')).toThrowError(); - }); - - xit('throws an error if first argument is not a string', () => { - expect(testEnv.it(() => {})).toThrowError(); - }); - - xit('throws an error if the second argument is not a function', () => { - expect(testEnv.it('no', 'function')).toThrowError(); - }); -}); From 17d305021af1be64cc83d9623580ea38c6f9128d Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 21:21:30 -0500 Subject: [PATCH 28/97] feat: adds tests for circus and jasmine2 --- .../__tests__/circus_it_test_error.test.js | 44 +++++++++++++++++++ packages/jest-circus/src/index.js | 18 +++++++- .../src/__tests__/it_test_error.test.js | 29 ++++++++++++ 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 packages/jest-circus/src/__tests__/circus_it_test_error.test.js create mode 100644 packages/jest-jasmine2/src/__tests__/it_test_error.test.js diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js new file mode 100644 index 000000000000..d7a3413beae9 --- /dev/null +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + */ + +'use strict'; + +let testIt; + +const itAliaser = () => { + const {it} = require('../index.js'); + testIt = it; +}; + +itAliaser(); + +describe('test/it error throwing', () => { + it(`doesn't throw an error with valid arguments`, () => { + expect(() => { + testIt('test', () => {}); + }).not.toThrowError(); + }); + it(`throws error with missing callback function`, () => { + expect(() => { + testIt('test'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + it(`throws an error when first argument isn't a string`, () => { + expect(() => { + testIt(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + it('throws an error when callback function is not a function', () => { + expect(() => { + testIt('test', 'test2'); + }).toThrowError( + `Invalid second argument, test2. It must be a callback function.`, + ); + }); +}); diff --git a/packages/jest-circus/src/index.js b/packages/jest-circus/src/index.js index e77a72f79518..0fbdfd218c0b 100644 --- a/packages/jest-circus/src/index.js +++ b/packages/jest-circus/src/index.js @@ -38,8 +38,22 @@ const beforeAll = (fn: HookFn) => _addHook(fn, 'beforeAll'); const afterEach = (fn: HookFn) => _addHook(fn, 'afterEach'); const afterAll = (fn: HookFn) => _addHook(fn, 'afterAll'); -const test = (testName: TestName, fn?: TestFn) => - dispatch({fn, name: 'add_test', testName}); +const test = (testName: TestName, fn: TestFn) => { + if (typeof testName !== 'string') { + throw new Error( + `Invalid first argument, ${testName}. It must be a string.`, + ); + } + if (fn === undefined) { + throw new Error('Missing second argument. It must be a callback function.'); + } + if (typeof fn !== 'function') { + throw new Error( + `Invalid second argument, ${fn}. It must be a callback function.`, + ); + } + return dispatch({fn, name: 'add_test', testName}); +}; const it = test; test.skip = (testName: TestName, fn?: TestFn) => dispatch({fn, mode: 'skip', name: 'add_test', testName}); diff --git a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js new file mode 100644 index 000000000000..4642c95335be --- /dev/null +++ b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +'use strict'; + +describe('test/it error throwing', () => { + it(`throws error with missing callback function`, () => { + expect(() => { + it('test2'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + it(`throws an error when first argument isn't a string`, () => { + expect(() => { + it(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + it('throws an error when callback function is not a function', () => { + expect(() => { + it('test3', 'test4'); + }).toThrowError( + `Invalid second argument, test4. It must be a callback function.`, + ); + }); +}); From 754bf3885b9c4cf8f8d3ced52a6418a831183e55 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 21:24:20 -0500 Subject: [PATCH 29/97] fix: small tweaks to test names --- packages/jest-jasmine2/src/__tests__/it_test_error.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js index 4642c95335be..27b95d4d59fc 100644 --- a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js +++ b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js @@ -11,7 +11,7 @@ describe('test/it error throwing', () => { it(`throws error with missing callback function`, () => { expect(() => { - it('test2'); + it('test1'); }).toThrowError('Missing second argument. It must be a callback function.'); }); it(`throws an error when first argument isn't a string`, () => { @@ -21,9 +21,9 @@ describe('test/it error throwing', () => { }); it('throws an error when callback function is not a function', () => { expect(() => { - it('test3', 'test4'); + it('test2', 'test3'); }).toThrowError( - `Invalid second argument, test4. It must be a callback function.`, + `Invalid second argument, test3. It must be a callback function.`, ); }); }); From 5464098790119b21f65d4632a384b782285caa76 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 22:11:22 -0500 Subject: [PATCH 30/97] fix: adds circus test to flow ignore --- .flowconfig | 1 + .../jest-circus/src/__tests__/circus_it_test_error.test.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.flowconfig b/.flowconfig index 30bdfc526a60..8b4332fc2745 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,6 +1,7 @@ [ignore] .*/examples/.* .*/node_modules/metro-bundler/.* +.*/circus_it_test_error.test.js*. [options] module.name_mapper='^pretty-format$' -> '/packages/pretty-format/src/index.js' diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index d7a3413beae9..c9ba16f6603c 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -1,10 +1,10 @@ /** - * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow + * *@flow */ 'use strict'; From 42ef481a8abbf61944271e3b763885d5d66491cc Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 09:38:40 -0500 Subject: [PATCH 31/97] fix: variable names for circus it --- .../__tests__/circus_it_test_error.test.js | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index c9ba16f6603c..068a3f80a804 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -9,34 +9,41 @@ 'use strict'; -let testIt; +let circusIt; -const itAliaser = () => { +//using jest-jasmine2's 'it' to test jest-circus's 'it'. Had to differentiate +//the two with this aliaser. + +const aliasCircusIt = () => { const {it} = require('../index.js'); - testIt = it; + circusIt = it; }; -itAliaser(); +aliasCircusIt(); + +//A few of these tests require incorrect types to throw errors and thus pass +//the test. The typechecks on jest-circus would prevent that, so +//this file has been listed in the .flowconfig ignore section. describe('test/it error throwing', () => { it(`doesn't throw an error with valid arguments`, () => { expect(() => { - testIt('test', () => {}); + circusIt('test', () => {}); }).not.toThrowError(); }); it(`throws error with missing callback function`, () => { expect(() => { - testIt('test'); + circusIt('test'); }).toThrowError('Missing second argument. It must be a callback function.'); }); it(`throws an error when first argument isn't a string`, () => { expect(() => { - testIt(() => {}); + circusIt(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); it('throws an error when callback function is not a function', () => { expect(() => { - testIt('test', 'test2'); + circusIt('test', 'test2'); }).toThrowError( `Invalid second argument, test2. It must be a callback function.`, ); From fdc0dc35dee8cc691c74280b3434c71342b409b8 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 09:57:10 -0500 Subject: [PATCH 32/97] chore: updates changelog. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7507d751ee0a..50e7509626be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,9 @@ ### Features +* `[jest-jasmine2]` Adds error throwing and descriptive errors to `it`/ `test` + for invalid arguements. `[jest-circus]` Adds error throwing and descriptive + errors to `it`/ `test` for invalid arguements. * `[jest-util]` Add the following methods to the "console" implementations: `assert`, `count`, `countReset`, `dir`, `dirxml`, `group`, `groupCollapsed`, `groupEnd`, `time`, `timeEnd` From e98660989b01dc4a9077b7425c7aadc2ded8be6f Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 14:27:18 -0500 Subject: [PATCH 33/97] updates: globals tests and snapshots --- .../__snapshots__/globals.test.js.snap | 75 ++++++++++++------- integration-tests/__tests__/globals.test.js | 4 +- 2 files changed, 50 insertions(+), 29 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 809211cb5725..9fe405a36eea 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -20,6 +20,23 @@ Ran all test suites. " `; +exports[`function as descriptor 1`] = ` +"PASS __tests__/function-as-descriptor.test.js + Foo + ✓ it + +" +`; + +exports[`function as descriptor 2`] = ` +"Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + exports[`only 1`] = ` "PASS __tests__/only-constructs.test.js ✓ test.only @@ -123,16 +140,27 @@ Ran all test suites. `; exports[`tests with no implementation 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ skipped 2 tests +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run + + Missing second argument. It must be a callback function. + + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | } + + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; exports[`tests with no implementation 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total +"Test Suites: 1 failed, 1 total +Tests: 0 total Snapshots: 0 total Time: <> Ran all test suites. @@ -140,34 +168,27 @@ Ran all test suites. `; exports[`tests with no implementation with expand arg 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ it, no implementation - ○ test, no implementation +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run -" -`; + Missing second argument. It must be a callback function. -exports[`tests with no implementation with expand arg 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - -exports[`function as descriptor 1`] = ` -"PASS __tests__/function-as-descriptor.test.js - Foo - ✓ it + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | } + + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; -exports[`function as descriptor 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 1 passed, 1 total +exports[`tests with no implementation with expand arg 2`] = ` +"Test Suites: 1 failed, 1 total +Tests: 0 total Snapshots: 0 total Time: <> Ran all test suites. diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index e141b0e9c715..f6dc85619268 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -120,7 +120,7 @@ test('tests with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); @@ -198,7 +198,7 @@ test('tests with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); From a6ab7b04a8bf5c630486153b625ffd4d9252c213 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 16:23:20 -0500 Subject: [PATCH 34/97] fix: resets snapshot file --- .../__snapshots__/globals.test.js.snap | 77 +++++++------------ 1 file changed, 28 insertions(+), 49 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 9fe405a36eea..6bc34bc7f4a3 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -20,23 +20,6 @@ Ran all test suites. " `; -exports[`function as descriptor 1`] = ` -"PASS __tests__/function-as-descriptor.test.js - Foo - ✓ it - -" -`; - -exports[`function as descriptor 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 1 passed, 1 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - exports[`only 1`] = ` "PASS __tests__/only-constructs.test.js ✓ test.only @@ -140,27 +123,16 @@ Ran all test suites. `; exports[`tests with no implementation 1`] = ` -"FAIL __tests__/only-constructs.test.js - ● Test suite failed to run - - Missing second argument. It must be a callback function. - - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | - 436 | } - - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 - at __tests__/only-constructs.test.js:3:5 +"PASS __tests__/only-constructs.test.js + ✓ it + ○ skipped 2 tests " `; exports[`tests with no implementation 2`] = ` -"Test Suites: 1 failed, 1 total -Tests: 0 total +"Test Suites: 1 passed, 1 total +Tests: 2 skipped, 1 passed, 3 total Snapshots: 0 total Time: <> Ran all test suites. @@ -168,29 +140,36 @@ Ran all test suites. `; exports[`tests with no implementation with expand arg 1`] = ` -"FAIL __tests__/only-constructs.test.js - ● Test suite failed to run - - Missing second argument. It must be a callback function. - - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | - 436 | } - - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 - at __tests__/only-constructs.test.js:3:5 +"PASS __tests__/only-constructs.test.js + ✓ it + ○ it, no implementation + ○ test, no implementation " `; exports[`tests with no implementation with expand arg 2`] = ` -"Test Suites: 1 failed, 1 total -Tests: 0 total +"Test Suites: 1 passed, 1 total +Tests: 2 skipped, 1 passed, 3 total Snapshots: 0 total Time: <> Ran all test suites. " `; + +exports[`function as descriptor 1`] = ` +"PASS __tests__/function-as-descriptor.test.js + Foo + ✓ it + +" +`; + +exports[`function as descriptor 2`] = ` +"Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; \ No newline at end of file From 5453e9f8229ccc3a15cd5bcdc3773b7acdb83aa5 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 16:27:00 -0500 Subject: [PATCH 35/97] fix: temp skips failing tests until further direction --- integration-tests/__tests__/globals.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index f6dc85619268..e15ccabf10b0 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -110,7 +110,7 @@ test('only', () => { expect(summary).toMatchSnapshot(); }); -test('tests with no implementation', () => { +xtest('tests with no implementation', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -120,7 +120,7 @@ test('tests with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(1); + expect(status).toBe(0); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); @@ -188,7 +188,7 @@ test('only with expand arg', () => { expect(summary).toMatchSnapshot(); }); -test('tests with no implementation with expand arg', () => { +xtest('tests with no implementation with expand arg', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -198,7 +198,7 @@ test('tests with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(1); + expect(status).toBe(0); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); From 1520b94a3baa856d682eb742a70273107a94de4d Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 18:55:26 -0500 Subject: [PATCH 36/97] feat: adds tests for test alias --- .../__tests__/circus_it_test_error.test.js | 42 +++++++++++++++---- .../src/__tests__/it_test_error.test.js | 27 +++++++++--- 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index 068a3f80a804..7b72fef20015 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -10,13 +10,15 @@ 'use strict'; let circusIt; +let circusTest; //using jest-jasmine2's 'it' to test jest-circus's 'it'. Had to differentiate //the two with this aliaser. const aliasCircusIt = () => { - const {it} = require('../index.js'); + const {it, test} = require('../index.js'); circusIt = it; + circusTest = test; }; aliasCircusIt(); @@ -26,26 +28,48 @@ aliasCircusIt(); //this file has been listed in the .flowconfig ignore section. describe('test/it error throwing', () => { - it(`doesn't throw an error with valid arguments`, () => { + it(`it doesn't throw an error with valid arguments`, () => { expect(() => { - circusIt('test', () => {}); + circusIt('test1', () => {}); }).not.toThrowError(); }); - it(`throws error with missing callback function`, () => { + it(`it throws error with missing callback function`, () => { expect(() => { - circusIt('test'); + circusIt('test2'); }).toThrowError('Missing second argument. It must be a callback function.'); }); - it(`throws an error when first argument isn't a string`, () => { + it(`it throws an error when first argument isn't a string`, () => { expect(() => { circusIt(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); - it('throws an error when callback function is not a function', () => { + it('it throws an error when callback function is not a function', () => { expect(() => { - circusIt('test', 'test2'); + circusIt('test4', 'test4b'); }).toThrowError( - `Invalid second argument, test2. It must be a callback function.`, + `Invalid second argument, test4b. It must be a callback function.`, + ); + }); + it(`test doesn't throw an error with valid arguments`, () => { + expect(() => { + circusTest('test5', () => {}); + }).not.toThrowError(); + }); + it(`test throws error with missing callback function`, () => { + expect(() => { + circusTest('test6'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + it(`test throws an error when first argument isn't a string`, () => { + expect(() => { + circusTest(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + it('test throws an error when callback function is not a function', () => { + expect(() => { + circusTest('test8', 'test8b'); + }).toThrowError( + `Invalid second argument, test8b. It must be a callback function.`, ); }); }); diff --git a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js index 27b95d4d59fc..9f1727645ffd 100644 --- a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js +++ b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js @@ -9,21 +9,38 @@ 'use strict'; describe('test/it error throwing', () => { - it(`throws error with missing callback function`, () => { + it(`it throws error with missing callback function`, () => { expect(() => { it('test1'); }).toThrowError('Missing second argument. It must be a callback function.'); }); - it(`throws an error when first argument isn't a string`, () => { + it(`it throws an error when first argument isn't a string`, () => { expect(() => { it(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); - it('throws an error when callback function is not a function', () => { + it('it throws an error when callback function is not a function', () => { expect(() => { - it('test2', 'test3'); + it('test3', 'test3b'); }).toThrowError( - `Invalid second argument, test3. It must be a callback function.`, + `Invalid second argument, test3b. It must be a callback function.`, + ); + }); + test(`test throws error with missing callback function`, () => { + expect(() => { + test('test4'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + test(`test throws an error when first argument isn't a string`, () => { + expect(() => { + test(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + test('test throws an error when callback function is not a function', () => { + expect(() => { + test('test6', 'test6b'); + }).toThrowError( + `Invalid second argument, test6b. It must be a callback function.`, ); }); }); From 193cdf6b755ccbcedbbcec12b532277a85a538a4 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 19:56:28 -0500 Subject: [PATCH 37/97] fix: renamed unimplemented test. Comments out rest snapshot for now. --- .../__snapshots__/globals.test.js.snap | 87 ++++++++----------- integration-tests/__tests__/globals.test.js | 12 +-- 2 files changed, 41 insertions(+), 58 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 6bc34bc7f4a3..2122883d094d 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -20,6 +20,41 @@ Ran all test suites. " `; +exports[`cannot test with no implementation 1`] = ` +"Test Suites: 1 failed, 1 total +Tests: 0 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + +exports[`cannot test with no implementation with expand arg 1`] = ` +"Test Suites: 1 failed, 1 total +Tests: 0 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + +exports[`function as descriptor 1`] = ` +"PASS __tests__/function-as-descriptor.test.js + Foo + ✓ it + +" +`; + +exports[`function as descriptor 2`] = ` +"Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + exports[`only 1`] = ` "PASS __tests__/only-constructs.test.js ✓ test.only @@ -121,55 +156,3 @@ Time: <> Ran all test suites. " `; - -exports[`tests with no implementation 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ skipped 2 tests - -" -`; - -exports[`tests with no implementation 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - -exports[`tests with no implementation with expand arg 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ it, no implementation - ○ test, no implementation - -" -`; - -exports[`tests with no implementation with expand arg 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - -exports[`function as descriptor 1`] = ` -"PASS __tests__/function-as-descriptor.test.js - Foo - ✓ it - -" -`; - -exports[`function as descriptor 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 1 passed, 1 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; \ No newline at end of file diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index e15ccabf10b0..93d3129a9267 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -110,7 +110,7 @@ test('only', () => { expect(summary).toMatchSnapshot(); }); -xtest('tests with no implementation', () => { +test('cannot test with no implementation', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -120,10 +120,10 @@ xtest('tests with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - expect(rest).toMatchSnapshot(); + // expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); @@ -188,7 +188,7 @@ test('only with expand arg', () => { expect(summary).toMatchSnapshot(); }); -xtest('tests with no implementation with expand arg', () => { +test('cannot test with no implementation with expand arg', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -198,10 +198,10 @@ xtest('tests with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - expect(rest).toMatchSnapshot(); + // expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From b2ac1c5077bda3cc7de6229ab6a743ed6534954c Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 11:28:37 -0500 Subject: [PATCH 38/97] fix: restores rest snapshot and removes abs path from snapshot stack --- .../__snapshots__/globals.test.js.snap | 28 +++++++++++++++++++ integration-tests/__tests__/globals.test.js | 6 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 2122883d094d..416c9eb30100 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -21,6 +21,20 @@ Ran all test suites. `; exports[`cannot test with no implementation 1`] = ` +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run + + Missing second argument. It must be a callback function. + + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | }" +`; + +exports[`cannot test with no implementation 2`] = ` "Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total @@ -30,6 +44,20 @@ Ran all test suites. `; exports[`cannot test with no implementation with expand arg 1`] = ` +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run + + Missing second argument. It must be a callback function. + + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | }" +`; + +exports[`cannot test with no implementation with expand arg 2`] = ` "Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index 93d3129a9267..61b0985399ae 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -123,7 +123,8 @@ test('cannot test with no implementation', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - // expect(rest).toMatchSnapshot(); + const restWithoutStack = rest.slice(0, 343); + expect(restWithoutStack).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); @@ -201,7 +202,8 @@ test('cannot test with no implementation with expand arg', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - // expect(rest).toMatchSnapshot(); + const restWithoutStack = rest.slice(0, 343); + expect(restWithoutStack).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From 5ad176890f583d4b1ad5e6c52151d77bb72bfc9a Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 13:02:56 -0500 Subject: [PATCH 39/97] fix: cleans up stack using cleanUpStackTrace --- integration-tests/Utils.js | 6 ++++-- .../__tests__/__snapshots__/globals.test.js.snap | 14 ++++++++++++-- integration-tests/__tests__/globals.test.js | 7 +++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 3fb045589a1f..6a6b31ca4303 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -146,10 +146,12 @@ const extractSummary = (stdout: string) => { const summary = match[0] .replace(/\d*\.?\d+m?s/g, '<>') .replace(/, estimated <>/g, ''); - const rest = cleanupStackTrace( // remove all timestamps - stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), + stdout + .slice(0, -match[0].length) + .replace(/\s*\(\d*\.?\d+m?s\)$/gm, '') + .replace(/^.*\b(at Env.it)\b.*$/gm, ''), ); return {rest, summary}; diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 416c9eb30100..495c1001d42d 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -31,7 +31,12 @@ exports[`cannot test with no implementation 1`] = ` > 433 | throw new Error( 434 | 'Missing second argument. It must be a callback function.'); 435 | - 436 | }" + 436 | } + + + at __tests__/only-constructs.test.js:3:5 + +" `; exports[`cannot test with no implementation 2`] = ` @@ -54,7 +59,12 @@ exports[`cannot test with no implementation with expand arg 1`] = ` > 433 | throw new Error( 434 | 'Missing second argument. It must be a callback function.'); 435 | - 436 | }" + 436 | } + + + at __tests__/only-constructs.test.js:3:5 + +" `; exports[`cannot test with no implementation with expand arg 2`] = ` diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index 61b0985399ae..79cc76beaac8 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -123,8 +123,8 @@ test('cannot test with no implementation', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - const restWithoutStack = rest.slice(0, 343); - expect(restWithoutStack).toMatchSnapshot(); + + expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); @@ -202,8 +202,7 @@ test('cannot test with no implementation with expand arg', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - const restWithoutStack = rest.slice(0, 343); - expect(restWithoutStack).toMatchSnapshot(); + expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From 03121389f33b1d95c79f7c657de400a854762c82 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 13:43:29 -0500 Subject: [PATCH 40/97] fix: modifies regex in utils --- integration-tests/Utils.js | 8 ++------ .../__tests__/__snapshots__/globals.test.js.snap | 8 ++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 6a6b31ca4303..90249597ba38 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -148,12 +148,8 @@ const extractSummary = (stdout: string) => { .replace(/, estimated <>/g, ''); const rest = cleanupStackTrace( // remove all timestamps - stdout - .slice(0, -match[0].length) - .replace(/\s*\(\d*\.?\d+m?s\)$/gm, '') - .replace(/^.*\b(at Env.it)\b.*$/gm, ''), + stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), ); - return {rest, summary}; }; @@ -161,7 +157,7 @@ const extractSummary = (stdout: string) => { // unifies their output to make it possible to snapshot them. // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { - return output.replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); + return output.replace(/^.*\b(at)\b.*$/gm, ' at $1'); }; module.exports = { diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 495c1001d42d..2fe104a0cf75 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -33,8 +33,8 @@ exports[`cannot test with no implementation 1`] = ` 435 | 436 | } - - at __tests__/only-constructs.test.js:3:5 + at at + at at " `; @@ -61,8 +61,8 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - - at __tests__/only-constructs.test.js:3:5 + at at + at at " `; From ca714e71e326bf58bf4d88408b4f84c2fb1e8346 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 14:10:22 -0500 Subject: [PATCH 41/97] fix: reverts utils regex --- integration-tests/Utils.js | 2 +- .../__tests__/__snapshots__/globals.test.js.snap | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 90249597ba38..42b3c17228a6 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -157,7 +157,7 @@ const extractSummary = (stdout: string) => { // unifies their output to make it possible to snapshot them. // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { - return output.replace(/^.*\b(at)\b.*$/gm, ' at $1'); + return output.replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); }; module.exports = { diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 2fe104a0cf75..b14324eb7a8b 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -33,8 +33,8 @@ exports[`cannot test with no implementation 1`] = ` 435 | 436 | } - at at - at at + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; @@ -61,8 +61,8 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - at at - at at + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; From 1a4dd3af025152ec03c055e325c61659e8431770 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 14:18:06 -0500 Subject: [PATCH 42/97] fix: reverts line deletion in utils. --- integration-tests/Utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 42b3c17228a6..3fb045589a1f 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -146,10 +146,12 @@ const extractSummary = (stdout: string) => { const summary = match[0] .replace(/\d*\.?\d+m?s/g, '<>') .replace(/, estimated <>/g, ''); + const rest = cleanupStackTrace( // remove all timestamps stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), ); + return {rest, summary}; }; From a1ea320feccfc71aa7d09dd4a1bbf509df04faf4 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 15:14:49 -0500 Subject: [PATCH 43/97] fix: replaces env in cleanup stack trace --- integration-tests/Utils.js | 4 +++- .../__tests__/__snapshots__/globals.test.js.snap | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 3fb045589a1f..b500c078a2a5 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -159,7 +159,9 @@ const extractSummary = (stdout: string) => { // unifies their output to make it possible to snapshot them. // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { - return output.replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); + return output + .replace(/^.*\b(at Env.it)\b.*$/gm, '') + .replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); }; module.exports = { diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index b14324eb7a8b..495c1001d42d 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -33,7 +33,7 @@ exports[`cannot test with no implementation 1`] = ` 435 | 436 | } - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " @@ -61,7 +61,7 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " From ef31915205e95d02c2eab4e5c725b1911d994d16 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 20:40:25 -0500 Subject: [PATCH 44/97] fix: addresses patch --- packages/jest-message-util/src/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/jest-message-util/src/index.js b/packages/jest-message-util/src/index.js index 91db678e0d56..1a24e474ca4a 100644 --- a/packages/jest-message-util/src/index.js +++ b/packages/jest-message-util/src/index.js @@ -205,8 +205,15 @@ const formatPaths = ( return line; } - let filePath = slash(path.relative(config.rootDir, match[2])); // highlight paths from the current test file + const packageDir = match[2].includes(`${path.sep}packages${path.sep}`) + ? match[2].match(/(jest).*$/) + : null; + + let filePath = packageDir + ? packageDir + : slash(path.relative(config.rootDir, match[2])); + if ( (config.testMatch && config.testMatch.length && From 5e0aabd63806b89c9599ab52ead7839616afb93e Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 21:31:56 -0500 Subject: [PATCH 45/97] fix: replaces overly long packages path for CI test --- integration-tests/Utils.js | 2 +- packages/jest-message-util/src/index.js | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index b500c078a2a5..bad044ad6faf 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -160,7 +160,7 @@ const extractSummary = (stdout: string) => { // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { return output - .replace(/^.*\b(at Env.it)\b.*$/gm, '') + .replace(/.*(?=packages)/g, ' at ') .replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); }; diff --git a/packages/jest-message-util/src/index.js b/packages/jest-message-util/src/index.js index 1a24e474ca4a..504e3aee8f17 100644 --- a/packages/jest-message-util/src/index.js +++ b/packages/jest-message-util/src/index.js @@ -46,6 +46,7 @@ type StackTraceOptions = { const PATH_NODE_MODULES = `${path.sep}node_modules${path.sep}`; const PATH_EXPECT_BUILD = `${path.sep}expect${path.sep}build${path.sep}`; +const PATH_JEST_PACKAGES = `${path.sep}jest${path.sep}packages${path.sep}`; // filter for noisy stack trace lines const JASMINE_IGNORE = /^\s+at(?:(?:.*?vendor\/|jasmine\-)|\s+jasmine\.buildExpectationResult)/; @@ -205,15 +206,8 @@ const formatPaths = ( return line; } + let filePath = slash(path.relative(config.rootDir, match[2])); // highlight paths from the current test file - const packageDir = match[2].includes(`${path.sep}packages${path.sep}`) - ? match[2].match(/(jest).*$/) - : null; - - let filePath = packageDir - ? packageDir - : slash(path.relative(config.rootDir, match[2])); - if ( (config.testMatch && config.testMatch.length && @@ -227,7 +221,11 @@ const formatPaths = ( const getTopFrame = (lines: string[]) => { for (const line of lines) { - if (line.includes(PATH_NODE_MODULES) || line.includes(PATH_EXPECT_BUILD)) { + if ( + line.includes(PATH_NODE_MODULES) || + line.includes(PATH_EXPECT_BUILD) || + line.includes(PATH_JEST_PACKAGES) + ) { continue; } From 30aa554aab6973cf131081d71424ba5d502426b1 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 21:36:07 -0500 Subject: [PATCH 46/97] fix: adds new snapshot after packages fix --- integration-tests/__tests__/__snapshots__/failures.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/__tests__/__snapshots__/failures.test.js.snap b/integration-tests/__tests__/__snapshots__/failures.test.js.snap index 80542fc0622e..8ed114207cfb 100644 --- a/integration-tests/__tests__/__snapshots__/failures.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/failures.test.js.snap @@ -118,7 +118,7 @@ exports[`works with async failures 1`] = ` + \\"foo\\": \\"bar\\", } - at ../../packages/expect/build/index.js:145:57 + at packages/expect/build/index.js:145:57 " `; From 735bbc2278d0560d2d18354c768ecaba114251fa Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 21:38:34 -0500 Subject: [PATCH 47/97] fix: updates globals snapshot after packages fix --- .../__snapshots__/globals.test.js.snap | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 495c1001d42d..fc640eca0c36 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -26,14 +26,13 @@ exports[`cannot test with no implementation 1`] = ` Missing second argument. It must be a callback function. - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | - 436 | } + 1 | + 2 | it('it', () => {}); + > 3 | it('it, no implementation'); + 4 | test('test, no implementation'); + 5 | - + at packages/jest-jasmine2/build/jasmine/Env.js:433:15 at __tests__/only-constructs.test.js:3:5 " @@ -54,14 +53,13 @@ exports[`cannot test with no implementation with expand arg 1`] = ` Missing second argument. It must be a callback function. - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | - 436 | } + 1 | + 2 | it('it', () => {}); + > 3 | it('it, no implementation'); + 4 | test('test, no implementation'); + 5 | - + at packages/jest-jasmine2/build/jasmine/Env.js:433:15 at __tests__/only-constructs.test.js:3:5 " From edc9231d7ede72d79b678df4be0a5ff26c8c40c1 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 22:24:31 -0500 Subject: [PATCH 48/97] fix: reverses bad snapshot commit --- .../__snapshots__/extend.test.js.snap | 2 +- .../__snapshots__/matchers.test.js.snap | 3184 ++++++++--------- .../__snapshots__/spy_matchers.test.js.snap | 230 +- .../to_throw_matchers.test.js.snap | 138 +- .../snapshot_interactive_mode.test.js.snap | 30 +- .../format_test_name_by_pattern.test.js | 127 +- .../get_snapshot_status.test.js.snap | 26 +- .../get_snapshot_summary.test.js.snap | 40 +- .../summary_reporter.test.js.snap | 30 +- .../__snapshots__/utils.test.js.snap | 22 +- .../__snapshots__/normalize.test.js.snap | 104 +- .../__tests__/__snapshots__/diff.test.js.snap | 330 +- .../__snapshots__/matchers.test.js.snap | 8 +- .../__snapshots__/index.test.js.snap | 22 +- .../__snapshots__/messages.test.js.snap | 22 +- .../__snapshots__/validate.test.js.snap | 216 +- .../validate_cli_options.test.js.snap | 32 +- 17 files changed, 2270 insertions(+), 2293 deletions(-) diff --git a/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap b/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap index c804d6c84014..a9d13ec56996 100644 --- a/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap @@ -2,4 +2,4 @@ exports[`is available globally 1`] = `"expected 15 to be divisible by 2"`; -exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`; +exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`; \ No newline at end of file diff --git a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap index 7dd105dcbc23..d22487ff6113 100644 --- a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap @@ -1,3986 +1,3986 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`.rejects fails for promise that resolves 1`] = ` -"expect(received).rejects.toBe() +"expect(received).rejects.toBe() -Expected received Promise to reject, instead it resolved to value - 4" +Expected received Promise to reject, instead it resolved to value + 4" `; exports[`.rejects fails non-promise value "a" 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - string: \\"a\\"" + string: \\"a\\"" `; exports[`.rejects fails non-promise value [1] 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - array: [1]" + array: [1]" `; exports[`.rejects fails non-promise value [Function anonymous] 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.rejects fails non-promise value {"a": 1} 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - object: {\\"a\\": 1}" + object: {\\"a\\": 1}" `; exports[`.rejects fails non-promise value 4 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - number: 4" + number: 4" `; exports[`.rejects fails non-promise value null 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. -Received: null" +received value must be a Promise. +Received: null" `; exports[`.rejects fails non-promise value true 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - boolean: true" + boolean: true" `; exports[`.rejects fails non-promise value undefined 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. -Received: undefined" +received value must be a Promise. +Received: undefined" `; exports[`.resolves fails for promise that rejects 1`] = ` -"expect(received).resolves.toBe() +"expect(received).resolves.toBe() -Expected received Promise to resolve, instead it rejected to value - 4" +Expected received Promise to resolve, instead it rejected to value + 4" `; exports[`.resolves fails non-promise value "a" 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - string: \\"a\\"" + string: \\"a\\"" `; exports[`.resolves fails non-promise value "a" synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - string: \\"a\\"" + string: \\"a\\"" `; exports[`.resolves fails non-promise value [1] 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - array: [1]" + array: [1]" `; exports[`.resolves fails non-promise value [1] synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - array: [1]" + array: [1]" `; exports[`.resolves fails non-promise value [Function anonymous] 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.resolves fails non-promise value [Function anonymous] synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.resolves fails non-promise value {"a": 1} 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - object: {\\"a\\": 1}" + object: {\\"a\\": 1}" `; exports[`.resolves fails non-promise value {"a": 1} synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - object: {\\"a\\": 1}" + object: {\\"a\\": 1}" `; exports[`.resolves fails non-promise value 4 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - number: 4" + number: 4" `; exports[`.resolves fails non-promise value 4 synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - number: 4" + number: 4" `; exports[`.resolves fails non-promise value null 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: null" +received value must be a Promise. +Received: null" `; exports[`.resolves fails non-promise value null synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: null" +received value must be a Promise. +Received: null" `; exports[`.resolves fails non-promise value true 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - boolean: true" + boolean: true" `; exports[`.resolves fails non-promise value true synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - boolean: true" + boolean: true" `; exports[`.resolves fails non-promise value undefined 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: undefined" +received value must be a Promise. +Received: undefined" `; exports[`.resolves fails non-promise value undefined synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: undefined" +received value must be a Promise. +Received: 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 value to be: - {} + {} Received: - {\\"circular\\": [Circular]} + {\\"circular\\": [Circular]} Difference: -- Expected -+ Received +- Expected ++ Received -- 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 value to not be: - \\"a\\" + \\"a\\" Received: - \\"a\\"" + \\"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 value to not be: - [] + [] Received: - []" + []" `; exports[`.toBe() fails for '{}' with '.not' 1`] = ` -"expect(received).not.toBe(expected) // Object.is equality +"expect(received).not.toBe(expected) // Object.is equality Expected value to not be: - {} + {} Received: - {}" + {}" `; 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 value to not be: - 1 + 1 Received: - 1" + 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 value to not be: - false + false Received: - false" + 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 value to not be: - null + null Received: - null" + 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 value to not be: - undefined + undefined Received: - undefined" + undefined" `; exports[`.toBe() fails for: "abc" and "cde" 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - \\"cde\\" + \\"cde\\" Received: - \\"abc\\"" + \\"abc\\"" `; 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 value to be: - \\"without trailing space\\" + \\"without trailing space\\" Received: - \\"with -trailing space\\"" + \\"with +trailing space\\"" `; exports[`.toBe() fails for: [] and [] 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - [] + [] Received: - [] + [] Difference: -Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." +Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." `; exports[`.toBe() fails for: {"a": 1} and {"a": 1} 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - {\\"a\\": 1} + {\\"a\\": 1} Received: - {\\"a\\": 1} + {\\"a\\": 1} Difference: -Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." +Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." `; 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 value to be: - {\\"a\\": 5} + {\\"a\\": 5} Received: - {\\"a\\": 1} + {\\"a\\": 1} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"a\\": 5, -+ \\"a\\": 1, - }" + Object { +- \\"a\\": 5, ++ \\"a\\": 1, + }" `; exports[`.toBe() fails for: {} and {} 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - {} + {} Received: - {} + {} Difference: -Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." +Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." `; exports[`.toBe() fails for: -0 and 0 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - 0 + 0 Received: - -0 + -0 Difference: -Compared values have no visual difference." +Compared values have no visual difference." `; exports[`.toBe() fails for: 1 and 2 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - 2 + 2 Received: - 1" + 1" `; exports[`.toBe() fails for: null and undefined 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - undefined + undefined Received: - null + null Difference: - Comparing two different types of values. Expected undefined but received null." + Comparing two different types of values. Expected undefined but 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 value to be: - false + false Received: - true" + true" `; exports[`.toBeCloseTo() {pass: true} expect(0)toBeCloseTo( 0) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 0 +Expected value not to be close to (with 2-digit precision): + 0 Received: - 0" + 0" `; exports[`.toBeCloseTo() {pass: true} expect(0)toBeCloseTo( 0.001) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 0.001 +Expected value not to be close to (with 2-digit precision): + 0.001 Received: - 0" + 0" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.225) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.225 +Expected value not to be close to (with 2-digit precision): + 1.225 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.226) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.226 +Expected value not to be close to (with 2-digit precision): + 1.226 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.229) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.229 +Expected value not to be close to (with 2-digit precision): + 1.229 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.234) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.234 +Expected value not to be close to (with 2-digit precision): + 1.234 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() accepts an optional precision argument: [0, 0.000004, 5] 1`] = ` -"expect(received).not.toBeCloseTo(expected, precision) +"expect(received).not.toBeCloseTo(expected, precision) -Expected value not to be close to (with 5-digit precision): - 0.000004 +Expected value not to be close to (with 5-digit precision): + 0.000004 Received: - 0" + 0" `; exports[`.toBeCloseTo() accepts an optional precision argument: [0, 0.0001, 3] 1`] = ` -"expect(received).not.toBeCloseTo(expected, precision) +"expect(received).not.toBeCloseTo(expected, precision) -Expected value not to be close to (with 3-digit precision): - 0.0001 +Expected value not to be close to (with 3-digit precision): + 0.0001 Received: - 0" + 0" `; exports[`.toBeCloseTo() accepts an optional precision argument: [0, 0.1, 0] 1`] = ` -"expect(received).not.toBeCloseTo(expected, precision) +"expect(received).not.toBeCloseTo(expected, precision) -Expected value not to be close to (with 0-digit precision): - 0.1 +Expected value not to be close to (with 0-digit precision): + 0.1 Received: - 0" + 0" `; exports[`.toBeCloseTo() throws: [0, 0.01] 1`] = ` -"expect(received).toBeCloseTo(expected) +"expect(received).toBeCloseTo(expected) -Expected value to be close to (with 2-digit precision): - 0.01 +Expected value to be close to (with 2-digit precision): + 0.01 Received: - 0" + 0" `; exports[`.toBeCloseTo() throws: [1, 1.23] 1`] = ` -"expect(received).toBeCloseTo(expected) +"expect(received).toBeCloseTo(expected) -Expected value to be close to (with 2-digit precision): - 1.23 +Expected value to be close to (with 2-digit precision): + 1.23 Received: - 1" + 1" `; exports[`.toBeCloseTo() throws: [1.23, 1.2249999] 1`] = ` -"expect(received).toBeCloseTo(expected) +"expect(received).toBeCloseTo(expected) -Expected value to be close to (with 2-digit precision): - 1.2249999 +Expected value to be close to (with 2-digit precision): + 1.2249999 Received: - 1.23" + 1.23" `; exports[`.toBeDefined(), .toBeUndefined() '"a"' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeDefined(), .toBeUndefined() '"a"' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeDefined(), .toBeUndefined() '[]' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - []" + []" `; exports[`.toBeDefined(), .toBeUndefined() '[]' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - []" + []" `; exports[`.toBeDefined(), .toBeUndefined() '[Function anonymous]' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeDefined(), .toBeUndefined() '[Function anonymous]' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeDefined(), .toBeUndefined() '{}' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - {}" + {}" `; exports[`.toBeDefined(), .toBeUndefined() '{}' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - {}" + {}" `; exports[`.toBeDefined(), .toBeUndefined() '0.5' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - 0.5" + 0.5" `; exports[`.toBeDefined(), .toBeUndefined() '0.5' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - 0.5" + 0.5" `; exports[`.toBeDefined(), .toBeUndefined() '1' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - 1" + 1" `; exports[`.toBeDefined(), .toBeUndefined() '1' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - 1" + 1" `; exports[`.toBeDefined(), .toBeUndefined() 'Infinity' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - Infinity" + Infinity" `; exports[`.toBeDefined(), .toBeUndefined() 'Infinity' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - Infinity" + Infinity" `; exports[`.toBeDefined(), .toBeUndefined() 'Map {}' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - Map {}" + Map {}" `; exports[`.toBeDefined(), .toBeUndefined() 'Map {}' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - Map {}" + Map {}" `; exports[`.toBeDefined(), .toBeUndefined() 'true' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - true" + true" `; exports[`.toBeDefined(), .toBeUndefined() 'true' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - true" + true" `; exports[`.toBeDefined(), .toBeUndefined() undefined is undefined 1`] = ` -"expect(received).toBeDefined() +"expect(received).toBeDefined() Expected value to be defined, instead received - undefined" + undefined" `; exports[`.toBeDefined(), .toBeUndefined() undefined is undefined 2`] = ` -"expect(received).not.toBeUndefined() +"expect(received).not.toBeUndefined() Expected value not to be undefined, instead received - undefined" + undefined" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [-Infinity, -Infinity] 1`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - -Infinity + -Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [-Infinity, -Infinity] 2`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - -Infinity + -Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [1, 1] 1`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 1 + 1 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [1, 1] 2`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 1 + 1 Received: - 1" + 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 value not to be greater than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 1.7976931348623157e+308" + 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 value not to be less than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 1.7976931348623157e+308" + 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 value not to be greater than or equal: - 5e-324 + 5e-324 Received: - 5e-324" + 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 value not to be less than or equal: - 5e-324 + 5e-324 Received: - 5e-324" + 5e-324" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [Infinity, Infinity] 1`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - Infinity + Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [Infinity, Infinity] 2`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - Infinity + Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be less than: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be greater than: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be less than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be greater than or equal: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeInstanceOf() failing "a" and [Function String] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"String\\" + \\"String\\" Received: - \\"a\\" + \\"a\\" Constructor: - \\"String\\"" + \\"String\\"" `; exports[`.toBeInstanceOf() failing {} and [Function A] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"A\\" + \\"A\\" Received: - {} + {} Constructor: - undefined" + undefined" `; exports[`.toBeInstanceOf() failing {} and [Function B] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"B\\" + \\"B\\" Received: - {} + {} Constructor: - \\"A\\"" + \\"A\\"" `; exports[`.toBeInstanceOf() failing 1 and [Function Number] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"Number\\" + \\"Number\\" Received: - 1 + 1 Constructor: - \\"Number\\"" + \\"Number\\"" `; exports[`.toBeInstanceOf() failing true and [Function Boolean] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"Boolean\\" + \\"Boolean\\" Received: - true + true Constructor: - \\"Boolean\\"" + \\"Boolean\\"" `; exports[`.toBeInstanceOf() passing [] and [Function Array] 1`] = ` -"expect(value).not.toBeInstanceOf(constructor) +"expect(value).not.toBeInstanceOf(constructor) Expected value not to be an instance of: - \\"Array\\" + \\"Array\\" Received: - [] + [] " `; exports[`.toBeInstanceOf() passing {} and [Function A] 1`] = ` -"expect(value).not.toBeInstanceOf(constructor) +"expect(value).not.toBeInstanceOf(constructor) Expected value not to be an instance of: - \\"A\\" + \\"A\\" Received: - {} + {} " `; exports[`.toBeInstanceOf() passing Map {} and [Function Map] 1`] = ` -"expect(value).not.toBeInstanceOf(constructor) +"expect(value).not.toBeInstanceOf(constructor) Expected value not to be an instance of: - \\"Map\\" + \\"Map\\" Received: - Map {} + Map {} " `; exports[`.toBeInstanceOf() throws if constructor is not a function 1`] = ` -"expect(value)[.not].toBeInstanceOf(constructor) +"expect(value)[.not].toBeInstanceOf(constructor) Expected constructor to be a function. Instead got: - \\"number\\"" + \\"number\\"" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 1`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 2`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 3`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 4`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() throws 1`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - 1" + 1" `; exports[`.toBeNaN() throws 2`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - \\"\\"" + \\"\\"" `; exports[`.toBeNaN() throws 3`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - null" + null" `; exports[`.toBeNaN() throws 4`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - undefined" + undefined" `; exports[`.toBeNaN() throws 5`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - {}" + {}" `; exports[`.toBeNaN() throws 6`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - []" + []" `; exports[`.toBeNaN() throws 7`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - 0.2" + 0.2" `; exports[`.toBeNaN() throws 8`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - 0" + 0" `; exports[`.toBeNaN() throws 9`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - Infinity" + Infinity" `; exports[`.toBeNaN() throws 10`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - -Infinity" + -Infinity" `; exports[`.toBeNull() fails for '"a"' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeNull() fails for '[]' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - []" + []" `; exports[`.toBeNull() fails for '[Function anonymous]' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeNull() fails for '{}' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - {}" + {}" `; exports[`.toBeNull() fails for '0.5' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - 0.5" + 0.5" `; exports[`.toBeNull() fails for '1' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - 1" + 1" `; exports[`.toBeNull() fails for 'Infinity' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - Infinity" + Infinity" `; exports[`.toBeNull() fails for 'Map {}' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - Map {}" + Map {}" `; exports[`.toBeNull() fails for 'true' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - true" + true" `; exports[`.toBeNull() pass for null 1`] = ` -"expect(received).not.toBeNull() +"expect(received).not.toBeNull() Expected value not to be null, instead received - null" + null" `; exports[`.toBeTruthy(), .toBeFalsy() '""' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - \\"\\"" + \\"\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '""' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - \\"\\"" + \\"\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '"a"' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '"a"' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '[]' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - []" + []" `; exports[`.toBeTruthy(), .toBeFalsy() '[]' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - []" + []" `; exports[`.toBeTruthy(), .toBeFalsy() '[Function anonymous]' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeTruthy(), .toBeFalsy() '[Function anonymous]' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeTruthy(), .toBeFalsy() '{}' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - {}" + {}" `; exports[`.toBeTruthy(), .toBeFalsy() '{}' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - {}" + {}" `; exports[`.toBeTruthy(), .toBeFalsy() '0' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - 0" + 0" `; exports[`.toBeTruthy(), .toBeFalsy() '0' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - 0" + 0" `; exports[`.toBeTruthy(), .toBeFalsy() '0.5' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - 0.5" + 0.5" `; exports[`.toBeTruthy(), .toBeFalsy() '0.5' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - 0.5" + 0.5" `; exports[`.toBeTruthy(), .toBeFalsy() '1' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - 1" + 1" `; exports[`.toBeTruthy(), .toBeFalsy() '1' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - 1" + 1" `; exports[`.toBeTruthy(), .toBeFalsy() 'Infinity' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - Infinity" + Infinity" `; exports[`.toBeTruthy(), .toBeFalsy() 'Infinity' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - Infinity" + Infinity" `; exports[`.toBeTruthy(), .toBeFalsy() 'Map {}' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - Map {}" + Map {}" `; exports[`.toBeTruthy(), .toBeFalsy() 'Map {}' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - Map {}" + Map {}" `; exports[`.toBeTruthy(), .toBeFalsy() 'NaN' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - NaN" + NaN" `; exports[`.toBeTruthy(), .toBeFalsy() 'NaN' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - NaN" + NaN" `; exports[`.toBeTruthy(), .toBeFalsy() 'false' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - false" + false" `; exports[`.toBeTruthy(), .toBeFalsy() 'false' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - false" + false" `; exports[`.toBeTruthy(), .toBeFalsy() 'null' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - null" + null" `; exports[`.toBeTruthy(), .toBeFalsy() 'null' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - null" + null" `; exports[`.toBeTruthy(), .toBeFalsy() 'true' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - true" + true" `; exports[`.toBeTruthy(), .toBeFalsy() 'true' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - true" + true" `; exports[`.toBeTruthy(), .toBeFalsy() 'undefined' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - undefined" + undefined" `; exports[`.toBeTruthy(), .toBeFalsy() 'undefined' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - undefined" + undefined" `; exports[`.toBeTruthy(), .toBeFalsy() does not accept arguments 1`] = ` -"expect(received)[.not].toBeTruthy() +"expect(received)[.not].toBeTruthy() Matcher does not accept any arguments. -Got: null" +Got: null" `; exports[`.toBeTruthy(), .toBeFalsy() does not accept arguments 2`] = ` -"expect(received)[.not].toBeFalsy() +"expect(received)[.not].toBeFalsy() Matcher does not accept any arguments. -Got: null" +Got: null" `; exports[`.toContain(), .toContainEqual() '"11112111"' contains '"2"' 1`] = ` -"expect(string).not.toContain(value) +"expect(string).not.toContain(value) Expected string: - \\"11112111\\" + \\"11112111\\" Not to contain value: - \\"2\\" + \\"2\\" " `; exports[`.toContain(), .toContainEqual() '"abcdef"' contains '"abc"' 1`] = ` -"expect(string).not.toContain(value) +"expect(string).not.toContain(value) Expected string: - \\"abcdef\\" + \\"abcdef\\" Not to contain value: - \\"abc\\" + \\"abc\\" " `; exports[`.toContain(), .toContainEqual() '["a", "b", "c", "d"]' contains '"a"' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] Not to contain value: - \\"a\\" + \\"a\\" " `; exports[`.toContain(), .toContainEqual() '["a", "b", "c", "d"]' contains a value equal to '"a"' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] Not to contain a value equal to: - \\"a\\" + \\"a\\" " `; exports[`.toContain(), .toContainEqual() '[{"a": "b"}, {"a": "c"}]' contains a value equal to '{"a": "b"}' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] + [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] Not to contain a value equal to: - {\\"a\\": \\"b\\"} + {\\"a\\": \\"b\\"} " `; exports[`.toContain(), .toContainEqual() '[{"a": "b"}, {"a": "c"}]' does not contain a value equal to'{"a": "d"}' 1`] = ` -"expect(array).toContainEqual(value) +"expect(array).toContainEqual(value) Expected array: - [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] + [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] To contain a value equal to: - {\\"a\\": \\"d\\"}" + {\\"a\\": \\"d\\"}" `; exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '[]' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [{}, []] + [{}, []] To contain value: - []" + []" `; exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '{}' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [{}, []] + [{}, []] To contain value: - {}" + {}" `; exports[`.toContain(), .toContainEqual() '[0, 1]' contains '1' 1`] = ` -"expect(object).not.toContain(value) +"expect(object).not.toContain(value) Expected object: - [0, 1] + [0, 1] Not to contain value: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[0, 1]' contains a value equal to '1' 1`] = ` -"expect(object).not.toContainEqual(value) +"expect(object).not.toContainEqual(value) Expected object: - [0, 1] + [0, 1] Not to contain a value equal to: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[1, 2, 3, 4]' contains '1' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [1, 2, 3, 4] + [1, 2, 3, 4] Not to contain value: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[1, 2, 3, 4]' contains a value equal to '1' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [1, 2, 3, 4] + [1, 2, 3, 4] Not to contain a value equal to: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[1, 2, 3]' does not contain '4' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [1, 2, 3] + [1, 2, 3] To contain value: - 4" + 4" `; exports[`.toContain(), .toContainEqual() '[Symbol(a)]' contains 'Symbol(a)' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [Symbol(a)] + [Symbol(a)] Not to contain value: - Symbol(a) + Symbol(a) " `; exports[`.toContain(), .toContainEqual() '[Symbol(a)]' contains a value equal to 'Symbol(a)' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [Symbol(a)] + [Symbol(a)] Not to contain a value equal to: - Symbol(a) + Symbol(a) " `; exports[`.toContain(), .toContainEqual() '[null, undefined]' does not contain '1' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [null, undefined] + [null, undefined] To contain value: - 1" + 1" `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains 'null' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [undefined, null] + [undefined, null] Not to contain value: - null + null " `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains 'undefined' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [undefined, null] + [undefined, null] Not to contain value: - undefined + undefined " `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains a value equal to 'null' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [undefined, null] + [undefined, null] Not to contain a value equal to: - null + null " `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains a value equal to 'undefined' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [undefined, null] + [undefined, null] Not to contain a value equal to: - undefined + undefined " `; exports[`.toContain(), .toContainEqual() 'Set {"abc", "def"}' contains '"abc"' 1`] = ` -"expect(set).not.toContain(value) +"expect(set).not.toContain(value) Expected set: - Set {\\"abc\\", \\"def\\"} + Set {\\"abc\\", \\"def\\"} Not to contain value: - \\"abc\\" + \\"abc\\" " `; exports[`.toContain(), .toContainEqual() 'Set {1, 2, 3, 4}' contains a value equal to '1' 1`] = ` -"expect(set).not.toContainEqual(value) +"expect(set).not.toContainEqual(value) Expected set: - Set {1, 2, 3, 4} + Set {1, 2, 3, 4} Not to contain a value equal to: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() error cases 1`] = ` -"expect(collection)[.not].toContainEqual(value) +"expect(collection)[.not].toContainEqual(value) -Expected collection to be an array-like structure. -Received: null" +Expected collection to be an array-like structure. +Received: null" `; exports[`.toContain(), .toContainEqual() error cases for toContainEqual 1`] = ` -"expect(collection)[.not].toContainEqual(value) +"expect(collection)[.not].toContainEqual(value) -Expected collection to be an array-like structure. -Received: null" +Expected collection to be an array-like structure. +Received: null" `; exports[`.toEqual() {pass: false} expect("Alice").not.toEqual({"asymmetricMatch": [Function asymmetricMatch]}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {\\"asymmetricMatch\\": [Function asymmetricMatch]} + {\\"asymmetricMatch\\": [Function asymmetricMatch]} Received: - \\"Alice\\"" + \\"Alice\\"" `; exports[`.toEqual() {pass: false} expect("Eve").toEqual({"asymmetricMatch": [Function asymmetricMatch]}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - {\\"asymmetricMatch\\": [Function asymmetricMatch]} + {\\"asymmetricMatch\\": [Function asymmetricMatch]} Received: - \\"Eve\\"" + \\"Eve\\"" `; exports[`.toEqual() {pass: false} expect("abc").not.toEqual("abc") 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - \\"abc\\" + \\"abc\\" Received: - \\"abc\\"" + \\"abc\\"" `; exports[`.toEqual() {pass: false} expect("abcd").not.toEqual(StringContaining "bc") 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - StringContaining \\"bc\\" + StringContaining \\"bc\\" Received: - \\"abcd\\"" + \\"abcd\\"" `; exports[`.toEqual() {pass: false} expect("abcd").not.toEqual(StringMatching /bc/) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - StringMatching /bc/ + StringMatching /bc/ Received: - \\"abcd\\"" + \\"abcd\\"" `; exports[`.toEqual() {pass: false} expect("abd").toEqual(StringContaining "bc") 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - StringContaining \\"bc\\" + StringContaining \\"bc\\" Received: - \\"abd\\"" + \\"abd\\"" `; exports[`.toEqual() {pass: false} expect("abd").toEqual(StringMatching /bc/i) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - StringMatching /bc/i + StringMatching /bc/i Received: - \\"abd\\"" + \\"abd\\"" `; exports[`.toEqual() {pass: false} expect("banana").toEqual("apple") 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - \\"apple\\" + \\"apple\\" Received: - \\"banana\\"" + \\"banana\\"" `; exports[`.toEqual() {pass: false} expect([1, 2, 3]).not.toEqual(ArrayContaining [2, 3]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - ArrayContaining [2, 3] + ArrayContaining [2, 3] Received: - [1, 2, 3]" + [1, 2, 3]" `; exports[`.toEqual() {pass: false} expect([1, 2]).not.toEqual([1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - [1, 2] + [1, 2] Received: - [1, 2]" + [1, 2]" `; exports[`.toEqual() {pass: false} expect([1, 2]).toEqual([2, 1]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - [2, 1] + [2, 1] Received: - [1, 2] + [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - Array [ -+ 1, - 2, -- 1, - ]" + Array [ ++ 1, + 2, +- 1, + ]" `; exports[`.toEqual() {pass: false} expect([1, 3]).toEqual(ArrayContaining [1, 2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ArrayContaining [1, 2] + ArrayContaining [1, 2] Received: - [1, 3] + [1, 3] Difference: -- Expected -+ Received +- Expected ++ Received -- ArrayContaining [ -+ Array [ - 1, -- 2, -+ 3, - ]" +- ArrayContaining [ ++ Array [ + 1, +- 2, ++ 3, + ]" `; exports[`.toEqual() {pass: false} expect([1]).not.toEqual([1]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - [1] + [1] Received: - [1]" + [1]" `; exports[`.toEqual() {pass: false} expect([1]).toEqual([2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - [2] + [2] Received: - [1] + [1] Difference: -- Expected -+ Received +- Expected ++ Received - Array [ -- 2, -+ 1, - ]" + Array [ +- 2, ++ 1, + ]" `; exports[`.toEqual() {pass: false} expect([Function anonymous]).not.toEqual(Any) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Any + Any Received: - [Function anonymous]" + [Function anonymous]" `; exports[`.toEqual() {pass: false} expect({"a": 1, "b": [Function b], "c": true}).not.toEqual({"a": 1, "b": Any, "c": Anything}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {\\"a\\": 1, \\"b\\": Any, \\"c\\": Anything} + {\\"a\\": 1, \\"b\\": Any, \\"c\\": Anything} Received: - {\\"a\\": 1, \\"b\\": [Function b], \\"c\\": true}" + {\\"a\\": 1, \\"b\\": [Function b], \\"c\\": true}" `; exports[`.toEqual() {pass: false} expect({"a": 1, "b": 2}).not.toEqual(ObjectContaining {"a": 1}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - ObjectContaining {\\"a\\": 1} + ObjectContaining {\\"a\\": 1} Received: - {\\"a\\": 1, \\"b\\": 2}" + {\\"a\\": 1, \\"b\\": 2}" `; exports[`.toEqual() {pass: false} expect({"a": 1, "b": 2}).toEqual(ObjectContaining {"a": 2}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ObjectContaining {\\"a\\": 2} + ObjectContaining {\\"a\\": 2} Received: - {\\"a\\": 1, \\"b\\": 2} + {\\"a\\": 1, \\"b\\": 2} Difference: -- Expected -+ Received +- Expected ++ Received -- ObjectContaining { -- \\"a\\": 2, -+ Object { -+ \\"a\\": 1, -+ \\"b\\": 2, - }" +- ObjectContaining { +- \\"a\\": 2, ++ Object { ++ \\"a\\": 1, ++ \\"b\\": 2, + }" `; exports[`.toEqual() {pass: false} expect({"a": 5}).toEqual({"b": 6}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - {\\"b\\": 6} + {\\"b\\": 6} Received: - {\\"a\\": 5} + {\\"a\\": 5} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"b\\": 6, -+ \\"a\\": 5, - }" + Object { +- \\"b\\": 6, ++ \\"a\\": 5, + }" `; exports[`.toEqual() {pass: false} expect({"a": 99}).not.toEqual({"a": 99}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {\\"a\\": 99} + {\\"a\\": 99} Received: - {\\"a\\": 99}" + {\\"a\\": 99}" `; exports[`.toEqual() {pass: false} expect({}).not.toEqual({}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {} + {} Received: - {}" + {}" `; exports[`.toEqual() {pass: false} expect(0).toEqual(-0) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - -0 + -0 Received: - 0 + 0 Difference: -Compared values have no visual difference." +Compared values have no visual difference." `; exports[`.toEqual() {pass: false} expect(1).not.toEqual(1) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - 1 + 1 Received: - 1" + 1" `; exports[`.toEqual() {pass: false} expect(1).toEqual(2) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - 2 + 2 Received: - 1" + 1" `; exports[`.toEqual() {pass: false} expect(1).toEqual(ArrayContaining [1, 2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ArrayContaining [1, 2] + ArrayContaining [1, 2] Received: - 1 + 1 Difference: - Comparing two different types of values. Expected array but received number." + Comparing two different types of values. Expected array but received number." `; exports[`.toEqual() {pass: false} expect(Immutable.List [1, 2]).not.toEqual(Immutable.List [1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.List [1, 2] + Immutable.List [1, 2] Received: - Immutable.List [1, 2]" + Immutable.List [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.List [1, 2]).toEqual(Immutable.List [2, 1]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.List [2, 1] + Immutable.List [2, 1] Received: - Immutable.List [1, 2] + Immutable.List [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.List [ -+ 1, - 2, -- 1, - ]" + Immutable.List [ ++ 1, + 2, +- 1, + ]" `; exports[`.toEqual() {pass: false} expect(Immutable.List [1]).not.toEqual(Immutable.List [1]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.List [1] + Immutable.List [1] Received: - Immutable.List [1]" + Immutable.List [1]" `; exports[`.toEqual() {pass: false} expect(Immutable.List [1]).toEqual(Immutable.List [2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.List [2] + Immutable.List [2] Received: - Immutable.List [1] + Immutable.List [1] Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.List [ -- 2, -+ 1, - ]" + Immutable.List [ +- 2, ++ 1, + ]" `; exports[`.toEqual() {pass: false} 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) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} Received: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}}" + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}}" `; 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 11}}} + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 11}}} Received: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Map {\\"b\\": 0} + Immutable.Map {\\"b\\": 0} Received: - Immutable.Map {\\"a\\": 0} + Immutable.Map {\\"a\\": 0} Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Map {\\"v\\": 2} + Immutable.Map {\\"v\\": 2} Received: - Immutable.Map {\\"v\\": 1} + Immutable.Map {\\"v\\": 1} Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.Map { -- \\"v\\": 2, -+ \\"v\\": 1, - }" + Immutable.Map { +- \\"v\\": 2, ++ \\"v\\": 1, + }" `; exports[`.toEqual() {pass: false} expect(Immutable.Map {}).not.toEqual(Immutable.Map {}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {} + Immutable.Map {} Received: - Immutable.Map {}" + Immutable.Map {}" `; exports[`.toEqual() {pass: false} expect(Immutable.Map {1: "one", 2: "two"}).not.toEqual(Immutable.Map {1: "one", 2: "two"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {1: \\"one\\", 2: \\"two\\"} + Immutable.Map {1: \\"one\\", 2: \\"two\\"} Received: - Immutable.Map {1: \\"one\\", 2: \\"two\\"}" + Immutable.Map {1: \\"one\\", 2: \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Immutable.Map {1: "one", 2: "two"}).not.toEqual(Immutable.Map {2: "two", 1: "one"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {2: \\"two\\", 1: \\"one\\"} + Immutable.Map {2: \\"two\\", 1: \\"one\\"} Received: - Immutable.Map {1: \\"one\\", 2: \\"two\\"}" + Immutable.Map {1: \\"one\\", 2: \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedMap {1: "one", 2: "two"}).not.toEqual(Immutable.OrderedMap {1: "one", 2: "two"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} + Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} Received: - Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"}" + Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedMap {1: "one", 2: "two"}).toEqual(Immutable.OrderedMap {2: "two", 1: "one"}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.OrderedMap {2: \\"two\\", 1: \\"one\\"} + Immutable.OrderedMap {2: \\"two\\", 1: \\"one\\"} Received: - Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} + Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.OrderedMap { -+ 1: \\"one\\", - 2: \\"two\\", -- 1: \\"one\\", - }" + Immutable.OrderedMap { ++ 1: \\"one\\", + 2: \\"two\\", +- 1: \\"one\\", + }" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedSet []).not.toEqual(Immutable.OrderedSet []) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.OrderedSet [] + Immutable.OrderedSet [] Received: - Immutable.OrderedSet []" + Immutable.OrderedSet []" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedSet [1, 2]).not.toEqual(Immutable.OrderedSet [1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.OrderedSet [1, 2] + Immutable.OrderedSet [1, 2] Received: - Immutable.OrderedSet [1, 2]" + Immutable.OrderedSet [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedSet [1, 2]).toEqual(Immutable.OrderedSet [2, 1]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.OrderedSet [2, 1] + Immutable.OrderedSet [2, 1] Received: - Immutable.OrderedSet [1, 2] + Immutable.OrderedSet [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.OrderedSet [ -+ 1, - 2, -- 1, - ]" + Immutable.OrderedSet [ ++ 1, + 2, +- 1, + ]" `; exports[`.toEqual() {pass: false} expect(Immutable.Set []).not.toEqual(Immutable.Set []) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Set [] + Immutable.Set [] Received: - Immutable.Set []" + Immutable.Set []" `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).not.toEqual(Immutable.Set [1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Set [1, 2] + Immutable.Set [1, 2] Received: - Immutable.Set [1, 2]" + Immutable.Set [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).not.toEqual(Immutable.Set [2, 1]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Set [2, 1] + Immutable.Set [2, 1] Received: - Immutable.Set [1, 2]" + Immutable.Set [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).toEqual(Immutable.Set []) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Set [] + Immutable.Set [] Received: - Immutable.Set [1, 2] + Immutable.Set [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received -- 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Set [1, 2, 3] + Immutable.Set [1, 2, 3] Received: - Immutable.Set [1, 2] + Immutable.Set [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Map {\\"b\\" => 0} + Map {\\"b\\" => 0} Received: - Map {\\"a\\" => 0} + Map {\\"a\\" => 0} Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Map {\\"v\\" => 2} + Map {\\"v\\" => 2} Received: - Map {\\"v\\" => 1} + Map {\\"v\\" => 1} Difference: -- Expected -+ Received +- Expected ++ Received - Map { -- \\"v\\" => 2, -+ \\"v\\" => 1, - }" + Map { +- \\"v\\" => 2, ++ \\"v\\" => 1, + }" `; exports[`.toEqual() {pass: false} expect(Map {}).not.toEqual(Map {}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Map {} + Map {} Received: - Map {}" + Map {}" `; exports[`.toEqual() {pass: false} expect(Map {}).toEqual(Set {}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Set {} + Set {} Received: - Map {} + Map {} Difference: - Comparing two different types of values. Expected set but received map." + Comparing two different types of values. Expected set but received map." `; exports[`.toEqual() {pass: false} expect(Map {1 => "one", 2 => "two"}).not.toEqual(Map {1 => "one", 2 => "two"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Map {1 => \\"one\\", 2 => \\"two\\"} + Map {1 => \\"one\\", 2 => \\"two\\"} Received: - Map {1 => \\"one\\", 2 => \\"two\\"}" + Map {1 => \\"one\\", 2 => \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Map {1 => "one", 2 => "two"}).not.toEqual(Map {2 => "two", 1 => "one"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Map {2 => \\"two\\", 1 => \\"one\\"} + Map {2 => \\"two\\", 1 => \\"one\\"} Received: - Map {1 => \\"one\\", 2 => \\"two\\"}" + Map {1 => \\"one\\", 2 => \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Map {1 => "one", 2 => "two"}).toEqual(Map {1 => "one"}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Map {1 => \\"one\\"} + Map {1 => \\"one\\"} Received: - Map {1 => \\"one\\", 2 => \\"two\\"} + Map {1 => \\"one\\", 2 => \\"two\\"} Difference: -- Expected -+ Received +- Expected ++ Received - Map { - 1 => \\"one\\", -+ 2 => \\"two\\", - }" + Map { + 1 => \\"one\\", ++ 2 => \\"two\\", + }" `; exports[`.toEqual() {pass: false} expect(Set {}).not.toEqual(Set {}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Set {} + Set {} Received: - Set {}" + Set {}" `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).not.toEqual(Set {1, 2}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Set {1, 2} + Set {1, 2} Received: - Set {1, 2}" + Set {1, 2}" `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).not.toEqual(Set {2, 1}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Set {2, 1} + Set {2, 1} Received: - Set {1, 2}" + Set {1, 2}" `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).toEqual(Set {}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Set {} + Set {} Received: - Set {1, 2} + Set {1, 2} Difference: -- Expected -+ Received +- Expected ++ Received -- 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) +"expect(received).toEqual(expected) Expected value to equal: - Set {1, 2, 3} + Set {1, 2, 3} Received: - Set {1, 2} + Set {1, 2} Difference: -- Expected -+ Received +- Expected ++ Received - Set { - 1, - 2, -- 3, - }" + Set { + 1, + 2, +- 3, + }" `; exports[`.toEqual() {pass: false} expect(false).toEqual(ObjectContaining {"a": 2}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ObjectContaining {\\"a\\": 2} + ObjectContaining {\\"a\\": 2} Received: - false + false Difference: - Comparing two different types of values. Expected object but received boolean." + Comparing two different types of values. Expected object but received boolean." `; exports[`.toEqual() {pass: false} expect(null).toEqual(undefined) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - undefined + undefined Received: - null + null Difference: - Comparing two different types of values. Expected undefined but received null." + Comparing two different types of values. Expected undefined but received null." `; exports[`.toEqual() {pass: false} expect(true).not.toEqual(Anything) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Anything + Anything Received: - true" + true" `; exports[`.toEqual() {pass: false} expect(true).not.toEqual(true) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - true + true Received: - true" + true" `; exports[`.toEqual() {pass: false} expect(true).toEqual(false) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - false + false Received: - true" + true" `; exports[`.toEqual() {pass: false} expect(undefined).toEqual(Any) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Any + Any Received: - undefined + undefined Difference: - Comparing two different types of values. Expected function but received undefined." + Comparing two different types of values. Expected function but received undefined." `; exports[`.toEqual() {pass: false} expect(undefined).toEqual(Anything) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Anything + Anything Received: - undefined" + undefined" `; exports[`.toHaveLength {pass: false} expect("").toHaveLength(1) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 1 + 1 Received: - \\"\\" + \\"\\" received.length: - 0" + 0" `; exports[`.toHaveLength {pass: false} expect("abc").toHaveLength(66) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 66 + 66 Received: - \\"abc\\" + \\"abc\\" received.length: - 3" + 3" `; exports[`.toHaveLength {pass: false} expect(["a", "b"]).toHaveLength(99) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 99 + 99 Received: - [\\"a\\", \\"b\\"] + [\\"a\\", \\"b\\"] received.length: - 2" + 2" `; exports[`.toHaveLength {pass: false} expect([]).toHaveLength(1) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 1 + 1 Received: - [] + [] received.length: - 0" + 0" `; exports[`.toHaveLength {pass: false} expect([1, 2]).toHaveLength(3) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 3 + 3 Received: - [1, 2] + [1, 2] received.length: - 2" + 2" `; exports[`.toHaveLength {pass: true} expect("").toHaveLength(0) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 0 + 0 Received: - \\"\\" + \\"\\" received.length: - 0" + 0" `; exports[`.toHaveLength {pass: true} expect("abc").toHaveLength(3) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 3 + 3 Received: - \\"abc\\" + \\"abc\\" received.length: - 3" + 3" `; exports[`.toHaveLength {pass: true} expect(["a", "b"]).toHaveLength(2) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 2 + 2 Received: - [\\"a\\", \\"b\\"] + [\\"a\\", \\"b\\"] received.length: - 2" + 2" `; exports[`.toHaveLength {pass: true} expect([]).toHaveLength(0) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 0 + 0 Received: - [] + [] received.length: - 0" + 0" `; exports[`.toHaveLength {pass: true} expect([1, 2]).toHaveLength(2) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 2 + 2 Received: - [1, 2] + [1, 2] received.length: - 2" + 2" `; exports[`.toHaveLength error cases 1`] = ` -"expect(received)[.not].toHaveLength(length) +"expect(received)[.not].toHaveLength(length) Expected value to have a 'length' property that is a number. Received: - {\\"a\\": 9} + {\\"a\\": 9} received.length: - undefined" + undefined" `; exports[`.toHaveLength error cases 2`] = ` -"expect(received)[.not].toHaveLength(length) +"expect(received)[.not].toHaveLength(length) Expected value to have a 'length' property that is a number. Received: - 0 + 0 " `; exports[`.toHaveLength error cases 3`] = ` -"expect(received)[.not].toHaveLength(length) +"expect(received)[.not].toHaveLength(length) Expected value to have a 'length' property that is a number. Received: - undefined + undefined " `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('1') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected path to be a string or an array. Received: - number: 1" +Expected path to be a string or an array. Received: + number: 1" `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('null') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected path to be a string or an array. Received: - null: null" +Expected path to be a string or an array. Received: + null: null" `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('undefined') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected path to be a string or an array. Received: - undefined: undefined" +Expected path to be a string or an array. Received: + undefined: undefined" `; exports[`.toHaveProperty() {error} expect(null).toHaveProperty('a.b') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected object to be an object. Received: - null: null" +Expected object to be an object. Received: + null: null" `; exports[`.toHaveProperty() {error} expect(undefined).toHaveProperty('a') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected object to be an object. Received: - undefined: undefined" +Expected object to be an object. Received: + undefined: undefined" `; exports[`.toHaveProperty() {pass: false} expect("abc").toHaveProperty('a.b.c') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - \\"abc\\" + \\"abc\\" To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" " `; exports[`.toHaveProperty() {pass: false} expect("abc").toHaveProperty('a.b.c', {"a": 5}) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - \\"abc\\" + \\"abc\\" To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" With a value of: - {\\"a\\": 5} + {\\"a\\": 5} " `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d', 2) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} To have a nested property: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] With a value of: - 2 + 2 Received: - 1" + 1" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d', 2) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 2 + 2 Received: - 1" + 1" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.ttt.d', 1) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} To have a nested property: - \\"a.b.ttt.d\\" + \\"a.b.ttt.d\\" With a value of: - 1 + 1 Received: - object.a.b: {\\"c\\": {\\"d\\": 1}}" + object.a.b: {\\"c\\": {\\"d\\": 1}}" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {}}}} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" Received: - object.a.b.c: {}" + object.a.b.c: {}" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('a.b.c.d', 1) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {}}}} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 1 + 1 Received: - object.a.b.c: {}" + object.a.b.c: {}" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": 5}}}).toHaveProperty('a.b', {"c": 4}) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": 5}}} + {\\"a\\": {\\"b\\": {\\"c\\": 5}}} To have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - {\\"c\\": 4} + {\\"c\\": 4} Received: - {\\"c\\": 5} + {\\"c\\": 5} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"c\\": 4, -+ \\"c\\": 5, - }" + Object { +- \\"c\\": 4, ++ \\"c\\": 5, + }" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": 3}}).toHaveProperty('a.b', undefined) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": 3}} + {\\"a\\": {\\"b\\": 3}} To have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - undefined + undefined Received: - 3 + 3 Difference: - Comparing two different types of values. Expected undefined but received number." + Comparing two different types of values. Expected undefined but received number." `; exports[`.toHaveProperty() {pass: false} expect({"a": 1}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - {\\"a\\": 1} + {\\"a\\": 1} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" Received: - object.a: 1" + object.a: 1" `; exports[`.toHaveProperty() {pass: false} expect({"a": 1}).toHaveProperty('a.b.c.d', 5) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": 1} + {\\"a\\": 1} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 5 + 5 Received: - object.a: 1" + object.a: 1" `; exports[`.toHaveProperty() {pass: false} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 2) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 2 + 2 " `; exports[`.toHaveProperty() {pass: false} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 2) 2`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} To have a nested property: - [\\"a.b.c.d\\"] + [\\"a.b.c.d\\"] With a value of: - 2 + 2 Received: - 1" + 1" `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - {} + {} To have a nested property: - \\"a\\" + \\"a\\" " `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a', "a") 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {} + {} To have a nested property: - \\"a\\" + \\"a\\" With a value of: - \\"a\\" + \\"a\\" Received: - undefined + undefined Difference: - Comparing two different types of values. Expected string but received undefined." + Comparing two different types of values. Expected string but received undefined." `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a', "test") 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {} + {} To have a nested property: - \\"a\\" + \\"a\\" With a value of: - \\"test\\" + \\"test\\" " `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('b', undefined) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {} + {} To have a nested property: - \\"b\\" + \\"b\\" With a value of: - undefined + undefined Received: - \\"b\\" + \\"b\\" Difference: - Comparing two different types of values. Expected undefined but received string." + Comparing two different types of values. Expected undefined but received string." `; exports[`.toHaveProperty() {pass: false} expect(1).toHaveProperty('a.b.c') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - 1 + 1 To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" " `; exports[`.toHaveProperty() {pass: false} expect(1).toHaveProperty('a.b.c', "test") 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - 1 + 1 To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" With a value of: - \\"test\\" + \\"test\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": [1, 2, 3]}} + {\\"a\\": {\\"b\\": [1, 2, 3]}} Not to have a nested property: - [\\"a\\", \\"b\\", 1] + [\\"a\\", \\"b\\", 1] " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1', 2) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": [1, 2, 3]}} + {\\"a\\": {\\"b\\": [1, 2, 3]}} Not to have a nested property: - [\\"a\\", \\"b\\", 1] + [\\"a\\", \\"b\\", 1] With a value of: - 2 + 2 " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": 5}}}).toHaveProperty('a.b', {"c": 5}) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": 5}}} + {\\"a\\": {\\"b\\": {\\"c\\": 5}}} Not to have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - {\\"c\\": 5} + {\\"c\\": 5} " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": undefined}}).toHaveProperty('a.b') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": undefined}} + {\\"a\\": {\\"b\\": undefined}} Not to have a nested property: - \\"a.b\\" + \\"a.b\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": undefined}}).toHaveProperty('a.b', undefined) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": undefined}} + {\\"a\\": {\\"b\\": undefined}} Not to have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - undefined + undefined " `; exports[`.toHaveProperty() {pass: true} expect({"a": 0}).toHaveProperty('a') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": 0} + {\\"a\\": 0} Not to have a nested property: - \\"a\\" + \\"a\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": 0}).toHaveProperty('a', 0) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": 0} + {\\"a\\": 0} Not to have a nested property: - \\"a\\" + \\"a\\" With a value of: - 0 + 0 " `; exports[`.toHaveProperty() {pass: true} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} Not to have a nested property: - [\\"a.b.c.d\\"] + [\\"a.b.c.d\\"] " `; exports[`.toHaveProperty() {pass: true} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} Not to have a nested property: - [\\"a.b.c.d\\"] + [\\"a.b.c.d\\"] With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({"property": 1}).toHaveProperty('property', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"property\\": 1} + {\\"property\\": 1} Not to have a nested property: - \\"property\\" + \\"property\\" With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({}).toHaveProperty('a', undefined) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {} + {} Not to have a nested property: - \\"a\\" + \\"a\\" With a value of: - undefined + undefined " `; exports[`.toHaveProperty() {pass: true} expect({}).toHaveProperty('b', "b") 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {} + {} Not to have a nested property: - \\"b\\" + \\"b\\" With a value of: - \\"b\\" + \\"b\\" " `; exports[`.toMatch() {pass: true} expect(Foo bar).toMatch(/^foo/i) 1`] = ` -"expect(received).not.toMatch(expected) +"expect(received).not.toMatch(expected) Expected value not to match: - /^foo/i + /^foo/i Received: - \\"Foo bar\\"" + \\"Foo bar\\"" `; exports[`.toMatch() {pass: true} expect(foo).toMatch(foo) 1`] = ` -"expect(received).not.toMatch(expected) +"expect(received).not.toMatch(expected) Expected value not to match: - \\"foo\\" + \\"foo\\" Received: - \\"foo\\"" + \\"foo\\"" `; exports[`.toMatch() throws if non String actual value passed: [/foo/i, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - regexp: /foo/i" + regexp: /foo/i" `; exports[`.toMatch() throws if non String actual value passed: [[], "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - array: []" + array: []" `; exports[`.toMatch() throws if non String actual value passed: [[Function anonymous], "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.toMatch() throws if non String actual value passed: [{}, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - object: {}" + object: {}" `; exports[`.toMatch() throws if non String actual value passed: [1, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - number: 1" + number: 1" `; exports[`.toMatch() throws if non String actual value passed: [true, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - boolean: true" + boolean: true" `; exports[`.toMatch() throws if non String actual value passed: [undefined, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. -Received: undefined" +string value must be a string. +Received: undefined" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", []] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - array: []" + array: []" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", [Function anonymous]] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", {}] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - object: {}" + object: {}" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", 1] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - number: 1" + number: 1" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", true] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - boolean: true" + boolean: true" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", undefined] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. -Expected: undefined" +expected value must be a string or a regular expression. +Expected: undefined" `; exports[`.toMatch() throws: [bar, /foo/] 1`] = ` -"expect(received).toMatch(expected) +"expect(received).toMatch(expected) Expected value to match: - /foo/ + /foo/ Received: - \\"bar\\"" + \\"bar\\"" `; exports[`.toMatch() throws: [bar, foo] 1`] = ` -"expect(received).toMatch(expected) +"expect(received).toMatch(expected) Expected value to match: - \\"foo\\" + \\"foo\\" Received: - \\"bar\\"" + \\"bar\\"" `; exports[`toMatchObject() {pass: false} expect([0]).toMatchObject([-0]) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - [-0] + [-0] Received: - [0] + [0] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [1, 2, 2] + [1, 2, 2] Received: - [1, 2, 3] + [1, 2, 3] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [2, 3, 1] + [2, 3, 1] Received: - [1, 2, 3] + [1, 2, 3] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [1, 3] + [1, 3] Received: - [1, 2] + [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [Error: bar] + [Error: bar] Received: - [Error: foo] + [Error: foo] Difference: -- Expected -+ Received +- Expected ++ Received -- [Error: bar] -+ [Error: foo]" +- [Error: bar] ++ [Error: foo]" `; exports[`toMatchObject() {pass: false} expect({"a": "a", "c": "d"}).toMatchObject({"a": Any}) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - {\\"a\\": Any} + {\\"a\\": Any} Received: - {\\"a\\": \\"a\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"a\\", \\"c\\": \\"d\\"} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"a\\": Any, -+ \\"a\\": \\"a\\", - }" + Object { +- \\"a\\": Any, ++ \\"a\\": \\"a\\", + }" `; exports[`toMatchObject() {pass: false} expect({"a": "b", "c": "d"}).toMatchObject({"a": "b!", "c": "d"}) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - {\\"a\\": \\"b!\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b!\\", \\"c\\": \\"d\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"e\\": \\"b\\"} + {\\"e\\": \\"b\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": [3]}} + {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": [3]}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} + {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"t\\": {\\"l\\": {\\"r\\": \\"r\\"}}} + {\\"t\\": {\\"l\\": {\\"r\\": \\"r\\"}}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} + {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} Difference: -- Expected -+ Received +- Expected ++ Received - 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": [{"a": "a", "b": "b"}]}).toMatchObject({"a": [{"a": "c"}]}) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - {\\"a\\": [{\\"a\\": \\"c\\"}]} + {\\"a\\": [{\\"a\\": \\"c\\"}]} Received: - {\\"a\\": [{\\"a\\": \\"a\\", \\"b\\": \\"b\\"}]} + {\\"a\\": [{\\"a\\": \\"a\\", \\"b\\": \\"b\\"}]} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": [\\"v\\"]} + {\\"a\\": [\\"v\\"]} Received: - {\\"a\\": [3, 4, \\"v\\"], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, \\"v\\"], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": [3, 4, 5, 6]} + {\\"a\\": [3, 4, 5, 6]} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": [3, 4]} + {\\"a\\": [3, 4]} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": {\\"b\\": 4}} + {\\"a\\": {\\"b\\": 4}} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": {\\"b\\": Any}} + {\\"a\\": {\\"b\\": Any}} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"d\\": {\\"e\\": {\\"f\\": 222}}} + {\\"d\\": {\\"e\\": {\\"f\\": 222}}} Received: - {\\"a\\": 1, \\"b\\": 1, \\"c\\": 1, \\"d\\": {\\"e\\": {\\"f\\": 555}}} + {\\"a\\": 1, \\"b\\": 1, \\"c\\": 1, \\"d\\": {\\"e\\": {\\"f\\": 555}}} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": 2015-10-10T00:00:00.000Z} + {\\"a\\": 2015-10-10T00:00:00.000Z} Received: - {\\"a\\": 2015-11-30T00:00:00.000Z, \\"b\\": \\"b\\"} + {\\"a\\": 2015-11-30T00:00:00.000Z, \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": \\"4\\"} + {\\"a\\": \\"4\\"} Received: - {\\"a\\": null, \\"b\\": \\"b\\"} + {\\"a\\": null, \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {\\"a\\": null, \\"b\\": \\"b\\"} + {\\"a\\": null, \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": null} + {\\"a\\": null} Received: - {\\"a\\": undefined} + {\\"a\\": undefined} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {} + {} Difference: -- Expected -+ Received +- Expected ++ Received -- 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 value to match object: - 2015-10-10T00:00:00.000Z + 2015-10-10T00:00:00.000Z Received: - 2015-11-30T00:00:00.000Z + 2015-11-30T00:00:00.000Z Difference: -- Expected -+ Received +- Expected ++ Received -- 2015-10-10T00:00:00.000Z -+ 2015-11-30T00:00:00.000Z" +- 2015-10-10T00:00:00.000Z ++ 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 value to match object: - Set {2} + Set {2} Received: - Set {1, 2} + Set {1, 2} Difference: -- Expected -+ Received +- Expected ++ Received - Set { -+ 1, - 2, - }" + Set { ++ 1, + 2, + }" `; exports[`toMatchObject() {pass: true} expect([]).toMatchObject([]) 1`] = ` -"expect(received).not.toMatchObject(expected) +"expect(received).not.toMatchObject(expected) Expected value not to match object: - [] + [] Received: - []" + []" `; exports[`toMatchObject() {pass: true} expect([1, 2]).toMatchObject([1, 2]) 1`] = ` -"expect(received).not.toMatchObject(expected) +"expect(received).not.toMatchObject(expected) Expected value not to match object: - [1, 2] + [1, 2] Received: - [1, 2]" + [1, 2]" `; exports[`toMatchObject() {pass: true} expect([Error: bar]).toMatchObject({"message": "bar"}) 1`] = ` @@ -3993,230 +3993,230 @@ Received: `; exports[`toMatchObject() {pass: true} expect([Error: foo]).toMatchObject([Error: foo]) 1`] = ` -"expect(received).not.toMatchObject(expected) +"expect(received).not.toMatchObject(expected) Expected value not to match object: - [Error: foo] + [Error: foo] Received: - [Error: foo]" + [Error: foo]" `; 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 value not to match object: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"}" + {\\"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 value not to match object: - {\\"a\\": \\"b\\"} + {\\"a\\": \\"b\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"}" + {\\"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 value not to match object: - {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": \\"z\\"}} + {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": \\"z\\"}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}}" + {\\"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 value not to match object: - {\\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}}} + {\\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}}" + {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}}" `; 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 value not to match object: - {\\"a\\": [{\\"a\\": \\"a\\"}]} + {\\"a\\": [{\\"a\\": \\"a\\"}]} Received: - {\\"a\\": [{\\"a\\": \\"a\\", \\"b\\": \\"b\\"}]}" + {\\"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 value not to match object: - {\\"a\\": [3, 4, 5, \\"v\\"]} + {\\"a\\": [3, 4, 5, \\"v\\"]} Received: - {\\"a\\": [3, 4, 5, \\"v\\"], \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": [3, 4, 5]} + {\\"a\\": [3, 4, 5]} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": {\\"x\\": Any}} + {\\"a\\": {\\"x\\": Any}} Received: - {\\"a\\": {\\"x\\": \\"x\\", \\"y\\": \\"y\\"}}" + {\\"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 value not to match object: - {\\"a\\": Any} + {\\"a\\": Any} Received: - {\\"a\\": 1, \\"c\\": 2}" + {\\"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 value not to match object: - {\\"a\\": 2015-11-30T00:00:00.000Z} + {\\"a\\": 2015-11-30T00:00:00.000Z} Received: - {\\"a\\": 2015-11-30T00:00:00.000Z, \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": null} + {\\"a\\": null} Received: - {\\"a\\": null, \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {\\"a\\": undefined, \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {\\"a\\": undefined}" + {\\"a\\": undefined}" `; 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 value not to match object: - 2015-11-30T00:00:00.000Z + 2015-11-30T00:00:00.000Z Received: - 2015-11-30T00:00:00.000Z" + 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 value not to match object: - Set {1, 2} + Set {1, 2} Received: - Set {1, 2}" + 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 value not to match object: - Set {2, 1} + Set {2, 1} Received: - Set {1, 2}" + Set {1, 2}" `; exports[`toMatchObject() throws expect("44").toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. +received value must be an object. Received: - string: \\"44\\"" + string: \\"44\\"" `; exports[`toMatchObject() throws expect({}).toMatchObject("some string") 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. +expected value must be an object. Expected: - string: \\"some string\\"" + string: \\"some string\\"" `; exports[`toMatchObject() throws expect({}).toMatchObject(4) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. +expected value must be an object. Expected: - number: 4" + number: 4" `; exports[`toMatchObject() throws expect({}).toMatchObject(null) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. -Expected: null" +expected value must be an object. +Expected: null" `; exports[`toMatchObject() throws expect({}).toMatchObject(true) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. +expected value must be an object. Expected: - boolean: true" + boolean: true" `; exports[`toMatchObject() throws expect({}).toMatchObject(undefined) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. -Expected: undefined" +expected value must be an object. +Expected: undefined" `; exports[`toMatchObject() throws expect(4).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. +received value must be an object. Received: - number: 4" + number: 4" `; exports[`toMatchObject() throws expect(null).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. -Received: null" +received value must be an object. +Received: null" `; exports[`toMatchObject() throws expect(true).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. +received value must be an object. Received: - boolean: true" + boolean: true" `; exports[`toMatchObject() throws expect(undefined).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. -Received: undefined" -`; +received value must be an object. +Received: undefined" +`; \ No newline at end of file diff --git a/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap index 73f19bbda31d..57d0359bbec7 100644 --- a/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap @@ -1,82 +1,82 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`lastCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].lastCalledWith() +"expect(jest.fn())[.not].lastCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`lastCalledWith works when not called 1`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - [\\"foo\\", \\"bar\\"] -But it was not called." + [\\"foo\\", \\"bar\\"] +But it was not called." `; exports[`lastCalledWith works with Immutable.js objects 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" + [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" `; exports[`lastCalledWith works with Map 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [Map {1 => 2, 2 => 1}]" + [Map {1 => 2, 2 => 1}]" `; exports[`lastCalledWith works with Map 2`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." + Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." `; exports[`lastCalledWith works with Set 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [Set {1, 2}]" + [Set {1, 2}]" `; exports[`lastCalledWith works with Set 2`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - Set {3, 4} as argument 1, but it was called with Set {1, 2}." + Set {3, 4} as argument 1, but it was called with Set {1, 2}." `; exports[`lastCalledWith works with arguments that don't match 1`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`lastCalledWith works with arguments that match 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`lastCalledWith works with many arguments 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`lastCalledWith works with many arguments that don't match 1`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar3\\"." + \\"bar\\" as argument 2, but it was called with \\"bar3\\"." `; exports[`lastCalledWith works with trailing undefined arguments 1`] = ` @@ -87,226 +87,226 @@ Expected mock function to have been last called with: `; exports[`toBeCalled works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toBeCalled() +"expect(jest.fn())[.not].toBeCalled() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toBeCalled works with jest.fn 1`] = ` -"expect(jest.fn()).toBeCalled() +"expect(jest.fn()).toBeCalled() Expected mock function to have been called." `; exports[`toBeCalled works with jest.fn 2`] = ` -"expect(jest.fn()).not.toBeCalled() +"expect(jest.fn()).not.toBeCalled() Expected mock function not to be called but it was called with: - []" + []" `; exports[`toBeCalled works with jest.fn 3`] = ` -"expect(received)[.not].toBeCalled() +"expect(received)[.not].toBeCalled() Matcher does not accept any arguments. Got: - number: 555" + number: 555" `; exports[`toBeCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toBeCalledWith() +"expect(jest.fn())[.not].toBeCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalled works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toHaveBeenCalled() +"expect(jest.fn())[.not].toHaveBeenCalled() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalled works with jest.fn 1`] = ` -"expect(jest.fn()).toHaveBeenCalled() +"expect(jest.fn()).toHaveBeenCalled() Expected mock function to have been called." `; exports[`toHaveBeenCalled works with jest.fn 2`] = ` -"expect(jest.fn()).not.toHaveBeenCalled() +"expect(jest.fn()).not.toHaveBeenCalled() Expected mock function not to be called but it was called with: - []" + []" `; exports[`toHaveBeenCalled works with jest.fn 3`] = ` -"expect(received)[.not].toHaveBeenCalled() +"expect(received)[.not].toHaveBeenCalled() Matcher does not accept any arguments. Got: - number: 555" + number: 555" `; exports[`toHaveBeenCalledTimes accepts only numbers 1`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - object: {}" + object: {}" `; exports[`toHaveBeenCalledTimes accepts only numbers 2`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - array: []" + array: []" `; exports[`toHaveBeenCalledTimes accepts only numbers 3`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - boolean: true" + boolean: true" `; exports[`toHaveBeenCalledTimes accepts only numbers 4`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - string: \\"a\\"" + string: \\"a\\"" `; exports[`toHaveBeenCalledTimes accepts only numbers 5`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - map: Map {}" + map: Map {}" `; exports[`toHaveBeenCalledTimes accepts only numbers 6`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`toHaveBeenCalledTimes fails if function called less than expected times 1`] = ` -"expect(jest.fn()).toHaveBeenCalledTimes(2) +"expect(jest.fn()).toHaveBeenCalledTimes(2) -Expected mock function to have been called two times, but it was called one time." +Expected mock function to have been called two times, but it was called one time." `; exports[`toHaveBeenCalledTimes fails if function called more than expected times 1`] = ` -"expect(jest.fn()).toHaveBeenCalledTimes(2) +"expect(jest.fn()).toHaveBeenCalledTimes(2) -Expected mock function to have been called two times, but it was called three times." +Expected mock function to have been called two times, but it was called three times." `; exports[`toHaveBeenCalledTimes passes if function called equal to expected times 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledTimes(2) +"expect(jest.fn()).not.toHaveBeenCalledTimes(2) -Expected mock function not to be called two times, but it was called exactly two times." +Expected mock function not to be called two times, but it was called exactly two times." `; exports[`toHaveBeenCalledTimes verifies that actual is a Spy 1`] = ` -"expect(jest.fn())[.not].toHaveBeenCalledTimes() +"expect(jest.fn())[.not].toHaveBeenCalledTimes() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toHaveBeenCalledWith() +"expect(jest.fn())[.not].toHaveBeenCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalledWith works when not called 1`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - [\\"foo\\", \\"bar\\"] -But it was not called." + [\\"foo\\", \\"bar\\"] +But it was not called." `; exports[`toHaveBeenCalledWith works with Immutable.js objects 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" + [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" `; exports[`toHaveBeenCalledWith works with Map 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [Map {1 => 2, 2 => 1}]" + [Map {1 => 2, 2 => 1}]" `; exports[`toHaveBeenCalledWith works with Map 2`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." + Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." `; exports[`toHaveBeenCalledWith works with Set 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [Set {1, 2}]" + [Set {1, 2}]" `; exports[`toHaveBeenCalledWith works with Set 2`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - Set {3, 4} as argument 1, but it was called with Set {1, 2}." + Set {3, 4} as argument 1, but it was called with Set {1, 2}." `; exports[`toHaveBeenCalledWith works with arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`toHaveBeenCalledWith works with arguments that match 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenCalledWith works with many arguments 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenCalledWith works with many arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - \\"bar\\" as argument 2, but it was called with \\"bar3\\". + \\"bar\\" as argument 2, but it was called with \\"bar3\\". - \\"bar\\" as argument 2, but it was called with \\"bar2\\". + \\"bar\\" as argument 2, but it was called with \\"bar2\\". - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`toHaveBeenCalledWith works with trailing undefined arguments 1`] = ` @@ -317,82 +317,82 @@ Expected mock function to have been called with: `; exports[`toHaveBeenLastCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toHaveBeenLastCalledWith() +"expect(jest.fn())[.not].toHaveBeenLastCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenLastCalledWith works when not called 1`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - [\\"foo\\", \\"bar\\"] -But it was not called." + [\\"foo\\", \\"bar\\"] +But it was not called." `; exports[`toHaveBeenLastCalledWith works with Immutable.js objects 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" + [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" `; exports[`toHaveBeenLastCalledWith works with Map 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [Map {1 => 2, 2 => 1}]" + [Map {1 => 2, 2 => 1}]" `; exports[`toHaveBeenLastCalledWith works with Map 2`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." + Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." `; exports[`toHaveBeenLastCalledWith works with Set 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [Set {1, 2}]" + [Set {1, 2}]" `; exports[`toHaveBeenLastCalledWith works with Set 2`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - Set {3, 4} as argument 1, but it was called with Set {1, 2}." + Set {3, 4} as argument 1, but it was called with Set {1, 2}." `; exports[`toHaveBeenLastCalledWith works with arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`toHaveBeenLastCalledWith works with arguments that match 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenLastCalledWith works with many arguments 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenLastCalledWith works with many arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar3\\"." + \\"bar\\" as argument 2, but it was called with \\"bar3\\"." `; exports[`toHaveBeenLastCalledWith works with trailing undefined arguments 1`] = ` @@ -400,4 +400,4 @@ exports[`toHaveBeenLastCalledWith works with trailing undefined arguments 1`] = Expected mock function to have been last called with: Did not expect argument 2 but it was called with undefined." -`; +`; \ No newline at end of file diff --git a/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap index 33966504aec7..7543f1a61c54 100644 --- a/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap @@ -1,199 +1,199 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`.toThrow() error class did not throw at all 1`] = ` -"expect(function).toThrow(type) +"expect(function).toThrow(type) Expected the function to throw an error of type: - \\"Err\\" + \\"Err\\" But it didn't throw anything." `; exports[`.toThrow() error class threw, but class did not match 1`] = ` -"expect(function).toThrow(type) +"expect(function).toThrow(type) Expected the function to throw an error of type: - \\"Err2\\" + \\"Err2\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() error class threw, but should not have 1`] = ` -"expect(function).not.toThrow(type) +"expect(function).not.toThrow(type) Expected the function not to throw an error of type: - \\"Err\\" + \\"Err\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() invalid actual 1`] = ` -"expect(function).toThrow(undefined) +"expect(function).toThrow(undefined) Received value must be a function, but instead \\"string\\" was found" `; exports[`.toThrow() invalid arguments 1`] = ` -"expect(function).not.toThrow(number) +"expect(function).not.toThrow(number) Unexpected argument passed. -Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". +Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". Got: - string: \\"111\\"" + string: \\"111\\"" `; exports[`.toThrow() regexp did not throw at all 1`] = ` -"expect(function).toThrow(regexp) +"expect(function).toThrow(regexp) Expected the function to throw an error matching: - /apple/ + /apple/ But it didn't throw anything." `; exports[`.toThrow() regexp threw, but message did not match 1`] = ` -"expect(function).toThrow(regexp) +"expect(function).toThrow(regexp) Expected the function to throw an error matching: - /banana/ + /banana/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() regexp threw, but should not have 1`] = ` -"expect(function).not.toThrow(regexp) +"expect(function).not.toThrow(regexp) Expected the function not to throw an error matching: - /apple/ + /apple/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() strings did not throw at all 1`] = ` -"expect(function).toThrow(string) +"expect(function).toThrow(string) Expected the function to throw an error matching: - \\"apple\\" + \\"apple\\" But it didn't throw anything." `; exports[`.toThrow() strings threw, but message did not match 1`] = ` -"expect(function).toThrow(string) +"expect(function).toThrow(string) Expected the function to throw an error matching: - \\"banana\\" + \\"banana\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() strings threw, but should not have 1`] = ` -"expect(function).not.toThrow(string) +"expect(function).not.toThrow(string) Expected the function not to throw an error matching: - \\"apple\\" + \\"apple\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() error class did not throw at all 1`] = ` -"expect(function).toThrowError(type) +"expect(function).toThrowError(type) Expected the function to throw an error of type: - \\"Err\\" + \\"Err\\" But it didn't throw anything." `; exports[`.toThrowError() error class threw, but class did not match 1`] = ` -"expect(function).toThrowError(type) +"expect(function).toThrowError(type) Expected the function to throw an error of type: - \\"Err2\\" + \\"Err2\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() error class threw, but should not have 1`] = ` -"expect(function).not.toThrowError(type) +"expect(function).not.toThrowError(type) Expected the function not to throw an error of type: - \\"Err\\" + \\"Err\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() invalid actual 1`] = ` -"expect(function).toThrowError(undefined) +"expect(function).toThrowError(undefined) Received value must be a function, but instead \\"string\\" was found" `; exports[`.toThrowError() invalid arguments 1`] = ` -"expect(function).not.toThrowError(number) +"expect(function).not.toThrowError(number) Unexpected argument passed. -Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". +Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". Got: - string: \\"111\\"" + string: \\"111\\"" `; exports[`.toThrowError() regexp did not throw at all 1`] = ` -"expect(function).toThrowError(regexp) +"expect(function).toThrowError(regexp) Expected the function to throw an error matching: - /apple/ + /apple/ But it didn't throw anything." `; exports[`.toThrowError() regexp threw, but message did not match 1`] = ` -"expect(function).toThrowError(regexp) +"expect(function).toThrowError(regexp) Expected the function to throw an error matching: - /banana/ + /banana/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() regexp threw, but should not have 1`] = ` -"expect(function).not.toThrowError(regexp) +"expect(function).not.toThrowError(regexp) Expected the function not to throw an error matching: - /apple/ + /apple/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() strings did not throw at all 1`] = ` -"expect(function).toThrowError(string) +"expect(function).toThrowError(string) Expected the function to throw an error matching: - \\"apple\\" + \\"apple\\" But it didn't throw anything." `; exports[`.toThrowError() strings threw, but message did not match 1`] = ` -"expect(function).toThrowError(string) +"expect(function).toThrowError(string) Expected the function to throw an error matching: - \\"banana\\" + \\"banana\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() strings threw, but should not have 1`] = ` -"expect(function).not.toThrowError(string) +"expect(function).not.toThrowError(string) Expected the function not to throw an error matching: - \\"apple\\" + \\"apple\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" -`; + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" +`; \ No newline at end of file diff --git a/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap b/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap index 57879e05ccdb..d5c530f9cf18 100644 --- a/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap +++ b/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap @@ -7,14 +7,14 @@ exports[`SnapshotInteractiveMode updateWithResults overlay handle progress UI 1` [MOCK - cursorUp] [MOCK - eraseDown] -Interactive Snapshot Progress - › 2 suites failed, 1 suite passed - -Watch Usage - › Press u to update failing snapshots for this test. - › Press s to skip the current test suite. - › Press q to quit Interactive Snapshot Update Mode. - › Press Enter to trigger a test run. +Interactive Snapshot Progress + › 2 suites failed, 1 suite passed + +Watch Usage + › Press u to update failing snapshots for this test. + › Press s to skip the current test suite. + › Press q to quit Interactive Snapshot Update Mode. + › Press Enter to trigger a test run. " `; @@ -23,14 +23,14 @@ exports[`SnapshotInteractiveMode updateWithResults with a test failure simply up [MOCK - cursorUp] [MOCK - eraseDown] -Interactive Snapshot Progress - › 1 suite failed +Interactive Snapshot Progress + › 1 suite failed -Watch Usage - › Press u to update failing snapshots for this test. - › Press q to quit Interactive Snapshot Update Mode. - › Press Enter to trigger a test run. +Watch Usage + › Press u to update failing snapshots for this test. + › Press q to quit Interactive Snapshot Update Mode. + › Press Enter to trigger a test run. " `; -exports[`SnapshotInteractiveMode updateWithResults with a test success, call the next test 1`] = `"TEST RESULTS CONTENTS"`; +exports[`SnapshotInteractiveMode updateWithResults with a test success, call the next test 1`] = `"TEST RESULTS CONTENTS"`; \ No newline at end of file diff --git a/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js b/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js index 08b688f77aae..ea07bfc726ee 100644 --- a/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js +++ b/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js @@ -7,78 +7,55 @@ * @flow */ -'use strict'; - -import formatTestNameByPattern from '../format_test_name_by_pattern'; - -describe('for multiline test name returns', () => { - const testNames = [ - 'should\n name the \nfunction you attach', - 'should\r\n name the \r\nfunction you attach', - 'should\r name the \rfunction you attach', - ]; - - it('test name with highlighted pattern and replaced line breaks', () => { - const pattern = 'name'; - - testNames.forEach(testName => { - expect(formatTestNameByPattern(testName, pattern, 36)).toMatchSnapshot(); - }); - }); -}); - -describe('for one line test name', () => { - const testName = 'should name the function you attach'; - - describe('with pattern in the head returns', () => { - const pattern = 'should'; - - it('test name with highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); - }); - - it('test name with cutted tail and highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 30)).toMatchSnapshot(); - }); - - it('test name with cutted tail and cutted highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 8)).toMatchSnapshot(); - }); - }); - - describe('pattern in the middle', () => { - const pattern = 'name'; - - it('test name with highlighted pattern returns', () => { - expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); - }); - - it('test name with cutted tail and highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 25)).toMatchSnapshot(); - }); - - it('test name with cutted tail and cutted highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 13)).toMatchSnapshot(); - }); - - it('test name with highlighted cutted', () => { - expect(formatTestNameByPattern(testName, pattern, 6)).toMatchSnapshot(); - }); - }); - - describe('pattern in the tail returns', () => { - const pattern = 'attach'; - - it('test name with highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); - }); - - it('test name with cutted tail and cutted highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 33)).toMatchSnapshot(); - }); - - it('test name with highlighted cutted', () => { - expect(formatTestNameByPattern(testName, pattern, 6)).toMatchSnapshot(); - }); - }); -}); +import chalk from 'chalk'; + +import colorize from './colorize'; + +const DOTS = '...'; +const ENTER = '⏎'; + +export default (testName: string, pattern: string, width: number) => { + const inlineTestName = testName.replace(/(\r\n|\n|\r)/gm, ENTER); + + let regexp; + + try { + regexp = new RegExp(pattern, 'i'); + } catch (e) { + return chalk.dim(inlineTestName); + } + + const match = inlineTestName.match(regexp); + + if (!match) { + return chalk.dim(inlineTestName); + } + + // $FlowFixMe + const startPatternIndex = Math.max(match.index, 0); + const endPatternIndex = startPatternIndex + match[0].length; + + if (inlineTestName.length <= width) { + return colorize(inlineTestName, startPatternIndex, endPatternIndex); + } + + const slicedTestName = inlineTestName.slice(0, width - DOTS.length); + + if (startPatternIndex < slicedTestName.length) { + if (endPatternIndex > slicedTestName.length) { + return colorize( + slicedTestName + DOTS, + startPatternIndex, + slicedTestName.length + DOTS.length, + ); + } else { + return colorize( + slicedTestName + DOTS, + Math.min(startPatternIndex, slicedTestName.length), + endPatternIndex, + ); + } + } + + return `${chalk.dim(slicedTestName)}${chalk.reset(DOTS)}`; +}; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap index 735c56ff9c78..5dd8bd9902b9 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap @@ -2,24 +2,24 @@ exports[`Retrieves the snapshot status 1`] = ` Array [ - " › 1 snapshot written.", - " › 1 snapshot updated.", - " › 1 obsolete snapshot found.", - " - test suite with unchecked snapshot", - " › 1 snapshot test failed.", + " › 1 snapshot written.", + " › 1 snapshot updated.", + " › 1 obsolete snapshot found.", + " - test suite with unchecked snapshot", + " › 1 snapshot test failed.", ] `; exports[`Retrieves the snapshot status after a snapshot update 1`] = ` Array [ - " › 2 snapshots written.", - " › 2 snapshots updated.", - " › 2 obsolete snapshots removed.", - " - first test suite with unchecked snapshot", - " - second test suite with unchecked snapshot", - " › Obsolete snapshot file removed.", - " › 2 snapshot tests failed.", + " › 2 snapshots written.", + " › 2 snapshots updated.", + " › 2 obsolete snapshots removed.", + " - first test suite with unchecked snapshot", + " - second test suite with unchecked snapshot", + " › Obsolete snapshot file removed.", + " › 2 snapshot tests failed.", ] `; -exports[`Shows no snapshot updates if all snapshots matched 1`] = `Array []`; +exports[`Shows no snapshot updates if all snapshots matched 1`] = `Array []`; \ No newline at end of file diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap index dafc55777837..0a64a48df342 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap @@ -2,39 +2,39 @@ exports[`creates a snapshot summary 1`] = ` Array [ - "Snapshot Summary", - " › 1 snapshot written in 1 test suite.", - " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", - " › 1 snapshot updated in 1 test suite.", - " › 1 obsolete snapshot file found, press --u to remove it.", - " › 1 obsolete snapshot found, press --u to remove it.", + "Snapshot Summary", + " › 1 snapshot written in 1 test suite.", + " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", + " › 1 snapshot updated in 1 test suite.", + " › 1 obsolete snapshot file found, press --u to remove it.", + " › 1 obsolete snapshot found, press --u to remove it.", ] `; exports[`creates a snapshot summary after an update 1`] = ` Array [ - "Snapshot Summary", - " › 1 snapshot written in 1 test suite.", - " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", - " › 1 snapshot updated in 1 test suite.", - " › 1 obsolete snapshot file removed.", - " › 1 obsolete snapshot removed.", + "Snapshot Summary", + " › 1 snapshot written in 1 test suite.", + " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", + " › 1 snapshot updated in 1 test suite.", + " › 1 obsolete snapshot file removed.", + " › 1 obsolete snapshot removed.", ] `; exports[`creates a snapshot summary with multiple snapshot being written/updated 1`] = ` Array [ - "Snapshot Summary", - " › 2 snapshots written in 2 test suites.", - " › 2 snapshot tests failed in 2 test suites. Inspect your code changes or press --u to update them.", - " › 2 snapshots updated in 2 test suites.", - " › 2 obsolete snapshot files found, press --u to remove them..", - " › 2 obsolete snapshots found, press --u to remove them.", + "Snapshot Summary", + " › 2 snapshots written in 2 test suites.", + " › 2 snapshot tests failed in 2 test suites. Inspect your code changes or press --u to update them.", + " › 2 snapshots updated in 2 test suites.", + " › 2 obsolete snapshot files found, press --u to remove them..", + " › 2 obsolete snapshots found, press --u to remove them.", ] `; exports[`returns nothing if there are no updates 1`] = ` Array [ - "Snapshot Summary", + "Snapshot Summary", ] -`; +`; \ No newline at end of file diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap index 5b0c9b3800dc..338541f969b8 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap @@ -1,25 +1,25 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`snapshots needs update with npm test 1`] = ` -"Snapshot Summary - › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`npm test -- -u\` to update them. +"Snapshot Summary + › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`npm test -- -u\` to update them. -Test Suites: 1 failed, 1 total -Tests: 1 failed, 1 total -Snapshots: 2 failed, 2 total -Time: 0.01s -Ran all test suites. +Test Suites: 1 failed, 1 total +Tests: 1 failed, 1 total +Snapshots: 2 failed, 2 total +Time: 0.01s +Ran all test suites. " `; exports[`snapshots needs update with yarn test 1`] = ` -"Snapshot Summary - › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`yarn test -u\` to update them. +"Snapshot Summary + › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`yarn test -u\` to update them. -Test Suites: 1 failed, 1 total -Tests: 1 failed, 1 total -Snapshots: 2 failed, 2 total -Time: 0.01s -Ran all test suites. +Test Suites: 1 failed, 1 total +Tests: 1 failed, 1 total +Snapshots: 2 failed, 2 total +Time: 0.01s +Ran all test suites. " -`; +`; \ No newline at end of file diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap index d063c2f9bfc8..103cfb815e4a 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap @@ -1,23 +1,23 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`trimAndFormatPath() does not trim anything 1`] = `"1234567890/1234567890/1234.js"`; +exports[`trimAndFormatPath() does not trim anything 1`] = `"1234567890/1234567890/1234.js"`; -exports[`trimAndFormatPath() split at the path.sep index 1`] = `".../1234.js"`; +exports[`trimAndFormatPath() split at the path.sep index 1`] = `".../1234.js"`; -exports[`trimAndFormatPath() trims dirname (longer line width) 1`] = `"...890/1234567890/1234.js"`; +exports[`trimAndFormatPath() trims dirname (longer line width) 1`] = `"...890/1234567890/1234.js"`; -exports[`trimAndFormatPath() trims dirname 1`] = `"...234567890/1234.js"`; +exports[`trimAndFormatPath() trims dirname 1`] = `"...234567890/1234.js"`; -exports[`trimAndFormatPath() trims dirname and basename 1`] = `"...1234.js"`; +exports[`trimAndFormatPath() trims dirname and basename 1`] = `"...1234.js"`; exports[`wrapAnsiString() returns the string unaltered if given a terminal width of zero 1`] = `"This string shouldn't cause you any trouble"`; exports[`wrapAnsiString() returns the string unaltered if given a terminal width of zero 2`] = `"This string shouldn't cause you any trouble"`; exports[`wrapAnsiString() wraps a long string containing ansi chars 1`] = ` -"abcde red- -bold 12344 -56bcd 123t +"abcde red- +bold 12344 +56bcd 123t tttttththt hththththt hththththt @@ -25,8 +25,8 @@ hththththt hthththtet etetetette tetetetete -tetetestnh -snthsnthss +tetetestnh +snthsnthss ot" `; @@ -44,4 +44,4 @@ tetetetete tetetestnh snthsnthss ot" -`; +`; \ No newline at end of file diff --git a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap index d61ef3cce67d..d466da778134 100644 --- a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap +++ b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap @@ -1,73 +1,73 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Upgrade help logs a warning when \`scriptPreprocessor\` and/or \`preprocessorIgnorePatterns\` are used 1`] = ` -"● Deprecation Warning: - - Option \\"preprocessorIgnorePatterns\\" was replaced by \\"transformIgnorePatterns\\", which support multiple preprocessors. - - Jest now treats your current configuration as: - { - \\"transformIgnorePatterns\\": [\\"bar/baz\\", \\"qux/quux\\"] - } - - Please update your configuration. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +" Deprecation Warning: + + Option \\"preprocessorIgnorePatterns\\" was replaced by \\"transformIgnorePatterns\\", which support multiple preprocessors. + + Jest now treats your current configuration as: + { + \\"transformIgnorePatterns\\": [\\"bar/baz\\", \\"qux/quux\\"] + } + + Please update your configuration. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`preset throws when preset is invalid 1`] = ` -"● Validation Error: - - Preset react-native is invalid: - Unexpected token } in JSON at position 104 - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"Validation Error: + + Preset react-native is invalid: + Unexpected token } in JSON at position 104 + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`preset throws when preset not found 1`] = ` -"● Validation Error: - - Preset doesnt-exist not found. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"Validation Error: + + Preset doesnt-exist not found. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`rootDir throws if the options is missing a rootDir property 1`] = ` -"● Validation Error: - - Configuration option rootDir must be specified. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"Validation Error: + + Configuration option rootDir must be specified. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`testEnvironment throws on invalid environment names 1`] = ` -"● Validation Error: - - Test environment phantom cannot be found. Make sure the testEnvironment configuration option points to an existing node module. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"Validation Error: + + Test environment phantom cannot be found. Make sure the testEnvironment configuration option points to an existing node module. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`testMatch throws if testRegex and testMatch are both specified 1`] = ` -"● Validation Error: - - Configuration options testMatch and testRegex cannot be used together. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"Validation Error: + + Configuration options testMatch and testRegex cannot be used together. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; -exports[`testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; +exports[`testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; -exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; +exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; \ No newline at end of file diff --git a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap index f2e4a904697a..fc0d5efbd332 100644 --- a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap +++ b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap @@ -1,210 +1,210 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`background color of spaces cyan for inchanged (expanded) 1`] = ` -"- Expected -+ Received - -
-+

- - following string consists of a space: - - line has preceding space only - line has both preceding and following space - line has following space only - -+

-
" +"- Expected ++ Received + +
++

+ + following string consists of a space: + + line has preceding space only + line has both preceding and following space + line has following space only + ++

+
" `; exports[`background color of spaces green for removed (expanded) 1`] = ` -"- Expected -+ Received - -
- -- following string consists of a space: -- -- line has preceding space only -- line has both preceding and following space -- line has following space only -+ - -
" +"- Expected ++ Received + +
+ +- following string consists of a space: +- +- line has preceding space only +- line has both preceding and following space +- line has following space only ++ + +
" `; exports[`background color of spaces red for added (expanded) 1`] = ` -"- Expected -+ Received - -
- -- -+ following string consists of a space: -+ -+ line has preceding space only -+ line has both preceding and following space -+ line has following space only - -
" +"- Expected ++ Received + +
+ +- ++ following string consists of a space: ++ ++ line has preceding space only ++ line has both preceding and following space ++ line has following space only + +
" `; exports[`background color of spaces yellow for unchanged (expanded) 1`] = ` -"- Expected -+ Received - -
-- -+

- following string consists of a space: - - line has preceding space only - line has both preceding and following space - line has following space only -- -+

-
" +"- Expected ++ Received + +
+- ++

+ following string consists of a space: + + line has preceding space only + line has both preceding and following space + line has following space only +- ++

+
" `; exports[`collapses big diffs to patch format 1`] = ` -"- Expected -+ Received - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`color of text (expanded) 1`] = ` -"- Expected -+ Received - - Object { - \\"searching\\": \\"\\", -- \\"sorting\\": Object { -+ \\"sorting\\": Array [ -+ Object { - \\"descending\\": false, - \\"fieldKey\\": \\"what\\", - }, -+ ], - }" +"- Expected ++ Received + + Object { + \\"searching\\": \\"\\", +- \\"sorting\\": Object { ++ \\"sorting\\": Array [ ++ Object { + \\"descending\\": false, + \\"fieldKey\\": \\"what\\", + }, ++ ], + }" `; exports[`context number of lines: -1 (5 default) 1`] = ` -"- Expected -+ Received - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`context number of lines: 0 1`] = ` -"- Expected -+ Received +"- Expected ++ Received -@@ -11,0 +11,1 @@ -+ 10, -@@ -12,1 +13,0 @@ -- 10," +@@ -11,0 +11,1 @@ ++ 10, +@@ -12,1 +13,0 @@ +- 10," `; exports[`context number of lines: 1 1`] = ` -"- Expected -+ Received - -@@ -10,4 +10,4 @@ - 8, -+ 10, - 9, -- 10, - ]," +"- Expected ++ Received + +@@ -10,4 +10,4 @@ + 8, ++ 10, + 9, +- 10, + ]," `; exports[`context number of lines: 2 1`] = ` -"- Expected -+ Received - -@@ -9,6 +9,6 @@ - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -9,6 +9,6 @@ + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`context number of lines: null (5 default) 1`] = ` -"- Expected -+ Received - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`falls back to not call toJSON if it throws and then objects have differences 1`] = ` -"- Expected -+ Received - - Object { -- \\"line\\": 1, -+ \\"line\\": 2, - \\"toJSON\\": [Function toJSON], - }" +"- Expected ++ Received + + Object { +- \\"line\\": 1, ++ \\"line\\": 2, + \\"toJSON\\": [Function toJSON], + }" `; exports[`falls back to not call toJSON if serialization has no differences but then objects have differences 1`] = ` -"Compared values serialize to the same structure. -Printing internal object structure without calling \`toJSON\` instead. +"Compared values serialize to the same structure. +Printing internal object structure without calling \`toJSON\` instead. -- Expected -+ Received +- Expected ++ Received - Object { -- \\"line\\": 1, -+ \\"line\\": 2, - \\"toJSON\\": [Function toJSON], - }" + Object { +- \\"line\\": 1, ++ \\"line\\": 2, + \\"toJSON\\": [Function toJSON], + }" `; exports[`highlight only the last in odd length of leading spaces (expanded) 1`] = ` -"- Expected -+ Received - -
--   attributes.reduce(function (props, attribute) {
--    props[attribute.name] = attribute.value;
-+   attributes.reduce((props, {name, value}) => {
-+   props[name] = value;
-    return props;
--  }, {});
-+ }, {});
-  
" -`; +"- Expected ++ Received + +
+-   attributes.reduce(function (props, attribute) {
+-    props[attribute.name] = attribute.value;
++   attributes.reduce((props, {name, value}) => {
++   props[name] = value;
+    return props;
+-  }, {});
++ }, {});
+  
" +`; \ No newline at end of file diff --git a/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap index ffb7743af5ed..75ec0765f3a3 100644 --- a/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap @@ -1,10 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`matchers proxies matchers to expect 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - 2 + 2 Received: - 1" -`; + 1" +`; \ No newline at end of file diff --git a/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap b/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap index 8970f4e993db..6dd5b8844bb7 100644 --- a/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap +++ b/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap @@ -5,21 +5,21 @@ exports[`.stringify() reduces maxDepth if stringifying very large objects 1`] = exports[`.stringify() reduces maxDepth if stringifying very large objects 2`] = `"{\\"a\\": 1, \\"b\\": {\\"0\\": \\"test\\", \\"1\\": \\"test\\", \\"2\\": \\"test\\", \\"3\\": \\"test\\", \\"4\\": \\"test\\", \\"5\\": \\"test\\", \\"6\\": \\"test\\", \\"7\\": \\"test\\", \\"8\\": \\"test\\", \\"9\\": \\"test\\"}}"`; exports[`.stringify() toJSON errors when comparing two objects 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - {\\"b\\": 1, \\"toJSON\\": [Function toJSON]} + {\\"b\\": 1, \\"toJSON\\": [Function toJSON]} Received: - {\\"a\\": 1, \\"toJSON\\": [Function toJSON]} + {\\"a\\": 1, \\"toJSON\\": [Function toJSON]} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"b\\": 1, -+ \\"a\\": 1, - \\"toJSON\\": [Function toJSON], - }" -`; + Object { +- \\"b\\": 1, ++ \\"a\\": 1, + \\"toJSON\\": [Function toJSON], + }" +`; \ No newline at end of file diff --git a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap index 2d79ba387112..63132b20b0fd 100644 --- a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap +++ b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`.formatExecError() 1`] = ` -" ● Test suite failed to run +" ● Test suite failed to run Whoops! " `; exports[`formatStackTrace should strip node internals 1`] = ` -" ● Unix test +" Unix test Expected value to be of type: @@ -17,19 +17,19 @@ exports[`formatStackTrace should strip node internals 1`] = ` \\"\\" type: \\"string\\" - - - at Object.it (__tests__/test.js:8:14) - + + + at Object.it (__tests__/test.js:8:14) + " `; exports[`should exclude jasmine from stack trace for Unix paths. 1`] = ` -" ● Unix test +" Unix test at stack (../jest-jasmine2/build/jasmine-2.4.1.js:1580:17) - - at Object.addResult (../jest-jasmine2/build/jasmine-2.4.1.js:1550:14) - at Object.it (build/__tests__/messages-test.js:45:41) + + at Object.addResult (../jest-jasmine2/build/jasmine-2.4.1.js:1550:14) + at Object.it (build/__tests__/messages-test.js:45:41) " -`; +`; \ No newline at end of file diff --git a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap index af77f3aca1ee..b4587c314bcb 100644 --- a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap +++ b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap @@ -1,138 +1,138 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`displays warning for deprecated config options 1`] = ` -"● Deprecation Warning: - - Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. - - Jest now treats your current configuration as: - { - \\"transform\\": {\\".*\\": \\"test\\"} - } - - Please update your configuration. -" +" Deprecation Warning: + + Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. + + Jest now treats your current configuration as: + { + \\"transform\\": {\\".*\\": \\"test\\"} + } + + Please update your configuration. +" `; exports[`displays warning for unknown config options 1`] = ` -"● Validation Warning: - - Unknown option \\"unkwon\\" with value {} was found. Did you mean \\"unknown\\"? - This is probably a typing mistake. Fixing it will remove this message. -" +" Validation Warning: + + Unknown option \\"unkwon\\" with value {} was found. Did you mean \\"unknown\\"? + This is probably a typing mistake. Fixing it will remove this message. +" `; exports[`pretty prints valid config for Array 1`] = ` -"● Validation Error: - - Option \\"coverageReporters\\" must be of type: - array - but instead received: - object - - Example: - { - \\"coverageReporters\\": [\\"json\\", \\"text\\", \\"lcov\\", \\"clover\\"] - } -" +" Validation Error: + + Option \\"coverageReporters\\" must be of type: + array + but instead received: + object + + Example: + { + \\"coverageReporters\\": [\\"json\\", \\"text\\", \\"lcov\\", \\"clover\\"] + } +" `; exports[`pretty prints valid config for Boolean 1`] = ` -"● Validation Error: - - Option \\"automock\\" must be of type: - boolean - but instead received: - array - - Example: - { - \\"automock\\": false - } -" +" Validation Error: + + Option \\"automock\\" must be of type: + boolean + but instead received: + array + + Example: + { + \\"automock\\": false + } +" `; exports[`pretty prints valid config for Function 1`] = ` -"● Validation Error: - - Option \\"fn\\" must be of type: - function - but instead received: - string - - Example: - { - \\"fn\\": (config, option, deprecatedOptions) => true - } -" +" Validation Error: + + Option \\"fn\\" must be of type: + function + but instead received: + string + + Example: + { + \\"fn\\": (config, option, deprecatedOptions) => true + } +" `; exports[`pretty prints valid config for Object 1`] = ` -"● Validation Error: - - Option \\"haste\\" must be of type: - object - but instead received: - number - - Example: - { - \\"haste\\": {\\"providesModuleNodeModules\\": [\\"react\\", \\"react-native\\"]} - } -" +" Validation Error: + + Option \\"haste\\" must be of type: + object + but instead received: + number + + Example: + { + \\"haste\\": {\\"providesModuleNodeModules\\": [\\"react\\", \\"react-native\\"]} + } +" `; exports[`pretty prints valid config for String 1`] = ` -"● Validation Error: - - Option \\"preset\\" must be of type: - string - but instead received: - number - - Example: - { - \\"preset\\": \\"react-native\\" - } -" +" Validation Error: + + Option \\"preset\\" must be of type: + string + but instead received: + number + + Example: + { + \\"preset\\": \\"react-native\\" + } +" `; exports[`works with custom deprecations 1`] = ` -"My Custom Deprecation Warning: - - Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. - - Jest now treats your current configuration as: - { - \\"transform\\": {\\".*\\": \\"test\\"} - } - - Please update your configuration. - -My custom comment" +"My Custom Deprecation Warning: + + Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. + + Jest now treats your current configuration as: + { + \\"transform\\": {\\".*\\": \\"test\\"} + } + + Please update your configuration. + +My custom comment" `; exports[`works with custom errors 1`] = ` -"My Custom Error: - - Option \\"test\\" must be of type: - array - but instead received: - string - - Example: - { - \\"test\\": [1, 2] - } - -My custom comment" +"My Custom Error: + + Option \\"test\\" must be of type: + array + but instead received: + string + + Example: + { + \\"test\\": [1, 2] + } + +My custom comment" `; exports[`works with custom warnings 1`] = ` -"My Custom Warning: - - Unknown option \\"unknown\\" with value \\"string\\" was found. - This is probably a typing mistake. Fixing it will remove this message. - -My custom comment" -`; +"My Custom Warning: + + Unknown option \\"unknown\\" with value \\"string\\" was found. + This is probably a typing mistake. Fixing it will remove this message. + +My custom comment" +`; \ No newline at end of file diff --git a/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap index f244b8e2570b..178837444409 100644 --- a/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap +++ b/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap @@ -1,22 +1,22 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`fails for multiple unknown options 1`] = ` -"● Unrecognized CLI Parameters: - - Following options were not recognized: - [\\"jest\\", \\"test\\"] - - CLI Options Documentation: - https://facebook.github.io/jest/docs/en/cli.html -" +" Unrecognized CLI Parameters: + + Following options were not recognized: + [\\"jest\\", \\"test\\"] + + CLI Options Documentation: + https://facebook.github.io/jest/docs/en/cli.html +" `; exports[`fails for unknown option 1`] = ` -"● Unrecognized CLI Parameter: - - Unrecognized option \\"unknown\\". - - CLI Options Documentation: - https://facebook.github.io/jest/docs/en/cli.html -" -`; +" Unrecognized CLI Parameter: + + Unrecognized option \\"unknown\\". + + CLI Options Documentation: + https://facebook.github.io/jest/docs/en/cli.html +" +`; \ No newline at end of file From d5aa61308d61b956dfcf3a17e4dd36de29cfa01d Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 22:30:24 -0500 Subject: [PATCH 49/97] fix: adds missing cli snapshot --- .../format_test_name_by_pattern.test.js.snap | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap b/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap index 9051a1b9174d..7b0a66d21785 100644 --- a/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap +++ b/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap @@ -1,27 +1,27 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 1`] = `"should⏎ name the ⏎function you at..."`; +exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 1`] = `"should⏎ name the ⏎function you at..."`; -exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 2`] = `"should⏎ name the ⏎function you at..."`; +exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 2`] = `"should⏎ name the ⏎function you at..."`; -exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 3`] = `"should⏎ name the ⏎function you at..."`; +exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 3`] = `"should⏎ name the ⏎function you at..."`; -exports[`for one line test name pattern in the middle test name with cutted tail and cutted highlighted pattern 1`] = `"should nam..."`; +exports[`for one line test name pattern in the middle test name with cutted tail and cutted highlighted pattern 1`] = `"should nam..."`; -exports[`for one line test name pattern in the middle test name with cutted tail and highlighted pattern 1`] = `"should name the functi..."`; +exports[`for one line test name pattern in the middle test name with cutted tail and highlighted pattern 1`] = `"should name the functi..."`; -exports[`for one line test name pattern in the middle test name with highlighted cutted 1`] = `"sho..."`; +exports[`for one line test name pattern in the middle test name with highlighted cutted 1`] = `"sho..."`; -exports[`for one line test name pattern in the middle test name with highlighted pattern returns 1`] = `"should name the function you attach"`; +exports[`for one line test name pattern in the middle test name with highlighted pattern returns 1`] = `"should name the function you attach"`; -exports[`for one line test name pattern in the tail returns test name with cutted tail and cutted highlighted pattern 1`] = `"should name the function you a..."`; +exports[`for one line test name pattern in the tail returns test name with cutted tail and cutted highlighted pattern 1`] = `"should name the function you a..."`; -exports[`for one line test name pattern in the tail returns test name with highlighted cutted 1`] = `"sho..."`; +exports[`for one line test name pattern in the tail returns test name with highlighted cutted 1`] = `"sho..."`; -exports[`for one line test name pattern in the tail returns test name with highlighted pattern 1`] = `"should name the function you attach"`; +exports[`for one line test name pattern in the tail returns test name with highlighted pattern 1`] = `"should name the function you attach"`; -exports[`for one line test name with pattern in the head returns test name with cutted tail and cutted highlighted pattern 1`] = `"shoul..."`; +exports[`for one line test name with pattern in the head returns test name with cutted tail and cutted highlighted pattern 1`] = `"shoul..."`; -exports[`for one line test name with pattern in the head returns test name with cutted tail and highlighted pattern 1`] = `"should name the function yo..."`; +exports[`for one line test name with pattern in the head returns test name with cutted tail and highlighted pattern 1`] = `"should name the function yo..."`; -exports[`for one line test name with pattern in the head returns test name with highlighted pattern 1`] = `"should name the function you attach"`; +exports[`for one line test name with pattern in the head returns test name with highlighted pattern 1`] = `"should name the function you attach"`; \ No newline at end of file From 0a560ed253b7386dd8741b693121a68eec92a6d8 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 22:47:19 -0500 Subject: [PATCH 50/97] fix: bad snap commit --- .../__tests__/__snapshots__/globals.test.js.snap | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 8faacd6dd137..fc640eca0c36 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -26,7 +26,6 @@ exports[`cannot test with no implementation 1`] = ` Missing second argument. It must be a callback function. -<<<<<<< HEAD 1 | 2 | it('it', () => {}); > 3 | it('it, no implementation'); @@ -34,16 +33,6 @@ exports[`cannot test with no implementation 1`] = ` 5 | at packages/jest-jasmine2/build/jasmine/Env.js:433:15 -======= - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | - 436 | } - - ->>>>>>> 0728d30e0864d3c2052f9d46715839b0ea96fab6 at __tests__/only-constructs.test.js:3:5 " From 911c6e12160379f5d68fabbe0a44a280cbe7e903 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 22:53:16 -0500 Subject: [PATCH 51/97] fix: format test name bad commit --- .../format_test_name_by_pattern.test.js.snap | 2 +- .../format_test_name_by_pattern.test.js | 127 +++++++++++------- 2 files changed, 76 insertions(+), 53 deletions(-) diff --git a/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap b/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap index 7b0a66d21785..64210a3277f4 100644 --- a/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap +++ b/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap @@ -24,4 +24,4 @@ exports[`for one line test name with pattern in the head returns test name with exports[`for one line test name with pattern in the head returns test name with cutted tail and highlighted pattern 1`] = `"should name the function yo..."`; -exports[`for one line test name with pattern in the head returns test name with highlighted pattern 1`] = `"should name the function you attach"`; \ No newline at end of file +exports[`for one line test name with pattern in the head returns test name with highlighted pattern 1`] = `"should name the function you attach"`; diff --git a/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js b/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js index ea07bfc726ee..08b688f77aae 100644 --- a/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js +++ b/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js @@ -7,55 +7,78 @@ * @flow */ -import chalk from 'chalk'; - -import colorize from './colorize'; - -const DOTS = '...'; -const ENTER = '⏎'; - -export default (testName: string, pattern: string, width: number) => { - const inlineTestName = testName.replace(/(\r\n|\n|\r)/gm, ENTER); - - let regexp; - - try { - regexp = new RegExp(pattern, 'i'); - } catch (e) { - return chalk.dim(inlineTestName); - } - - const match = inlineTestName.match(regexp); - - if (!match) { - return chalk.dim(inlineTestName); - } - - // $FlowFixMe - const startPatternIndex = Math.max(match.index, 0); - const endPatternIndex = startPatternIndex + match[0].length; - - if (inlineTestName.length <= width) { - return colorize(inlineTestName, startPatternIndex, endPatternIndex); - } - - const slicedTestName = inlineTestName.slice(0, width - DOTS.length); - - if (startPatternIndex < slicedTestName.length) { - if (endPatternIndex > slicedTestName.length) { - return colorize( - slicedTestName + DOTS, - startPatternIndex, - slicedTestName.length + DOTS.length, - ); - } else { - return colorize( - slicedTestName + DOTS, - Math.min(startPatternIndex, slicedTestName.length), - endPatternIndex, - ); - } - } - - return `${chalk.dim(slicedTestName)}${chalk.reset(DOTS)}`; -}; +'use strict'; + +import formatTestNameByPattern from '../format_test_name_by_pattern'; + +describe('for multiline test name returns', () => { + const testNames = [ + 'should\n name the \nfunction you attach', + 'should\r\n name the \r\nfunction you attach', + 'should\r name the \rfunction you attach', + ]; + + it('test name with highlighted pattern and replaced line breaks', () => { + const pattern = 'name'; + + testNames.forEach(testName => { + expect(formatTestNameByPattern(testName, pattern, 36)).toMatchSnapshot(); + }); + }); +}); + +describe('for one line test name', () => { + const testName = 'should name the function you attach'; + + describe('with pattern in the head returns', () => { + const pattern = 'should'; + + it('test name with highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); + }); + + it('test name with cutted tail and highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 30)).toMatchSnapshot(); + }); + + it('test name with cutted tail and cutted highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 8)).toMatchSnapshot(); + }); + }); + + describe('pattern in the middle', () => { + const pattern = 'name'; + + it('test name with highlighted pattern returns', () => { + expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); + }); + + it('test name with cutted tail and highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 25)).toMatchSnapshot(); + }); + + it('test name with cutted tail and cutted highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 13)).toMatchSnapshot(); + }); + + it('test name with highlighted cutted', () => { + expect(formatTestNameByPattern(testName, pattern, 6)).toMatchSnapshot(); + }); + }); + + describe('pattern in the tail returns', () => { + const pattern = 'attach'; + + it('test name with highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); + }); + + it('test name with cutted tail and cutted highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 33)).toMatchSnapshot(); + }); + + it('test name with highlighted cutted', () => { + expect(formatTestNameByPattern(testName, pattern, 6)).toMatchSnapshot(); + }); + }); +}); From 07a51fb17e80f6f481db37118cc17db63c3166e3 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 20 Feb 2018 09:51:22 -0500 Subject: [PATCH 52/97] fix: adds back trailing newline --- packages/expect/src/__tests__/__snapshots__/extend.test.js.snap | 2 +- .../expect/src/__tests__/__snapshots__/matchers.test.js.snap | 2 +- .../src/__tests__/__snapshots__/spy_matchers.test.js.snap | 2 +- .../src/__tests__/__snapshots__/to_throw_matchers.test.js.snap | 2 +- .../__snapshots__/snapshot_interactive_mode.test.js.snap | 2 +- .../__tests__/__snapshots__/get_snapshot_status.test.js.snap | 2 +- .../__tests__/__snapshots__/get_snapshot_summary.test.js.snap | 2 +- .../__tests__/__snapshots__/summary_reporter.test.js.snap | 2 +- .../src/reporters/__tests__/__snapshots__/utils.test.js.snap | 2 +- .../src/__tests__/__snapshots__/normalize.test.js.snap | 2 +- .../jest-diff/src/__tests__/__snapshots__/diff.test.js.snap | 2 +- .../src/__tests__/__snapshots__/matchers.test.js.snap | 2 +- .../src/__tests__/__snapshots__/index.test.js.snap | 2 +- .../src/__tests__/__snapshots__/messages.test.js.snap | 2 +- .../src/__tests__/__snapshots__/validate.test.js.snap | 2 +- .../__tests__/__snapshots__/validate_cli_options.test.js.snap | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap b/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap index a9d13ec56996..7565cb732261 100644 --- a/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap @@ -2,4 +2,4 @@ exports[`is available globally 1`] = `"expected 15 to be divisible by 2"`; -exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`; \ No newline at end of file +exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`; diff --git a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap index d22487ff6113..88231feef9a7 100644 --- a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap @@ -4219,4 +4219,4 @@ exports[`toMatchObject() throws expect(undefined).toMatchObject({}) 1`] = ` received value must be an object. Received: undefined" -`; \ No newline at end of file +`; diff --git a/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap index 57d0359bbec7..484e8f52260e 100644 --- a/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap @@ -400,4 +400,4 @@ exports[`toHaveBeenLastCalledWith works with trailing undefined arguments 1`] = Expected mock function to have been last called with: Did not expect argument 2 but it was called with undefined." -`; \ No newline at end of file +`; diff --git a/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap index 7543f1a61c54..3c7fd01c7f58 100644 --- a/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap @@ -196,4 +196,4 @@ Expected the function not to throw an error matching: Instead, it threw: Error at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" -`; \ No newline at end of file +`; diff --git a/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap b/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap index d5c530f9cf18..fd47bf1ef31f 100644 --- a/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap +++ b/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap @@ -33,4 +33,4 @@ exports[`SnapshotInteractiveMode updateWithResults with a test failure simply up " `; -exports[`SnapshotInteractiveMode updateWithResults with a test success, call the next test 1`] = `"TEST RESULTS CONTENTS"`; \ No newline at end of file +exports[`SnapshotInteractiveMode updateWithResults with a test success, call the next test 1`] = `"TEST RESULTS CONTENTS"`; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap index 5dd8bd9902b9..45a0d0760608 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap @@ -22,4 +22,4 @@ Array [ ] `; -exports[`Shows no snapshot updates if all snapshots matched 1`] = `Array []`; \ No newline at end of file +exports[`Shows no snapshot updates if all snapshots matched 1`] = `Array []`; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap index 0a64a48df342..ceb2aa87d21b 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap @@ -37,4 +37,4 @@ exports[`returns nothing if there are no updates 1`] = ` Array [ "Snapshot Summary", ] -`; \ No newline at end of file +`; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap index 338541f969b8..55fb2f7428f7 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap @@ -22,4 +22,4 @@ exports[`snapshots needs update with yarn test 1`] = ` Time: 0.01s Ran all test suites. " -`; \ No newline at end of file +`; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap index 103cfb815e4a..4c7556f9f5f0 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap @@ -44,4 +44,4 @@ tetetetete tetetestnh snthsnthss ot" -`; \ No newline at end of file +`; diff --git a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap index d466da778134..b3c6e240ddd7 100644 --- a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap +++ b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap @@ -70,4 +70,4 @@ exports[`testMatch throws if testRegex and testMatch are both specified 1`] = ` exports[`testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; -exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; \ No newline at end of file +exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; diff --git a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap index fc0d5efbd332..e6dc7169be86 100644 --- a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap +++ b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap @@ -207,4 +207,4 @@ exports[`highlight only the last in odd length of leading spaces (expanded) 1`] - }, {}); + }, {}); " -`; \ No newline at end of file +`; diff --git a/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap index 75ec0765f3a3..d94175512f98 100644 --- a/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap @@ -7,4 +7,4 @@ Expected value to be: 2 Received: 1" -`; \ No newline at end of file +`; diff --git a/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap b/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap index 6dd5b8844bb7..7a8565648a34 100644 --- a/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap +++ b/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap @@ -22,4 +22,4 @@ Difference: + \\"a\\": 1, \\"toJSON\\": [Function toJSON], }" -`; \ No newline at end of file +`; diff --git a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap index 63132b20b0fd..b4ebdf847fe3 100644 --- a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap +++ b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap @@ -32,4 +32,4 @@ exports[`should exclude jasmine from stack trace for Unix paths. 1`] = ` at Object.addResult (../jest-jasmine2/build/jasmine-2.4.1.js:1550:14) at Object.it (build/__tests__/messages-test.js:45:41) " -`; \ No newline at end of file +`; diff --git a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap index b4587c314bcb..de79961455f5 100644 --- a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap +++ b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap @@ -135,4 +135,4 @@ exports[`works with custom warnings 1`] = ` This is probably a typing mistake. Fixing it will remove this message. My custom comment" -`; \ No newline at end of file +`; diff --git a/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap index 178837444409..21a703ef034f 100644 --- a/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap +++ b/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap @@ -19,4 +19,4 @@ exports[`fails for unknown option 1`] = ` CLI Options Documentation: https://facebook.github.io/jest/docs/en/cli.html " -`; \ No newline at end of file +`; From 6e351e7a02a2c115267670aa3e0c56b1b34659b9 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 12:45:01 -0500 Subject: [PATCH 53/97] feat: adds error when using it or test without proper arguments --- packages/jest-jasmine2/src/jasmine/Env.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/jest-jasmine2/src/jasmine/Env.js b/packages/jest-jasmine2/src/jasmine/Env.js index 179529922ada..4c4d6502b24a 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.js +++ b/packages/jest-jasmine2/src/jasmine/Env.js @@ -424,6 +424,15 @@ export default function(j$) { }; this.it = function(description, fn, timeout) { + if (typeof description !== 'string') { + throw new Error(`first argument, "name", must be a string`); + } + if (fn === undefined) { + throw new Error('missing second argument function'); + } + if (typeof fn !== 'function') { + throw new Error(`second argument must be a function`); + } const spec = specFactory( description, fn, From 7eca76f7c01305b3933cc8ba43c9d6504a7528e5 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 14:13:32 -0500 Subject: [PATCH 54/97] fix: adds more descriptive error message --- packages/jest-jasmine2/src/jasmine/Env.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/jest-jasmine2/src/jasmine/Env.js b/packages/jest-jasmine2/src/jasmine/Env.js index 4c4d6502b24a..1f382ddb3e96 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.js +++ b/packages/jest-jasmine2/src/jasmine/Env.js @@ -425,13 +425,19 @@ export default function(j$) { this.it = function(description, fn, timeout) { if (typeof description !== 'string') { - throw new Error(`first argument, "name", must be a string`); + throw new Error( + `Invalid first argument, ${description}. It must be a string.`, + ); } if (fn === undefined) { - throw new Error('missing second argument function'); + throw new Error( + 'Missing second argument. It must be a callback function.', + ); } if (typeof fn !== 'function') { - throw new Error(`second argument must be a function`); + throw new Error( + `Invalid second argument, ${fn}. It must be a callback function.`, + ); } const spec = specFactory( description, From f85f956357e9003374e2ed49706fb1eee72f3c3c Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 14:16:56 -0500 Subject: [PATCH 55/97] feat: adds tests for errors --- .../src/__tests__/it_argument_errors.test.js | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js diff --git a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js new file mode 100644 index 000000000000..7e3450b5468a --- /dev/null +++ b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +'use strict'; + +import Env from '../jasmine/Env'; +import ReportDispatcher from '../jasmine/report_dispatcher'; +const options = {ReportDispatcher}; +const testEnv = Env(options); +console.log(testEnv()); + +describe('it/test invalid argument errors', () => { + xit(`doesn't throw errors with correct arguments`, () => { + expect(testEnv.it('good', () => {})).toBeTruthy(); + }); + xit('throws an error when missing a callback', () => { + expect(testEnv.it('missing callback')).toThrowError(); + }); + + xit('throws an error if first argument is not a string', () => { + expect(testEnv.it(() => {})).toThrowError(); + }); + + xit('throws an error if the second argument is not a function', () => { + expect(testEnv.it('no', 'function')).toThrowError(); + }); +}); From e64357ec440f21d6a37b3abf3f5528725f803eeb Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 16:42:08 -0500 Subject: [PATCH 56/97] fix: removes bad test --- .../src/__tests__/it_argument_errors.test.js | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js diff --git a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js deleted file mode 100644 index 7e3450b5468a..000000000000 --- a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -'use strict'; - -import Env from '../jasmine/Env'; -import ReportDispatcher from '../jasmine/report_dispatcher'; -const options = {ReportDispatcher}; -const testEnv = Env(options); -console.log(testEnv()); - -describe('it/test invalid argument errors', () => { - xit(`doesn't throw errors with correct arguments`, () => { - expect(testEnv.it('good', () => {})).toBeTruthy(); - }); - xit('throws an error when missing a callback', () => { - expect(testEnv.it('missing callback')).toThrowError(); - }); - - xit('throws an error if first argument is not a string', () => { - expect(testEnv.it(() => {})).toThrowError(); - }); - - xit('throws an error if the second argument is not a function', () => { - expect(testEnv.it('no', 'function')).toThrowError(); - }); -}); From f2359e02a6950619b504a4f04519da38543ea50b Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 21:21:30 -0500 Subject: [PATCH 57/97] feat: adds tests for circus and jasmine2 --- .../__tests__/circus_it_test_error.test.js | 44 +++++++++++++++++++ packages/jest-circus/src/index.js | 18 +++++++- .../src/__tests__/it_test_error.test.js | 29 ++++++++++++ 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 packages/jest-circus/src/__tests__/circus_it_test_error.test.js create mode 100644 packages/jest-jasmine2/src/__tests__/it_test_error.test.js diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js new file mode 100644 index 000000000000..d7a3413beae9 --- /dev/null +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + */ + +'use strict'; + +let testIt; + +const itAliaser = () => { + const {it} = require('../index.js'); + testIt = it; +}; + +itAliaser(); + +describe('test/it error throwing', () => { + it(`doesn't throw an error with valid arguments`, () => { + expect(() => { + testIt('test', () => {}); + }).not.toThrowError(); + }); + it(`throws error with missing callback function`, () => { + expect(() => { + testIt('test'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + it(`throws an error when first argument isn't a string`, () => { + expect(() => { + testIt(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + it('throws an error when callback function is not a function', () => { + expect(() => { + testIt('test', 'test2'); + }).toThrowError( + `Invalid second argument, test2. It must be a callback function.`, + ); + }); +}); diff --git a/packages/jest-circus/src/index.js b/packages/jest-circus/src/index.js index e77a72f79518..0fbdfd218c0b 100644 --- a/packages/jest-circus/src/index.js +++ b/packages/jest-circus/src/index.js @@ -38,8 +38,22 @@ const beforeAll = (fn: HookFn) => _addHook(fn, 'beforeAll'); const afterEach = (fn: HookFn) => _addHook(fn, 'afterEach'); const afterAll = (fn: HookFn) => _addHook(fn, 'afterAll'); -const test = (testName: TestName, fn?: TestFn) => - dispatch({fn, name: 'add_test', testName}); +const test = (testName: TestName, fn: TestFn) => { + if (typeof testName !== 'string') { + throw new Error( + `Invalid first argument, ${testName}. It must be a string.`, + ); + } + if (fn === undefined) { + throw new Error('Missing second argument. It must be a callback function.'); + } + if (typeof fn !== 'function') { + throw new Error( + `Invalid second argument, ${fn}. It must be a callback function.`, + ); + } + return dispatch({fn, name: 'add_test', testName}); +}; const it = test; test.skip = (testName: TestName, fn?: TestFn) => dispatch({fn, mode: 'skip', name: 'add_test', testName}); diff --git a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js new file mode 100644 index 000000000000..4642c95335be --- /dev/null +++ b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +'use strict'; + +describe('test/it error throwing', () => { + it(`throws error with missing callback function`, () => { + expect(() => { + it('test2'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + it(`throws an error when first argument isn't a string`, () => { + expect(() => { + it(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + it('throws an error when callback function is not a function', () => { + expect(() => { + it('test3', 'test4'); + }).toThrowError( + `Invalid second argument, test4. It must be a callback function.`, + ); + }); +}); From 4aa3101cce490a6af29c5fcd5c3a906560dcd7e8 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 21:24:20 -0500 Subject: [PATCH 58/97] fix: small tweaks to test names --- packages/jest-jasmine2/src/__tests__/it_test_error.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js index 4642c95335be..27b95d4d59fc 100644 --- a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js +++ b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js @@ -11,7 +11,7 @@ describe('test/it error throwing', () => { it(`throws error with missing callback function`, () => { expect(() => { - it('test2'); + it('test1'); }).toThrowError('Missing second argument. It must be a callback function.'); }); it(`throws an error when first argument isn't a string`, () => { @@ -21,9 +21,9 @@ describe('test/it error throwing', () => { }); it('throws an error when callback function is not a function', () => { expect(() => { - it('test3', 'test4'); + it('test2', 'test3'); }).toThrowError( - `Invalid second argument, test4. It must be a callback function.`, + `Invalid second argument, test3. It must be a callback function.`, ); }); }); From 139973b8c01cd16f991f03c5b514da47d1ff97fe Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 22:11:22 -0500 Subject: [PATCH 59/97] fix: adds circus test to flow ignore --- .flowconfig | 1 + .../jest-circus/src/__tests__/circus_it_test_error.test.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.flowconfig b/.flowconfig index 30bdfc526a60..8b4332fc2745 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,6 +1,7 @@ [ignore] .*/examples/.* .*/node_modules/metro-bundler/.* +.*/circus_it_test_error.test.js*. [options] module.name_mapper='^pretty-format$' -> '/packages/pretty-format/src/index.js' diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index d7a3413beae9..c9ba16f6603c 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -1,10 +1,10 @@ /** - * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow + * *@flow */ 'use strict'; From c0c478e072edd28821266912965ad59f6129a7fd Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 09:38:40 -0500 Subject: [PATCH 60/97] fix: variable names for circus it --- .../__tests__/circus_it_test_error.test.js | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index c9ba16f6603c..068a3f80a804 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -9,34 +9,41 @@ 'use strict'; -let testIt; +let circusIt; -const itAliaser = () => { +//using jest-jasmine2's 'it' to test jest-circus's 'it'. Had to differentiate +//the two with this aliaser. + +const aliasCircusIt = () => { const {it} = require('../index.js'); - testIt = it; + circusIt = it; }; -itAliaser(); +aliasCircusIt(); + +//A few of these tests require incorrect types to throw errors and thus pass +//the test. The typechecks on jest-circus would prevent that, so +//this file has been listed in the .flowconfig ignore section. describe('test/it error throwing', () => { it(`doesn't throw an error with valid arguments`, () => { expect(() => { - testIt('test', () => {}); + circusIt('test', () => {}); }).not.toThrowError(); }); it(`throws error with missing callback function`, () => { expect(() => { - testIt('test'); + circusIt('test'); }).toThrowError('Missing second argument. It must be a callback function.'); }); it(`throws an error when first argument isn't a string`, () => { expect(() => { - testIt(() => {}); + circusIt(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); it('throws an error when callback function is not a function', () => { expect(() => { - testIt('test', 'test2'); + circusIt('test', 'test2'); }).toThrowError( `Invalid second argument, test2. It must be a callback function.`, ); From ba03582d12be421f664ebc424ae7c3f7963c0625 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 09:57:10 -0500 Subject: [PATCH 61/97] chore: updates changelog. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b09aa68ac871..1085beded81d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,6 +79,9 @@ ### Features +* `[jest-jasmine2]` Adds error throwing and descriptive errors to `it`/ `test` + for invalid arguements. `[jest-circus]` Adds error throwing and descriptive + errors to `it`/ `test` for invalid arguements. * `[jest-util]` Add the following methods to the "console" implementations: `assert`, `count`, `countReset`, `dir`, `dirxml`, `group`, `groupCollapsed`, `groupEnd`, `time`, `timeEnd` From 061dab36a5aea7752e49325bf3b6faf5166c0ae4 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 14:27:18 -0500 Subject: [PATCH 62/97] updates: globals tests and snapshots --- .../__snapshots__/globals.test.js.snap | 75 ++++++++++++------- integration-tests/__tests__/globals.test.js | 4 +- 2 files changed, 50 insertions(+), 29 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 809211cb5725..9fe405a36eea 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -20,6 +20,23 @@ Ran all test suites. " `; +exports[`function as descriptor 1`] = ` +"PASS __tests__/function-as-descriptor.test.js + Foo + ✓ it + +" +`; + +exports[`function as descriptor 2`] = ` +"Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + exports[`only 1`] = ` "PASS __tests__/only-constructs.test.js ✓ test.only @@ -123,16 +140,27 @@ Ran all test suites. `; exports[`tests with no implementation 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ skipped 2 tests +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run + + Missing second argument. It must be a callback function. + + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | } + + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; exports[`tests with no implementation 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total +"Test Suites: 1 failed, 1 total +Tests: 0 total Snapshots: 0 total Time: <> Ran all test suites. @@ -140,34 +168,27 @@ Ran all test suites. `; exports[`tests with no implementation with expand arg 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ it, no implementation - ○ test, no implementation +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run -" -`; + Missing second argument. It must be a callback function. -exports[`tests with no implementation with expand arg 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - -exports[`function as descriptor 1`] = ` -"PASS __tests__/function-as-descriptor.test.js - Foo - ✓ it + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | } + + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; -exports[`function as descriptor 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 1 passed, 1 total +exports[`tests with no implementation with expand arg 2`] = ` +"Test Suites: 1 failed, 1 total +Tests: 0 total Snapshots: 0 total Time: <> Ran all test suites. diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index e141b0e9c715..f6dc85619268 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -120,7 +120,7 @@ test('tests with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); @@ -198,7 +198,7 @@ test('tests with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); From 7195e053e2e32f4de9ef587a4b863d0a9b63dd40 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 16:23:20 -0500 Subject: [PATCH 63/97] fix: resets snapshot file --- .../__snapshots__/globals.test.js.snap | 77 +++++++------------ 1 file changed, 28 insertions(+), 49 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 9fe405a36eea..6bc34bc7f4a3 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -20,23 +20,6 @@ Ran all test suites. " `; -exports[`function as descriptor 1`] = ` -"PASS __tests__/function-as-descriptor.test.js - Foo - ✓ it - -" -`; - -exports[`function as descriptor 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 1 passed, 1 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - exports[`only 1`] = ` "PASS __tests__/only-constructs.test.js ✓ test.only @@ -140,27 +123,16 @@ Ran all test suites. `; exports[`tests with no implementation 1`] = ` -"FAIL __tests__/only-constructs.test.js - ● Test suite failed to run - - Missing second argument. It must be a callback function. - - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | - 436 | } - - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 - at __tests__/only-constructs.test.js:3:5 +"PASS __tests__/only-constructs.test.js + ✓ it + ○ skipped 2 tests " `; exports[`tests with no implementation 2`] = ` -"Test Suites: 1 failed, 1 total -Tests: 0 total +"Test Suites: 1 passed, 1 total +Tests: 2 skipped, 1 passed, 3 total Snapshots: 0 total Time: <> Ran all test suites. @@ -168,29 +140,36 @@ Ran all test suites. `; exports[`tests with no implementation with expand arg 1`] = ` -"FAIL __tests__/only-constructs.test.js - ● Test suite failed to run - - Missing second argument. It must be a callback function. - - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | - 436 | } - - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 - at __tests__/only-constructs.test.js:3:5 +"PASS __tests__/only-constructs.test.js + ✓ it + ○ it, no implementation + ○ test, no implementation " `; exports[`tests with no implementation with expand arg 2`] = ` -"Test Suites: 1 failed, 1 total -Tests: 0 total +"Test Suites: 1 passed, 1 total +Tests: 2 skipped, 1 passed, 3 total Snapshots: 0 total Time: <> Ran all test suites. " `; + +exports[`function as descriptor 1`] = ` +"PASS __tests__/function-as-descriptor.test.js + Foo + ✓ it + +" +`; + +exports[`function as descriptor 2`] = ` +"Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; \ No newline at end of file From e411607c1ce8c8c2f135864bee47cd4a4a6afcf9 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 16:27:00 -0500 Subject: [PATCH 64/97] fix: temp skips failing tests until further direction --- integration-tests/__tests__/globals.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index f6dc85619268..e15ccabf10b0 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -110,7 +110,7 @@ test('only', () => { expect(summary).toMatchSnapshot(); }); -test('tests with no implementation', () => { +xtest('tests with no implementation', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -120,7 +120,7 @@ test('tests with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(1); + expect(status).toBe(0); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); @@ -188,7 +188,7 @@ test('only with expand arg', () => { expect(summary).toMatchSnapshot(); }); -test('tests with no implementation with expand arg', () => { +xtest('tests with no implementation with expand arg', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -198,7 +198,7 @@ test('tests with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(1); + expect(status).toBe(0); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); From 5163ee370dec600dd2d0c0228c2b8e1bee0cd838 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 18:55:26 -0500 Subject: [PATCH 65/97] feat: adds tests for test alias --- .../__tests__/circus_it_test_error.test.js | 42 +++++++++++++++---- .../src/__tests__/it_test_error.test.js | 27 +++++++++--- 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index 068a3f80a804..7b72fef20015 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -10,13 +10,15 @@ 'use strict'; let circusIt; +let circusTest; //using jest-jasmine2's 'it' to test jest-circus's 'it'. Had to differentiate //the two with this aliaser. const aliasCircusIt = () => { - const {it} = require('../index.js'); + const {it, test} = require('../index.js'); circusIt = it; + circusTest = test; }; aliasCircusIt(); @@ -26,26 +28,48 @@ aliasCircusIt(); //this file has been listed in the .flowconfig ignore section. describe('test/it error throwing', () => { - it(`doesn't throw an error with valid arguments`, () => { + it(`it doesn't throw an error with valid arguments`, () => { expect(() => { - circusIt('test', () => {}); + circusIt('test1', () => {}); }).not.toThrowError(); }); - it(`throws error with missing callback function`, () => { + it(`it throws error with missing callback function`, () => { expect(() => { - circusIt('test'); + circusIt('test2'); }).toThrowError('Missing second argument. It must be a callback function.'); }); - it(`throws an error when first argument isn't a string`, () => { + it(`it throws an error when first argument isn't a string`, () => { expect(() => { circusIt(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); - it('throws an error when callback function is not a function', () => { + it('it throws an error when callback function is not a function', () => { expect(() => { - circusIt('test', 'test2'); + circusIt('test4', 'test4b'); }).toThrowError( - `Invalid second argument, test2. It must be a callback function.`, + `Invalid second argument, test4b. It must be a callback function.`, + ); + }); + it(`test doesn't throw an error with valid arguments`, () => { + expect(() => { + circusTest('test5', () => {}); + }).not.toThrowError(); + }); + it(`test throws error with missing callback function`, () => { + expect(() => { + circusTest('test6'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + it(`test throws an error when first argument isn't a string`, () => { + expect(() => { + circusTest(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + it('test throws an error when callback function is not a function', () => { + expect(() => { + circusTest('test8', 'test8b'); + }).toThrowError( + `Invalid second argument, test8b. It must be a callback function.`, ); }); }); diff --git a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js index 27b95d4d59fc..9f1727645ffd 100644 --- a/packages/jest-jasmine2/src/__tests__/it_test_error.test.js +++ b/packages/jest-jasmine2/src/__tests__/it_test_error.test.js @@ -9,21 +9,38 @@ 'use strict'; describe('test/it error throwing', () => { - it(`throws error with missing callback function`, () => { + it(`it throws error with missing callback function`, () => { expect(() => { it('test1'); }).toThrowError('Missing second argument. It must be a callback function.'); }); - it(`throws an error when first argument isn't a string`, () => { + it(`it throws an error when first argument isn't a string`, () => { expect(() => { it(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); - it('throws an error when callback function is not a function', () => { + it('it throws an error when callback function is not a function', () => { expect(() => { - it('test2', 'test3'); + it('test3', 'test3b'); }).toThrowError( - `Invalid second argument, test3. It must be a callback function.`, + `Invalid second argument, test3b. It must be a callback function.`, + ); + }); + test(`test throws error with missing callback function`, () => { + expect(() => { + test('test4'); + }).toThrowError('Missing second argument. It must be a callback function.'); + }); + test(`test throws an error when first argument isn't a string`, () => { + expect(() => { + test(() => {}); + }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); + }); + test('test throws an error when callback function is not a function', () => { + expect(() => { + test('test6', 'test6b'); + }).toThrowError( + `Invalid second argument, test6b. It must be a callback function.`, ); }); }); From e0ff615409996583d9c7b12ebc6b10d4db6ee259 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 19:56:28 -0500 Subject: [PATCH 66/97] fix: renamed unimplemented test. Comments out rest snapshot for now. --- .../__snapshots__/globals.test.js.snap | 87 ++++++++----------- integration-tests/__tests__/globals.test.js | 12 +-- 2 files changed, 41 insertions(+), 58 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 6bc34bc7f4a3..2122883d094d 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -20,6 +20,41 @@ Ran all test suites. " `; +exports[`cannot test with no implementation 1`] = ` +"Test Suites: 1 failed, 1 total +Tests: 0 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + +exports[`cannot test with no implementation with expand arg 1`] = ` +"Test Suites: 1 failed, 1 total +Tests: 0 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + +exports[`function as descriptor 1`] = ` +"PASS __tests__/function-as-descriptor.test.js + Foo + ✓ it + +" +`; + +exports[`function as descriptor 2`] = ` +"Test Suites: 1 passed, 1 total +Tests: 1 passed, 1 total +Snapshots: 0 total +Time: <> +Ran all test suites. +" +`; + exports[`only 1`] = ` "PASS __tests__/only-constructs.test.js ✓ test.only @@ -121,55 +156,3 @@ Time: <> Ran all test suites. " `; - -exports[`tests with no implementation 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ skipped 2 tests - -" -`; - -exports[`tests with no implementation 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - -exports[`tests with no implementation with expand arg 1`] = ` -"PASS __tests__/only-constructs.test.js - ✓ it - ○ it, no implementation - ○ test, no implementation - -" -`; - -exports[`tests with no implementation with expand arg 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 2 skipped, 1 passed, 3 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; - -exports[`function as descriptor 1`] = ` -"PASS __tests__/function-as-descriptor.test.js - Foo - ✓ it - -" -`; - -exports[`function as descriptor 2`] = ` -"Test Suites: 1 passed, 1 total -Tests: 1 passed, 1 total -Snapshots: 0 total -Time: <> -Ran all test suites. -" -`; \ No newline at end of file diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index e15ccabf10b0..93d3129a9267 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -110,7 +110,7 @@ test('only', () => { expect(summary).toMatchSnapshot(); }); -xtest('tests with no implementation', () => { +test('cannot test with no implementation', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -120,10 +120,10 @@ xtest('tests with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - expect(rest).toMatchSnapshot(); + // expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); @@ -188,7 +188,7 @@ test('only with expand arg', () => { expect(summary).toMatchSnapshot(); }); -xtest('tests with no implementation with expand arg', () => { +test('cannot test with no implementation with expand arg', () => { const filename = 'only-constructs.test.js'; const content = ` it('it', () => {}); @@ -198,10 +198,10 @@ xtest('tests with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - expect(rest).toMatchSnapshot(); + // expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From 29a3d640b678422901f10e9247f2da26712ea181 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 11:28:37 -0500 Subject: [PATCH 67/97] fix: restores rest snapshot and removes abs path from snapshot stack --- .../__snapshots__/globals.test.js.snap | 28 +++++++++++++++++++ integration-tests/__tests__/globals.test.js | 6 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 2122883d094d..416c9eb30100 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -21,6 +21,20 @@ Ran all test suites. `; exports[`cannot test with no implementation 1`] = ` +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run + + Missing second argument. It must be a callback function. + + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | }" +`; + +exports[`cannot test with no implementation 2`] = ` "Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total @@ -30,6 +44,20 @@ Ran all test suites. `; exports[`cannot test with no implementation with expand arg 1`] = ` +"FAIL __tests__/only-constructs.test.js + ● Test suite failed to run + + Missing second argument. It must be a callback function. + + 431 | } + 432 | if (fn === undefined) { + > 433 | throw new Error( + 434 | 'Missing second argument. It must be a callback function.'); + 435 | + 436 | }" +`; + +exports[`cannot test with no implementation with expand arg 2`] = ` "Test Suites: 1 failed, 1 total Tests: 0 total Snapshots: 0 total diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index 93d3129a9267..61b0985399ae 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -123,7 +123,8 @@ test('cannot test with no implementation', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - // expect(rest).toMatchSnapshot(); + const restWithoutStack = rest.slice(0, 343); + expect(restWithoutStack).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); @@ -201,7 +202,8 @@ test('cannot test with no implementation with expand arg', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - // expect(rest).toMatchSnapshot(); + const restWithoutStack = rest.slice(0, 343); + expect(restWithoutStack).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From 85f359e778f20d399fcc68d558fba11acc941152 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 13:02:56 -0500 Subject: [PATCH 68/97] fix: cleans up stack using cleanUpStackTrace --- integration-tests/Utils.js | 6 ++++-- .../__tests__/__snapshots__/globals.test.js.snap | 14 ++++++++++++-- integration-tests/__tests__/globals.test.js | 7 +++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 3fb045589a1f..6a6b31ca4303 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -146,10 +146,12 @@ const extractSummary = (stdout: string) => { const summary = match[0] .replace(/\d*\.?\d+m?s/g, '<>') .replace(/, estimated <>/g, ''); - const rest = cleanupStackTrace( // remove all timestamps - stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), + stdout + .slice(0, -match[0].length) + .replace(/\s*\(\d*\.?\d+m?s\)$/gm, '') + .replace(/^.*\b(at Env.it)\b.*$/gm, ''), ); return {rest, summary}; diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 416c9eb30100..495c1001d42d 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -31,7 +31,12 @@ exports[`cannot test with no implementation 1`] = ` > 433 | throw new Error( 434 | 'Missing second argument. It must be a callback function.'); 435 | - 436 | }" + 436 | } + + + at __tests__/only-constructs.test.js:3:5 + +" `; exports[`cannot test with no implementation 2`] = ` @@ -54,7 +59,12 @@ exports[`cannot test with no implementation with expand arg 1`] = ` > 433 | throw new Error( 434 | 'Missing second argument. It must be a callback function.'); 435 | - 436 | }" + 436 | } + + + at __tests__/only-constructs.test.js:3:5 + +" `; exports[`cannot test with no implementation with expand arg 2`] = ` diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index 61b0985399ae..79cc76beaac8 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -123,8 +123,8 @@ test('cannot test with no implementation', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - const restWithoutStack = rest.slice(0, 343); - expect(restWithoutStack).toMatchSnapshot(); + + expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); @@ -202,8 +202,7 @@ test('cannot test with no implementation with expand arg', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - const restWithoutStack = rest.slice(0, 343); - expect(restWithoutStack).toMatchSnapshot(); + expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From 426cb079824c74893047d3ffb46692e47f249e50 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 13:43:29 -0500 Subject: [PATCH 69/97] fix: modifies regex in utils --- integration-tests/Utils.js | 8 ++------ .../__tests__/__snapshots__/globals.test.js.snap | 8 ++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 6a6b31ca4303..90249597ba38 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -148,12 +148,8 @@ const extractSummary = (stdout: string) => { .replace(/, estimated <>/g, ''); const rest = cleanupStackTrace( // remove all timestamps - stdout - .slice(0, -match[0].length) - .replace(/\s*\(\d*\.?\d+m?s\)$/gm, '') - .replace(/^.*\b(at Env.it)\b.*$/gm, ''), + stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), ); - return {rest, summary}; }; @@ -161,7 +157,7 @@ const extractSummary = (stdout: string) => { // unifies their output to make it possible to snapshot them. // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { - return output.replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); + return output.replace(/^.*\b(at)\b.*$/gm, ' at $1'); }; module.exports = { diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 495c1001d42d..2fe104a0cf75 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -33,8 +33,8 @@ exports[`cannot test with no implementation 1`] = ` 435 | 436 | } - - at __tests__/only-constructs.test.js:3:5 + at at + at at " `; @@ -61,8 +61,8 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - - at __tests__/only-constructs.test.js:3:5 + at at + at at " `; From 895f57ee2f26d15f604522e72b50391ff7eef510 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 14:10:22 -0500 Subject: [PATCH 70/97] fix: reverts utils regex --- integration-tests/Utils.js | 2 +- .../__tests__/__snapshots__/globals.test.js.snap | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 90249597ba38..42b3c17228a6 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -157,7 +157,7 @@ const extractSummary = (stdout: string) => { // unifies their output to make it possible to snapshot them. // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { - return output.replace(/^.*\b(at)\b.*$/gm, ' at $1'); + return output.replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); }; module.exports = { diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 2fe104a0cf75..b14324eb7a8b 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -33,8 +33,8 @@ exports[`cannot test with no implementation 1`] = ` 435 | 436 | } - at at - at at + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; @@ -61,8 +61,8 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - at at - at at + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; From e6f8d6a3c31b691a9c936191c23d459b3887ac52 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 14:18:06 -0500 Subject: [PATCH 71/97] fix: reverts line deletion in utils. --- integration-tests/Utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 42b3c17228a6..3fb045589a1f 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -146,10 +146,12 @@ const extractSummary = (stdout: string) => { const summary = match[0] .replace(/\d*\.?\d+m?s/g, '<>') .replace(/, estimated <>/g, ''); + const rest = cleanupStackTrace( // remove all timestamps stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), ); + return {rest, summary}; }; From 4547c5585bb83ea8d0c30cf2721937fa27c8873b Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 15:14:49 -0500 Subject: [PATCH 72/97] fix: replaces env in cleanup stack trace --- integration-tests/Utils.js | 4 +++- .../__tests__/__snapshots__/globals.test.js.snap | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 3fb045589a1f..b500c078a2a5 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -159,7 +159,9 @@ const extractSummary = (stdout: string) => { // unifies their output to make it possible to snapshot them. // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { - return output.replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); + return output + .replace(/^.*\b(at Env.it)\b.*$/gm, '') + .replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); }; module.exports = { diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index b14324eb7a8b..495c1001d42d 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -33,7 +33,7 @@ exports[`cannot test with no implementation 1`] = ` 435 | 436 | } - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " @@ -61,7 +61,7 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " From 5c1d5410ed2a23c59405672cd43077648227ccc8 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Wed, 21 Feb 2018 14:28:31 -0500 Subject: [PATCH 73/97] fix: resolves rebase conflict --- packages/jest-jasmine2/src/jasmine/Env.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/jest-jasmine2/src/jasmine/Env.js b/packages/jest-jasmine2/src/jasmine/Env.js index 1f382ddb3e96..4820c2b535b7 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.js +++ b/packages/jest-jasmine2/src/jasmine/Env.js @@ -425,6 +425,7 @@ export default function(j$) { this.it = function(description, fn, timeout) { if (typeof description !== 'string') { +<<<<<<< HEAD throw new Error( `Invalid first argument, ${description}. It must be a string.`, ); @@ -438,6 +439,15 @@ export default function(j$) { throw new Error( `Invalid second argument, ${fn}. It must be a callback function.`, ); +======= + throw new Error(`first argument, "name", must be a string`); + } + if (fn === undefined) { + throw new Error('missing second argument function'); + } + if (typeof fn !== 'function') { + throw new Error(`second argument must be a function`); +>>>>>>> feat: adds error when using it or test without proper arguments } const spec = specFactory( description, From dd3683928d92ed4170151e7f88e848bf006fc929 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 14:16:56 -0500 Subject: [PATCH 74/97] feat: adds tests for errors --- .../src/__tests__/it_argument_errors.test.js | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js diff --git a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js new file mode 100644 index 000000000000..7e3450b5468a --- /dev/null +++ b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +'use strict'; + +import Env from '../jasmine/Env'; +import ReportDispatcher from '../jasmine/report_dispatcher'; +const options = {ReportDispatcher}; +const testEnv = Env(options); +console.log(testEnv()); + +describe('it/test invalid argument errors', () => { + xit(`doesn't throw errors with correct arguments`, () => { + expect(testEnv.it('good', () => {})).toBeTruthy(); + }); + xit('throws an error when missing a callback', () => { + expect(testEnv.it('missing callback')).toThrowError(); + }); + + xit('throws an error if first argument is not a string', () => { + expect(testEnv.it(() => {})).toThrowError(); + }); + + xit('throws an error if the second argument is not a function', () => { + expect(testEnv.it('no', 'function')).toThrowError(); + }); +}); From 873671ac2d7fbe77d4ef3186708d967997701792 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 12 Feb 2018 16:42:08 -0500 Subject: [PATCH 75/97] fix: removes bad test --- .../src/__tests__/it_argument_errors.test.js | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js diff --git a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js b/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js deleted file mode 100644 index 7e3450b5468a..000000000000 --- a/packages/jest-jasmine2/src/__tests__/it_argument_errors.test.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -'use strict'; - -import Env from '../jasmine/Env'; -import ReportDispatcher from '../jasmine/report_dispatcher'; -const options = {ReportDispatcher}; -const testEnv = Env(options); -console.log(testEnv()); - -describe('it/test invalid argument errors', () => { - xit(`doesn't throw errors with correct arguments`, () => { - expect(testEnv.it('good', () => {})).toBeTruthy(); - }); - xit('throws an error when missing a callback', () => { - expect(testEnv.it('missing callback')).toThrowError(); - }); - - xit('throws an error if first argument is not a string', () => { - expect(testEnv.it(() => {})).toThrowError(); - }); - - xit('throws an error if the second argument is not a function', () => { - expect(testEnv.it('no', 'function')).toThrowError(); - }); -}); From b36f4fbba96df38b5cd4f9c2dd692b5aa37b263f Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Wed, 21 Feb 2018 14:33:28 -0500 Subject: [PATCH 76/97] fix: rebase conflict resolved --- packages/jest-jasmine2/src/jasmine/Env.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/jest-jasmine2/src/jasmine/Env.js b/packages/jest-jasmine2/src/jasmine/Env.js index 4820c2b535b7..1f382ddb3e96 100644 --- a/packages/jest-jasmine2/src/jasmine/Env.js +++ b/packages/jest-jasmine2/src/jasmine/Env.js @@ -425,7 +425,6 @@ export default function(j$) { this.it = function(description, fn, timeout) { if (typeof description !== 'string') { -<<<<<<< HEAD throw new Error( `Invalid first argument, ${description}. It must be a string.`, ); @@ -439,15 +438,6 @@ export default function(j$) { throw new Error( `Invalid second argument, ${fn}. It must be a callback function.`, ); -======= - throw new Error(`first argument, "name", must be a string`); - } - if (fn === undefined) { - throw new Error('missing second argument function'); - } - if (typeof fn !== 'function') { - throw new Error(`second argument must be a function`); ->>>>>>> feat: adds error when using it or test without proper arguments } const spec = specFactory( description, From 07154b3980d8ca4a88f5b045c51e24db2bcb64f0 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 09:38:40 -0500 Subject: [PATCH 77/97] fix: variable names for circus it --- .../jest-circus/src/__tests__/circus_it_test_error.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index 7b72fef20015..0791a1a800d3 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -10,7 +10,10 @@ 'use strict'; let circusIt; +<<<<<<< HEAD let circusTest; +======= +>>>>>>> fix: variable names for circus it //using jest-jasmine2's 'it' to test jest-circus's 'it'. Had to differentiate //the two with this aliaser. From 2b664deba5aa9cadefabe4fc0b64aeb19575d65c Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 16:27:00 -0500 Subject: [PATCH 78/97] fix: temp skips failing tests until further direction --- integration-tests/__tests__/globals.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index 79cc76beaac8..8adc40789c52 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -120,7 +120,7 @@ test('cannot test with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(1); + expect(status).toBe(0); const {summary, rest} = extractSummary(stderr); @@ -199,7 +199,7 @@ test('cannot test with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(1); + expect(status).toBe(0); const {summary, rest} = extractSummary(stderr); expect(rest).toMatchSnapshot(); From 17d2f7773d3d01caa89e52984bed70c528b812ff Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 18:55:26 -0500 Subject: [PATCH 79/97] feat: adds tests for test alias --- .../jest-circus/src/__tests__/circus_it_test_error.test.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index 0791a1a800d3..7b72fef20015 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -10,10 +10,7 @@ 'use strict'; let circusIt; -<<<<<<< HEAD let circusTest; -======= ->>>>>>> fix: variable names for circus it //using jest-jasmine2's 'it' to test jest-circus's 'it'. Had to differentiate //the two with this aliaser. From b86754856abe33a708b1b1cf077777682a3563fb Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 13 Feb 2018 19:56:28 -0500 Subject: [PATCH 80/97] fix: renamed unimplemented test. Comments out rest snapshot for now. --- integration-tests/__tests__/globals.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index 8adc40789c52..6c63cee7258e 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -120,7 +120,7 @@ test('cannot test with no implementation', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); @@ -199,10 +199,10 @@ test('cannot test with no implementation with expand arg', () => { writeFiles(TEST_DIR, {[filename]: content}); const {stderr, status} = runJest(DIR, ['--expand']); - expect(status).toBe(0); + expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - expect(rest).toMatchSnapshot(); + // expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From b27c0b5582123f0af604d1ef409f84b03f8b4939 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 11:28:37 -0500 Subject: [PATCH 81/97] fix: restores rest snapshot and removes abs path from snapshot stack --- .../__tests__/__snapshots__/globals.test.js.snap | 4 ++++ integration-tests/__tests__/globals.test.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 495c1001d42d..a55eeab82cab 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -31,12 +31,16 @@ exports[`cannot test with no implementation 1`] = ` > 433 | throw new Error( 434 | 'Missing second argument. It must be a callback function.'); 435 | +<<<<<<< HEAD 436 | } at __tests__/only-constructs.test.js:3:5 " +======= + 436 | }" +>>>>>>> fix: restores rest snapshot and removes abs path from snapshot stack `; exports[`cannot test with no implementation 2`] = ` diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index 6c63cee7258e..0dd5189e476d 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -202,7 +202,8 @@ test('cannot test with no implementation with expand arg', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - // expect(rest).toMatchSnapshot(); + const restWithoutStack = rest.slice(0, 343); + expect(restWithoutStack).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From 58e973b856bbcd7f243a8b4b0886b78b948a1749 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 13:02:56 -0500 Subject: [PATCH 82/97] fix: cleans up stack using cleanUpStackTrace --- integration-tests/Utils.js | 3 +-- .../__tests__/__snapshots__/globals.test.js.snap | 6 ++++++ integration-tests/__tests__/globals.test.js | 3 +-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index b500c078a2a5..4fb0c27cc866 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -146,7 +146,6 @@ const extractSummary = (stdout: string) => { const summary = match[0] .replace(/\d*\.?\d+m?s/g, '<>') .replace(/, estimated <>/g, ''); - const rest = cleanupStackTrace( // remove all timestamps stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), @@ -160,7 +159,7 @@ const extractSummary = (stdout: string) => { // TODO: Remove when we drop support for node 4 const cleanupStackTrace = (output: string) => { return output - .replace(/^.*\b(at Env.it)\b.*$/gm, '') + .replace(/.*(?=packages)/g, ' at ') .replace(/^.*at.*[\s][\(]?(\S*\:\d*\:\d*).*$/gm, ' at $1'); }; diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index a55eeab82cab..5cff0144703a 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -32,15 +32,21 @@ exports[`cannot test with no implementation 1`] = ` 434 | 'Missing second argument. It must be a callback function.'); 435 | <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> fix: cleans up stack using cleanUpStackTrace 436 | } at __tests__/only-constructs.test.js:3:5 " +<<<<<<< HEAD ======= 436 | }" >>>>>>> fix: restores rest snapshot and removes abs path from snapshot stack +======= +>>>>>>> fix: cleans up stack using cleanUpStackTrace `; exports[`cannot test with no implementation 2`] = ` diff --git a/integration-tests/__tests__/globals.test.js b/integration-tests/__tests__/globals.test.js index 0dd5189e476d..79cc76beaac8 100644 --- a/integration-tests/__tests__/globals.test.js +++ b/integration-tests/__tests__/globals.test.js @@ -202,8 +202,7 @@ test('cannot test with no implementation with expand arg', () => { expect(status).toBe(1); const {summary, rest} = extractSummary(stderr); - const restWithoutStack = rest.slice(0, 343); - expect(restWithoutStack).toMatchSnapshot(); + expect(rest).toMatchSnapshot(); expect(summary).toMatchSnapshot(); }); From f1df10b1f5a93817b3d04a8297f87f4cd69b5136 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 13:43:29 -0500 Subject: [PATCH 83/97] fix: modifies regex in utils --- integration-tests/Utils.js | 1 - .../__tests__/__snapshots__/globals.test.js.snap | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 4fb0c27cc866..9f8a2ec53fc2 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -150,7 +150,6 @@ const extractSummary = (stdout: string) => { // remove all timestamps stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), ); - return {rest, summary}; }; diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 5cff0144703a..6abcdaf2bbbe 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -37,8 +37,8 @@ exports[`cannot test with no implementation 1`] = ` >>>>>>> fix: cleans up stack using cleanUpStackTrace 436 | } - - at __tests__/only-constructs.test.js:3:5 + at at + at at " <<<<<<< HEAD @@ -71,8 +71,8 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - - at __tests__/only-constructs.test.js:3:5 + at at + at at " `; From 7648643cc48008a27b4ec8567860425e51439148 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 14:10:22 -0500 Subject: [PATCH 84/97] fix: reverts utils regex --- .../__tests__/__snapshots__/globals.test.js.snap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 6abcdaf2bbbe..d2592e768377 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -37,8 +37,8 @@ exports[`cannot test with no implementation 1`] = ` >>>>>>> fix: cleans up stack using cleanUpStackTrace 436 | } - at at - at at + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " <<<<<<< HEAD @@ -71,8 +71,8 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - at at - at at + at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " `; From c612bca87d5e0966657ea386ed95e425933968f2 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 14:18:06 -0500 Subject: [PATCH 85/97] fix: reverts line deletion in utils. --- integration-tests/Utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration-tests/Utils.js b/integration-tests/Utils.js index 9f8a2ec53fc2..bad044ad6faf 100644 --- a/integration-tests/Utils.js +++ b/integration-tests/Utils.js @@ -146,10 +146,12 @@ const extractSummary = (stdout: string) => { const summary = match[0] .replace(/\d*\.?\d+m?s/g, '<>') .replace(/, estimated <>/g, ''); + const rest = cleanupStackTrace( // remove all timestamps stdout.slice(0, -match[0].length).replace(/\s*\(\d*\.?\d+m?s\)$/gm, ''), ); + return {rest, summary}; }; From feaaf58f531870e141a5505138892dff39ae881f Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 15 Feb 2018 15:14:49 -0500 Subject: [PATCH 86/97] fix: replaces env in cleanup stack trace --- .../__tests__/__snapshots__/globals.test.js.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index d2592e768377..5cff0144703a 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -37,7 +37,7 @@ exports[`cannot test with no implementation 1`] = ` >>>>>>> fix: cleans up stack using cleanUpStackTrace 436 | } - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " @@ -71,7 +71,7 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 435 | 436 | } - at ../../../../../../../Users/brian/Documents/projects/opensource/jest/packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at __tests__/only-constructs.test.js:3:5 " From 7378e670c5ccba107355abc3e1e5c5e1eed11334 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 20:40:25 -0500 Subject: [PATCH 87/97] fix: addresses patch --- packages/jest-message-util/src/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/jest-message-util/src/index.js b/packages/jest-message-util/src/index.js index 91db678e0d56..1a24e474ca4a 100644 --- a/packages/jest-message-util/src/index.js +++ b/packages/jest-message-util/src/index.js @@ -205,8 +205,15 @@ const formatPaths = ( return line; } - let filePath = slash(path.relative(config.rootDir, match[2])); // highlight paths from the current test file + const packageDir = match[2].includes(`${path.sep}packages${path.sep}`) + ? match[2].match(/(jest).*$/) + : null; + + let filePath = packageDir + ? packageDir + : slash(path.relative(config.rootDir, match[2])); + if ( (config.testMatch && config.testMatch.length && From 6e2d789d865a4167b31aacd814a4dabfcc716dda Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 21:31:56 -0500 Subject: [PATCH 88/97] fix: replaces overly long packages path for CI test --- packages/jest-message-util/src/index.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/jest-message-util/src/index.js b/packages/jest-message-util/src/index.js index 1a24e474ca4a..504e3aee8f17 100644 --- a/packages/jest-message-util/src/index.js +++ b/packages/jest-message-util/src/index.js @@ -46,6 +46,7 @@ type StackTraceOptions = { const PATH_NODE_MODULES = `${path.sep}node_modules${path.sep}`; const PATH_EXPECT_BUILD = `${path.sep}expect${path.sep}build${path.sep}`; +const PATH_JEST_PACKAGES = `${path.sep}jest${path.sep}packages${path.sep}`; // filter for noisy stack trace lines const JASMINE_IGNORE = /^\s+at(?:(?:.*?vendor\/|jasmine\-)|\s+jasmine\.buildExpectationResult)/; @@ -205,15 +206,8 @@ const formatPaths = ( return line; } + let filePath = slash(path.relative(config.rootDir, match[2])); // highlight paths from the current test file - const packageDir = match[2].includes(`${path.sep}packages${path.sep}`) - ? match[2].match(/(jest).*$/) - : null; - - let filePath = packageDir - ? packageDir - : slash(path.relative(config.rootDir, match[2])); - if ( (config.testMatch && config.testMatch.length && @@ -227,7 +221,11 @@ const formatPaths = ( const getTopFrame = (lines: string[]) => { for (const line of lines) { - if (line.includes(PATH_NODE_MODULES) || line.includes(PATH_EXPECT_BUILD)) { + if ( + line.includes(PATH_NODE_MODULES) || + line.includes(PATH_EXPECT_BUILD) || + line.includes(PATH_JEST_PACKAGES) + ) { continue; } From bf4e2870bf838e77d0eb928036e5aaf949a78a1f Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 21:36:07 -0500 Subject: [PATCH 89/97] fix: adds new snapshot after packages fix --- integration-tests/__tests__/__snapshots__/failures.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/__tests__/__snapshots__/failures.test.js.snap b/integration-tests/__tests__/__snapshots__/failures.test.js.snap index 6ebf606f5060..8ed114207cfb 100644 --- a/integration-tests/__tests__/__snapshots__/failures.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/failures.test.js.snap @@ -118,7 +118,7 @@ exports[`works with async failures 1`] = ` + \\"foo\\": \\"bar\\", } - at ../../packages/expect/build/index.js:104:76 + at packages/expect/build/index.js:145:57 " `; From ba0c2865c0c44225f930e876946122c69daee268 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 21:38:34 -0500 Subject: [PATCH 90/97] fix: updates globals snapshot after packages fix --- .../__snapshots__/globals.test.js.snap | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index 5cff0144703a..fc640eca0c36 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -26,27 +26,16 @@ exports[`cannot test with no implementation 1`] = ` Missing second argument. It must be a callback function. - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | -<<<<<<< HEAD -<<<<<<< HEAD -======= ->>>>>>> fix: cleans up stack using cleanUpStackTrace - 436 | } + 1 | + 2 | it('it', () => {}); + > 3 | it('it, no implementation'); + 4 | test('test, no implementation'); + 5 | - + at packages/jest-jasmine2/build/jasmine/Env.js:433:15 at __tests__/only-constructs.test.js:3:5 " -<<<<<<< HEAD -======= - 436 | }" ->>>>>>> fix: restores rest snapshot and removes abs path from snapshot stack -======= ->>>>>>> fix: cleans up stack using cleanUpStackTrace `; exports[`cannot test with no implementation 2`] = ` @@ -64,14 +53,13 @@ exports[`cannot test with no implementation with expand arg 1`] = ` Missing second argument. It must be a callback function. - 431 | } - 432 | if (fn === undefined) { - > 433 | throw new Error( - 434 | 'Missing second argument. It must be a callback function.'); - 435 | - 436 | } + 1 | + 2 | it('it', () => {}); + > 3 | it('it, no implementation'); + 4 | test('test, no implementation'); + 5 | - + at packages/jest-jasmine2/build/jasmine/Env.js:433:15 at __tests__/only-constructs.test.js:3:5 " From 8e746b49bedb7b27e0be492908cbeba6cd6cef2e Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 22:24:31 -0500 Subject: [PATCH 91/97] fix: reverses bad snapshot commit --- .../__snapshots__/extend.test.js.snap | 2 +- .../__snapshots__/matchers.test.js.snap | 3184 ++++++++--------- .../__snapshots__/spy_matchers.test.js.snap | 230 +- .../to_throw_matchers.test.js.snap | 138 +- .../snapshot_interactive_mode.test.js.snap | 30 +- .../format_test_name_by_pattern.test.js | 127 +- .../get_snapshot_status.test.js.snap | 26 +- .../get_snapshot_summary.test.js.snap | 40 +- .../summary_reporter.test.js.snap | 30 +- .../__snapshots__/utils.test.js.snap | 22 +- .../__snapshots__/normalize.test.js.snap | 104 +- .../__tests__/__snapshots__/diff.test.js.snap | 330 +- .../__snapshots__/matchers.test.js.snap | 8 +- .../__snapshots__/index.test.js.snap | 22 +- .../__snapshots__/messages.test.js.snap | 22 +- .../__snapshots__/validate.test.js.snap | 216 +- .../validate_cli_options.test.js.snap | 32 +- 17 files changed, 2270 insertions(+), 2293 deletions(-) diff --git a/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap b/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap index c804d6c84014..a9d13ec56996 100644 --- a/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap @@ -2,4 +2,4 @@ exports[`is available globally 1`] = `"expected 15 to be divisible by 2"`; -exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`; +exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`; \ No newline at end of file diff --git a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap index 7dd105dcbc23..d22487ff6113 100644 --- a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap @@ -1,3986 +1,3986 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`.rejects fails for promise that resolves 1`] = ` -"expect(received).rejects.toBe() +"expect(received).rejects.toBe() -Expected received Promise to reject, instead it resolved to value - 4" +Expected received Promise to reject, instead it resolved to value + 4" `; exports[`.rejects fails non-promise value "a" 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - string: \\"a\\"" + string: \\"a\\"" `; exports[`.rejects fails non-promise value [1] 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - array: [1]" + array: [1]" `; exports[`.rejects fails non-promise value [Function anonymous] 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.rejects fails non-promise value {"a": 1} 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - object: {\\"a\\": 1}" + object: {\\"a\\": 1}" `; exports[`.rejects fails non-promise value 4 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - number: 4" + number: 4" `; exports[`.rejects fails non-promise value null 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. -Received: null" +received value must be a Promise. +Received: null" `; exports[`.rejects fails non-promise value true 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - boolean: true" + boolean: true" `; exports[`.rejects fails non-promise value undefined 1`] = ` -"expect(received).rejects.toBeDefined() +"expect(received).rejects.toBeDefined() -received value must be a Promise. -Received: undefined" +received value must be a Promise. +Received: undefined" `; exports[`.resolves fails for promise that rejects 1`] = ` -"expect(received).resolves.toBe() +"expect(received).resolves.toBe() -Expected received Promise to resolve, instead it rejected to value - 4" +Expected received Promise to resolve, instead it rejected to value + 4" `; exports[`.resolves fails non-promise value "a" 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - string: \\"a\\"" + string: \\"a\\"" `; exports[`.resolves fails non-promise value "a" synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - string: \\"a\\"" + string: \\"a\\"" `; exports[`.resolves fails non-promise value [1] 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - array: [1]" + array: [1]" `; exports[`.resolves fails non-promise value [1] synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - array: [1]" + array: [1]" `; exports[`.resolves fails non-promise value [Function anonymous] 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.resolves fails non-promise value [Function anonymous] synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.resolves fails non-promise value {"a": 1} 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - object: {\\"a\\": 1}" + object: {\\"a\\": 1}" `; exports[`.resolves fails non-promise value {"a": 1} synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - object: {\\"a\\": 1}" + object: {\\"a\\": 1}" `; exports[`.resolves fails non-promise value 4 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - number: 4" + number: 4" `; exports[`.resolves fails non-promise value 4 synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - number: 4" + number: 4" `; exports[`.resolves fails non-promise value null 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: null" +received value must be a Promise. +Received: null" `; exports[`.resolves fails non-promise value null synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: null" +received value must be a Promise. +Received: null" `; exports[`.resolves fails non-promise value true 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - boolean: true" + boolean: true" `; exports[`.resolves fails non-promise value true synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. +received value must be a Promise. Received: - boolean: true" + boolean: true" `; exports[`.resolves fails non-promise value undefined 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: undefined" +received value must be a Promise. +Received: undefined" `; exports[`.resolves fails non-promise value undefined synchronously 1`] = ` -"expect(received).resolves.toBeDefined() +"expect(received).resolves.toBeDefined() -received value must be a Promise. -Received: undefined" +received value must be a Promise. +Received: 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 value to be: - {} + {} Received: - {\\"circular\\": [Circular]} + {\\"circular\\": [Circular]} Difference: -- Expected -+ Received +- Expected ++ Received -- 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 value to not be: - \\"a\\" + \\"a\\" Received: - \\"a\\"" + \\"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 value to not be: - [] + [] Received: - []" + []" `; exports[`.toBe() fails for '{}' with '.not' 1`] = ` -"expect(received).not.toBe(expected) // Object.is equality +"expect(received).not.toBe(expected) // Object.is equality Expected value to not be: - {} + {} Received: - {}" + {}" `; 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 value to not be: - 1 + 1 Received: - 1" + 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 value to not be: - false + false Received: - false" + 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 value to not be: - null + null Received: - null" + 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 value to not be: - undefined + undefined Received: - undefined" + undefined" `; exports[`.toBe() fails for: "abc" and "cde" 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - \\"cde\\" + \\"cde\\" Received: - \\"abc\\"" + \\"abc\\"" `; 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 value to be: - \\"without trailing space\\" + \\"without trailing space\\" Received: - \\"with -trailing space\\"" + \\"with +trailing space\\"" `; exports[`.toBe() fails for: [] and [] 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - [] + [] Received: - [] + [] Difference: -Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." +Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." `; exports[`.toBe() fails for: {"a": 1} and {"a": 1} 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - {\\"a\\": 1} + {\\"a\\": 1} Received: - {\\"a\\": 1} + {\\"a\\": 1} Difference: -Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." +Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." `; 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 value to be: - {\\"a\\": 5} + {\\"a\\": 5} Received: - {\\"a\\": 1} + {\\"a\\": 1} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"a\\": 5, -+ \\"a\\": 1, - }" + Object { +- \\"a\\": 5, ++ \\"a\\": 1, + }" `; exports[`.toBe() fails for: {} and {} 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - {} + {} Received: - {} + {} Difference: -Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." +Compared values have no visual difference. Looks like you wanted to test for object/array equality with strict \`toBe\` matcher. You probably need to use \`toEqual\` instead." `; exports[`.toBe() fails for: -0 and 0 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - 0 + 0 Received: - -0 + -0 Difference: -Compared values have no visual difference." +Compared values have no visual difference." `; exports[`.toBe() fails for: 1 and 2 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - 2 + 2 Received: - 1" + 1" `; exports[`.toBe() fails for: null and undefined 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - undefined + undefined Received: - null + null Difference: - Comparing two different types of values. Expected undefined but received null." + Comparing two different types of values. Expected undefined but 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 value to be: - false + false Received: - true" + true" `; exports[`.toBeCloseTo() {pass: true} expect(0)toBeCloseTo( 0) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 0 +Expected value not to be close to (with 2-digit precision): + 0 Received: - 0" + 0" `; exports[`.toBeCloseTo() {pass: true} expect(0)toBeCloseTo( 0.001) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 0.001 +Expected value not to be close to (with 2-digit precision): + 0.001 Received: - 0" + 0" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.225) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.225 +Expected value not to be close to (with 2-digit precision): + 1.225 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.226) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.226 +Expected value not to be close to (with 2-digit precision): + 1.226 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.229) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.229 +Expected value not to be close to (with 2-digit precision): + 1.229 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() {pass: true} expect(1.23)toBeCloseTo( 1.234) 1`] = ` -"expect(received).not.toBeCloseTo(expected) +"expect(received).not.toBeCloseTo(expected) -Expected value not to be close to (with 2-digit precision): - 1.234 +Expected value not to be close to (with 2-digit precision): + 1.234 Received: - 1.23" + 1.23" `; exports[`.toBeCloseTo() accepts an optional precision argument: [0, 0.000004, 5] 1`] = ` -"expect(received).not.toBeCloseTo(expected, precision) +"expect(received).not.toBeCloseTo(expected, precision) -Expected value not to be close to (with 5-digit precision): - 0.000004 +Expected value not to be close to (with 5-digit precision): + 0.000004 Received: - 0" + 0" `; exports[`.toBeCloseTo() accepts an optional precision argument: [0, 0.0001, 3] 1`] = ` -"expect(received).not.toBeCloseTo(expected, precision) +"expect(received).not.toBeCloseTo(expected, precision) -Expected value not to be close to (with 3-digit precision): - 0.0001 +Expected value not to be close to (with 3-digit precision): + 0.0001 Received: - 0" + 0" `; exports[`.toBeCloseTo() accepts an optional precision argument: [0, 0.1, 0] 1`] = ` -"expect(received).not.toBeCloseTo(expected, precision) +"expect(received).not.toBeCloseTo(expected, precision) -Expected value not to be close to (with 0-digit precision): - 0.1 +Expected value not to be close to (with 0-digit precision): + 0.1 Received: - 0" + 0" `; exports[`.toBeCloseTo() throws: [0, 0.01] 1`] = ` -"expect(received).toBeCloseTo(expected) +"expect(received).toBeCloseTo(expected) -Expected value to be close to (with 2-digit precision): - 0.01 +Expected value to be close to (with 2-digit precision): + 0.01 Received: - 0" + 0" `; exports[`.toBeCloseTo() throws: [1, 1.23] 1`] = ` -"expect(received).toBeCloseTo(expected) +"expect(received).toBeCloseTo(expected) -Expected value to be close to (with 2-digit precision): - 1.23 +Expected value to be close to (with 2-digit precision): + 1.23 Received: - 1" + 1" `; exports[`.toBeCloseTo() throws: [1.23, 1.2249999] 1`] = ` -"expect(received).toBeCloseTo(expected) +"expect(received).toBeCloseTo(expected) -Expected value to be close to (with 2-digit precision): - 1.2249999 +Expected value to be close to (with 2-digit precision): + 1.2249999 Received: - 1.23" + 1.23" `; exports[`.toBeDefined(), .toBeUndefined() '"a"' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeDefined(), .toBeUndefined() '"a"' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeDefined(), .toBeUndefined() '[]' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - []" + []" `; exports[`.toBeDefined(), .toBeUndefined() '[]' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - []" + []" `; exports[`.toBeDefined(), .toBeUndefined() '[Function anonymous]' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeDefined(), .toBeUndefined() '[Function anonymous]' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeDefined(), .toBeUndefined() '{}' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - {}" + {}" `; exports[`.toBeDefined(), .toBeUndefined() '{}' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - {}" + {}" `; exports[`.toBeDefined(), .toBeUndefined() '0.5' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - 0.5" + 0.5" `; exports[`.toBeDefined(), .toBeUndefined() '0.5' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - 0.5" + 0.5" `; exports[`.toBeDefined(), .toBeUndefined() '1' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - 1" + 1" `; exports[`.toBeDefined(), .toBeUndefined() '1' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - 1" + 1" `; exports[`.toBeDefined(), .toBeUndefined() 'Infinity' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - Infinity" + Infinity" `; exports[`.toBeDefined(), .toBeUndefined() 'Infinity' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - Infinity" + Infinity" `; exports[`.toBeDefined(), .toBeUndefined() 'Map {}' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - Map {}" + Map {}" `; exports[`.toBeDefined(), .toBeUndefined() 'Map {}' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - Map {}" + Map {}" `; exports[`.toBeDefined(), .toBeUndefined() 'true' is defined 1`] = ` -"expect(received).not.toBeDefined() +"expect(received).not.toBeDefined() Expected value not to be defined, instead received - true" + true" `; exports[`.toBeDefined(), .toBeUndefined() 'true' is defined 2`] = ` -"expect(received).toBeUndefined() +"expect(received).toBeUndefined() Expected value to be undefined, instead received - true" + true" `; exports[`.toBeDefined(), .toBeUndefined() undefined is undefined 1`] = ` -"expect(received).toBeDefined() +"expect(received).toBeDefined() Expected value to be defined, instead received - undefined" + undefined" `; exports[`.toBeDefined(), .toBeUndefined() undefined is undefined 2`] = ` -"expect(received).not.toBeUndefined() +"expect(received).not.toBeUndefined() Expected value not to be undefined, instead received - undefined" + undefined" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [-Infinity, -Infinity] 1`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - -Infinity + -Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [-Infinity, -Infinity] 2`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - -Infinity + -Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [1, 1] 1`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 1 + 1 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [1, 1] 2`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 1 + 1 Received: - 1" + 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 value not to be greater than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 1.7976931348623157e+308" + 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 value not to be less than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 1.7976931348623157e+308" + 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 value not to be greater than or equal: - 5e-324 + 5e-324 Received: - 5e-324" + 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 value not to be less than or equal: - 5e-324 + 5e-324 Received: - 5e-324" + 5e-324" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [Infinity, Infinity] 1`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - Infinity + Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() equal numbers: [Infinity, Infinity] 2`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - Infinity + Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - Infinity + Infinity Received: - -Infinity" + -Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [-Infinity, Infinity] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - -Infinity + -Infinity Received: - Infinity" + Infinity" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 0.2 + 0.2 Received: - 0.1" + 0.1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [0.1, 0.2] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 0.1 + 0.1 Received: - 0.2" + 0.2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 2 + 2 Received: - 1" + 1" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [1, 2] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 1 + 1 Received: - 2" + 2" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 7 + 7 Received: - 3" + 3" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [3, 7] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 3 + 3 Received: - 7" + 7" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be less than: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be greater than: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be less than or equal: - 1.7976931348623157e+308 + 1.7976931348623157e+308 Received: - 5e-324" + 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 value not to be greater than or equal: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [5e-324, 1.7976931348623157e+308] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 5e-324 + 5e-324 Received: - 1.7976931348623157e+308" + 1.7976931348623157e+308" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 18 + 18 Received: - 9" + 9" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [9, 18] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 9 + 9 Received: - 18" + 18" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 1`] = ` -"expect(received).toBeGreaterThan(expected) +"expect(received).toBeGreaterThan(expected) Expected value to be greater than: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 2`] = ` -"expect(received).not.toBeLessThan(expected) +"expect(received).not.toBeLessThan(expected) Expected value not to be less than: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 3`] = ` -"expect(received).not.toBeGreaterThan(expected) +"expect(received).not.toBeGreaterThan(expected) Expected value not to be greater than: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 4`] = ` -"expect(received).toBeLessThan(expected) +"expect(received).toBeLessThan(expected) Expected value to be less than: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 5`] = ` -"expect(received).toBeGreaterThanOrEqual(expected) +"expect(received).toBeGreaterThanOrEqual(expected) Expected value to be greater than or equal: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 6`] = ` -"expect(received).not.toBeLessThanOrEqual(expected) +"expect(received).not.toBeLessThanOrEqual(expected) Expected value not to be less than or equal: - 34 + 34 Received: - 17" + 17" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 7`] = ` -"expect(received).not.toBeGreaterThanOrEqual(expected) +"expect(received).not.toBeGreaterThanOrEqual(expected) Expected value not to be greater than or equal: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeGreaterThan(), .toBeLessThan(), .toBeGreaterThanOrEqual(), .toBeLessThanOrEqual() throws: [17, 34] 8`] = ` -"expect(received).toBeLessThanOrEqual(expected) +"expect(received).toBeLessThanOrEqual(expected) Expected value to be less than or equal: - 17 + 17 Received: - 34" + 34" `; exports[`.toBeInstanceOf() failing "a" and [Function String] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"String\\" + \\"String\\" Received: - \\"a\\" + \\"a\\" Constructor: - \\"String\\"" + \\"String\\"" `; exports[`.toBeInstanceOf() failing {} and [Function A] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"A\\" + \\"A\\" Received: - {} + {} Constructor: - undefined" + undefined" `; exports[`.toBeInstanceOf() failing {} and [Function B] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"B\\" + \\"B\\" Received: - {} + {} Constructor: - \\"A\\"" + \\"A\\"" `; exports[`.toBeInstanceOf() failing 1 and [Function Number] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"Number\\" + \\"Number\\" Received: - 1 + 1 Constructor: - \\"Number\\"" + \\"Number\\"" `; exports[`.toBeInstanceOf() failing true and [Function Boolean] 1`] = ` -"expect(value).toBeInstanceOf(constructor) +"expect(value).toBeInstanceOf(constructor) Expected value to be an instance of: - \\"Boolean\\" + \\"Boolean\\" Received: - true + true Constructor: - \\"Boolean\\"" + \\"Boolean\\"" `; exports[`.toBeInstanceOf() passing [] and [Function Array] 1`] = ` -"expect(value).not.toBeInstanceOf(constructor) +"expect(value).not.toBeInstanceOf(constructor) Expected value not to be an instance of: - \\"Array\\" + \\"Array\\" Received: - [] + [] " `; exports[`.toBeInstanceOf() passing {} and [Function A] 1`] = ` -"expect(value).not.toBeInstanceOf(constructor) +"expect(value).not.toBeInstanceOf(constructor) Expected value not to be an instance of: - \\"A\\" + \\"A\\" Received: - {} + {} " `; exports[`.toBeInstanceOf() passing Map {} and [Function Map] 1`] = ` -"expect(value).not.toBeInstanceOf(constructor) +"expect(value).not.toBeInstanceOf(constructor) Expected value not to be an instance of: - \\"Map\\" + \\"Map\\" Received: - Map {} + Map {} " `; exports[`.toBeInstanceOf() throws if constructor is not a function 1`] = ` -"expect(value)[.not].toBeInstanceOf(constructor) +"expect(value)[.not].toBeInstanceOf(constructor) Expected constructor to be a function. Instead got: - \\"number\\"" + \\"number\\"" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 1`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 2`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 3`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() {pass: true} expect(NaN).toBeNaN() 4`] = ` -"expect(received).not.toBeNaN() +"expect(received).not.toBeNaN() Expected value not to be NaN, instead received - NaN" + NaN" `; exports[`.toBeNaN() throws 1`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - 1" + 1" `; exports[`.toBeNaN() throws 2`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - \\"\\"" + \\"\\"" `; exports[`.toBeNaN() throws 3`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - null" + null" `; exports[`.toBeNaN() throws 4`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - undefined" + undefined" `; exports[`.toBeNaN() throws 5`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - {}" + {}" `; exports[`.toBeNaN() throws 6`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - []" + []" `; exports[`.toBeNaN() throws 7`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - 0.2" + 0.2" `; exports[`.toBeNaN() throws 8`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - 0" + 0" `; exports[`.toBeNaN() throws 9`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - Infinity" + Infinity" `; exports[`.toBeNaN() throws 10`] = ` -"expect(received).toBeNaN() +"expect(received).toBeNaN() Expected value to be NaN, instead received - -Infinity" + -Infinity" `; exports[`.toBeNull() fails for '"a"' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeNull() fails for '[]' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - []" + []" `; exports[`.toBeNull() fails for '[Function anonymous]' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeNull() fails for '{}' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - {}" + {}" `; exports[`.toBeNull() fails for '0.5' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - 0.5" + 0.5" `; exports[`.toBeNull() fails for '1' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - 1" + 1" `; exports[`.toBeNull() fails for 'Infinity' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - Infinity" + Infinity" `; exports[`.toBeNull() fails for 'Map {}' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - Map {}" + Map {}" `; exports[`.toBeNull() fails for 'true' with .not 1`] = ` -"expect(received).toBeNull() +"expect(received).toBeNull() Expected value to be null, instead received - true" + true" `; exports[`.toBeNull() pass for null 1`] = ` -"expect(received).not.toBeNull() +"expect(received).not.toBeNull() Expected value not to be null, instead received - null" + null" `; exports[`.toBeTruthy(), .toBeFalsy() '""' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - \\"\\"" + \\"\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '""' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - \\"\\"" + \\"\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '"a"' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '"a"' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - \\"a\\"" + \\"a\\"" `; exports[`.toBeTruthy(), .toBeFalsy() '[]' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - []" + []" `; exports[`.toBeTruthy(), .toBeFalsy() '[]' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - []" + []" `; exports[`.toBeTruthy(), .toBeFalsy() '[Function anonymous]' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeTruthy(), .toBeFalsy() '[Function anonymous]' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - [Function anonymous]" + [Function anonymous]" `; exports[`.toBeTruthy(), .toBeFalsy() '{}' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - {}" + {}" `; exports[`.toBeTruthy(), .toBeFalsy() '{}' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - {}" + {}" `; exports[`.toBeTruthy(), .toBeFalsy() '0' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - 0" + 0" `; exports[`.toBeTruthy(), .toBeFalsy() '0' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - 0" + 0" `; exports[`.toBeTruthy(), .toBeFalsy() '0.5' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - 0.5" + 0.5" `; exports[`.toBeTruthy(), .toBeFalsy() '0.5' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - 0.5" + 0.5" `; exports[`.toBeTruthy(), .toBeFalsy() '1' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - 1" + 1" `; exports[`.toBeTruthy(), .toBeFalsy() '1' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - 1" + 1" `; exports[`.toBeTruthy(), .toBeFalsy() 'Infinity' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - Infinity" + Infinity" `; exports[`.toBeTruthy(), .toBeFalsy() 'Infinity' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - Infinity" + Infinity" `; exports[`.toBeTruthy(), .toBeFalsy() 'Map {}' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - Map {}" + Map {}" `; exports[`.toBeTruthy(), .toBeFalsy() 'Map {}' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - Map {}" + Map {}" `; exports[`.toBeTruthy(), .toBeFalsy() 'NaN' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - NaN" + NaN" `; exports[`.toBeTruthy(), .toBeFalsy() 'NaN' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - NaN" + NaN" `; exports[`.toBeTruthy(), .toBeFalsy() 'false' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - false" + false" `; exports[`.toBeTruthy(), .toBeFalsy() 'false' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - false" + false" `; exports[`.toBeTruthy(), .toBeFalsy() 'null' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - null" + null" `; exports[`.toBeTruthy(), .toBeFalsy() 'null' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - null" + null" `; exports[`.toBeTruthy(), .toBeFalsy() 'true' is truthy 1`] = ` -"expect(received).not.toBeTruthy() +"expect(received).not.toBeTruthy() Expected value not to be truthy, instead received - true" + true" `; exports[`.toBeTruthy(), .toBeFalsy() 'true' is truthy 2`] = ` -"expect(received).toBeFalsy() +"expect(received).toBeFalsy() Expected value to be falsy, instead received - true" + true" `; exports[`.toBeTruthy(), .toBeFalsy() 'undefined' is falsy 1`] = ` -"expect(received).toBeTruthy() +"expect(received).toBeTruthy() Expected value to be truthy, instead received - undefined" + undefined" `; exports[`.toBeTruthy(), .toBeFalsy() 'undefined' is falsy 2`] = ` -"expect(received).not.toBeFalsy() +"expect(received).not.toBeFalsy() Expected value not to be falsy, instead received - undefined" + undefined" `; exports[`.toBeTruthy(), .toBeFalsy() does not accept arguments 1`] = ` -"expect(received)[.not].toBeTruthy() +"expect(received)[.not].toBeTruthy() Matcher does not accept any arguments. -Got: null" +Got: null" `; exports[`.toBeTruthy(), .toBeFalsy() does not accept arguments 2`] = ` -"expect(received)[.not].toBeFalsy() +"expect(received)[.not].toBeFalsy() Matcher does not accept any arguments. -Got: null" +Got: null" `; exports[`.toContain(), .toContainEqual() '"11112111"' contains '"2"' 1`] = ` -"expect(string).not.toContain(value) +"expect(string).not.toContain(value) Expected string: - \\"11112111\\" + \\"11112111\\" Not to contain value: - \\"2\\" + \\"2\\" " `; exports[`.toContain(), .toContainEqual() '"abcdef"' contains '"abc"' 1`] = ` -"expect(string).not.toContain(value) +"expect(string).not.toContain(value) Expected string: - \\"abcdef\\" + \\"abcdef\\" Not to contain value: - \\"abc\\" + \\"abc\\" " `; exports[`.toContain(), .toContainEqual() '["a", "b", "c", "d"]' contains '"a"' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] Not to contain value: - \\"a\\" + \\"a\\" " `; exports[`.toContain(), .toContainEqual() '["a", "b", "c", "d"]' contains a value equal to '"a"' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] Not to contain a value equal to: - \\"a\\" + \\"a\\" " `; exports[`.toContain(), .toContainEqual() '[{"a": "b"}, {"a": "c"}]' contains a value equal to '{"a": "b"}' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] + [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] Not to contain a value equal to: - {\\"a\\": \\"b\\"} + {\\"a\\": \\"b\\"} " `; exports[`.toContain(), .toContainEqual() '[{"a": "b"}, {"a": "c"}]' does not contain a value equal to'{"a": "d"}' 1`] = ` -"expect(array).toContainEqual(value) +"expect(array).toContainEqual(value) Expected array: - [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] + [{\\"a\\": \\"b\\"}, {\\"a\\": \\"c\\"}] To contain a value equal to: - {\\"a\\": \\"d\\"}" + {\\"a\\": \\"d\\"}" `; exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '[]' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [{}, []] + [{}, []] To contain value: - []" + []" `; exports[`.toContain(), .toContainEqual() '[{}, []]' does not contain '{}' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [{}, []] + [{}, []] To contain value: - {}" + {}" `; exports[`.toContain(), .toContainEqual() '[0, 1]' contains '1' 1`] = ` -"expect(object).not.toContain(value) +"expect(object).not.toContain(value) Expected object: - [0, 1] + [0, 1] Not to contain value: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[0, 1]' contains a value equal to '1' 1`] = ` -"expect(object).not.toContainEqual(value) +"expect(object).not.toContainEqual(value) Expected object: - [0, 1] + [0, 1] Not to contain a value equal to: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[1, 2, 3, 4]' contains '1' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [1, 2, 3, 4] + [1, 2, 3, 4] Not to contain value: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[1, 2, 3, 4]' contains a value equal to '1' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [1, 2, 3, 4] + [1, 2, 3, 4] Not to contain a value equal to: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() '[1, 2, 3]' does not contain '4' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [1, 2, 3] + [1, 2, 3] To contain value: - 4" + 4" `; exports[`.toContain(), .toContainEqual() '[Symbol(a)]' contains 'Symbol(a)' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [Symbol(a)] + [Symbol(a)] Not to contain value: - Symbol(a) + Symbol(a) " `; exports[`.toContain(), .toContainEqual() '[Symbol(a)]' contains a value equal to 'Symbol(a)' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [Symbol(a)] + [Symbol(a)] Not to contain a value equal to: - Symbol(a) + Symbol(a) " `; exports[`.toContain(), .toContainEqual() '[null, undefined]' does not contain '1' 1`] = ` -"expect(array).toContain(value) +"expect(array).toContain(value) Expected array: - [null, undefined] + [null, undefined] To contain value: - 1" + 1" `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains 'null' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [undefined, null] + [undefined, null] Not to contain value: - null + null " `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains 'undefined' 1`] = ` -"expect(array).not.toContain(value) +"expect(array).not.toContain(value) Expected array: - [undefined, null] + [undefined, null] Not to contain value: - undefined + undefined " `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains a value equal to 'null' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [undefined, null] + [undefined, null] Not to contain a value equal to: - null + null " `; exports[`.toContain(), .toContainEqual() '[undefined, null]' contains a value equal to 'undefined' 1`] = ` -"expect(array).not.toContainEqual(value) +"expect(array).not.toContainEqual(value) Expected array: - [undefined, null] + [undefined, null] Not to contain a value equal to: - undefined + undefined " `; exports[`.toContain(), .toContainEqual() 'Set {"abc", "def"}' contains '"abc"' 1`] = ` -"expect(set).not.toContain(value) +"expect(set).not.toContain(value) Expected set: - Set {\\"abc\\", \\"def\\"} + Set {\\"abc\\", \\"def\\"} Not to contain value: - \\"abc\\" + \\"abc\\" " `; exports[`.toContain(), .toContainEqual() 'Set {1, 2, 3, 4}' contains a value equal to '1' 1`] = ` -"expect(set).not.toContainEqual(value) +"expect(set).not.toContainEqual(value) Expected set: - Set {1, 2, 3, 4} + Set {1, 2, 3, 4} Not to contain a value equal to: - 1 + 1 " `; exports[`.toContain(), .toContainEqual() error cases 1`] = ` -"expect(collection)[.not].toContainEqual(value) +"expect(collection)[.not].toContainEqual(value) -Expected collection to be an array-like structure. -Received: null" +Expected collection to be an array-like structure. +Received: null" `; exports[`.toContain(), .toContainEqual() error cases for toContainEqual 1`] = ` -"expect(collection)[.not].toContainEqual(value) +"expect(collection)[.not].toContainEqual(value) -Expected collection to be an array-like structure. -Received: null" +Expected collection to be an array-like structure. +Received: null" `; exports[`.toEqual() {pass: false} expect("Alice").not.toEqual({"asymmetricMatch": [Function asymmetricMatch]}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {\\"asymmetricMatch\\": [Function asymmetricMatch]} + {\\"asymmetricMatch\\": [Function asymmetricMatch]} Received: - \\"Alice\\"" + \\"Alice\\"" `; exports[`.toEqual() {pass: false} expect("Eve").toEqual({"asymmetricMatch": [Function asymmetricMatch]}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - {\\"asymmetricMatch\\": [Function asymmetricMatch]} + {\\"asymmetricMatch\\": [Function asymmetricMatch]} Received: - \\"Eve\\"" + \\"Eve\\"" `; exports[`.toEqual() {pass: false} expect("abc").not.toEqual("abc") 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - \\"abc\\" + \\"abc\\" Received: - \\"abc\\"" + \\"abc\\"" `; exports[`.toEqual() {pass: false} expect("abcd").not.toEqual(StringContaining "bc") 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - StringContaining \\"bc\\" + StringContaining \\"bc\\" Received: - \\"abcd\\"" + \\"abcd\\"" `; exports[`.toEqual() {pass: false} expect("abcd").not.toEqual(StringMatching /bc/) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - StringMatching /bc/ + StringMatching /bc/ Received: - \\"abcd\\"" + \\"abcd\\"" `; exports[`.toEqual() {pass: false} expect("abd").toEqual(StringContaining "bc") 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - StringContaining \\"bc\\" + StringContaining \\"bc\\" Received: - \\"abd\\"" + \\"abd\\"" `; exports[`.toEqual() {pass: false} expect("abd").toEqual(StringMatching /bc/i) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - StringMatching /bc/i + StringMatching /bc/i Received: - \\"abd\\"" + \\"abd\\"" `; exports[`.toEqual() {pass: false} expect("banana").toEqual("apple") 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - \\"apple\\" + \\"apple\\" Received: - \\"banana\\"" + \\"banana\\"" `; exports[`.toEqual() {pass: false} expect([1, 2, 3]).not.toEqual(ArrayContaining [2, 3]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - ArrayContaining [2, 3] + ArrayContaining [2, 3] Received: - [1, 2, 3]" + [1, 2, 3]" `; exports[`.toEqual() {pass: false} expect([1, 2]).not.toEqual([1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - [1, 2] + [1, 2] Received: - [1, 2]" + [1, 2]" `; exports[`.toEqual() {pass: false} expect([1, 2]).toEqual([2, 1]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - [2, 1] + [2, 1] Received: - [1, 2] + [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - Array [ -+ 1, - 2, -- 1, - ]" + Array [ ++ 1, + 2, +- 1, + ]" `; exports[`.toEqual() {pass: false} expect([1, 3]).toEqual(ArrayContaining [1, 2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ArrayContaining [1, 2] + ArrayContaining [1, 2] Received: - [1, 3] + [1, 3] Difference: -- Expected -+ Received +- Expected ++ Received -- ArrayContaining [ -+ Array [ - 1, -- 2, -+ 3, - ]" +- ArrayContaining [ ++ Array [ + 1, +- 2, ++ 3, + ]" `; exports[`.toEqual() {pass: false} expect([1]).not.toEqual([1]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - [1] + [1] Received: - [1]" + [1]" `; exports[`.toEqual() {pass: false} expect([1]).toEqual([2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - [2] + [2] Received: - [1] + [1] Difference: -- Expected -+ Received +- Expected ++ Received - Array [ -- 2, -+ 1, - ]" + Array [ +- 2, ++ 1, + ]" `; exports[`.toEqual() {pass: false} expect([Function anonymous]).not.toEqual(Any) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Any + Any Received: - [Function anonymous]" + [Function anonymous]" `; exports[`.toEqual() {pass: false} expect({"a": 1, "b": [Function b], "c": true}).not.toEqual({"a": 1, "b": Any, "c": Anything}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {\\"a\\": 1, \\"b\\": Any, \\"c\\": Anything} + {\\"a\\": 1, \\"b\\": Any, \\"c\\": Anything} Received: - {\\"a\\": 1, \\"b\\": [Function b], \\"c\\": true}" + {\\"a\\": 1, \\"b\\": [Function b], \\"c\\": true}" `; exports[`.toEqual() {pass: false} expect({"a": 1, "b": 2}).not.toEqual(ObjectContaining {"a": 1}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - ObjectContaining {\\"a\\": 1} + ObjectContaining {\\"a\\": 1} Received: - {\\"a\\": 1, \\"b\\": 2}" + {\\"a\\": 1, \\"b\\": 2}" `; exports[`.toEqual() {pass: false} expect({"a": 1, "b": 2}).toEqual(ObjectContaining {"a": 2}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ObjectContaining {\\"a\\": 2} + ObjectContaining {\\"a\\": 2} Received: - {\\"a\\": 1, \\"b\\": 2} + {\\"a\\": 1, \\"b\\": 2} Difference: -- Expected -+ Received +- Expected ++ Received -- ObjectContaining { -- \\"a\\": 2, -+ Object { -+ \\"a\\": 1, -+ \\"b\\": 2, - }" +- ObjectContaining { +- \\"a\\": 2, ++ Object { ++ \\"a\\": 1, ++ \\"b\\": 2, + }" `; exports[`.toEqual() {pass: false} expect({"a": 5}).toEqual({"b": 6}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - {\\"b\\": 6} + {\\"b\\": 6} Received: - {\\"a\\": 5} + {\\"a\\": 5} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"b\\": 6, -+ \\"a\\": 5, - }" + Object { +- \\"b\\": 6, ++ \\"a\\": 5, + }" `; exports[`.toEqual() {pass: false} expect({"a": 99}).not.toEqual({"a": 99}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {\\"a\\": 99} + {\\"a\\": 99} Received: - {\\"a\\": 99}" + {\\"a\\": 99}" `; exports[`.toEqual() {pass: false} expect({}).not.toEqual({}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - {} + {} Received: - {}" + {}" `; exports[`.toEqual() {pass: false} expect(0).toEqual(-0) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - -0 + -0 Received: - 0 + 0 Difference: -Compared values have no visual difference." +Compared values have no visual difference." `; exports[`.toEqual() {pass: false} expect(1).not.toEqual(1) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - 1 + 1 Received: - 1" + 1" `; exports[`.toEqual() {pass: false} expect(1).toEqual(2) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - 2 + 2 Received: - 1" + 1" `; exports[`.toEqual() {pass: false} expect(1).toEqual(ArrayContaining [1, 2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ArrayContaining [1, 2] + ArrayContaining [1, 2] Received: - 1 + 1 Difference: - Comparing two different types of values. Expected array but received number." + Comparing two different types of values. Expected array but received number." `; exports[`.toEqual() {pass: false} expect(Immutable.List [1, 2]).not.toEqual(Immutable.List [1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.List [1, 2] + Immutable.List [1, 2] Received: - Immutable.List [1, 2]" + Immutable.List [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.List [1, 2]).toEqual(Immutable.List [2, 1]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.List [2, 1] + Immutable.List [2, 1] Received: - Immutable.List [1, 2] + Immutable.List [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.List [ -+ 1, - 2, -- 1, - ]" + Immutable.List [ ++ 1, + 2, +- 1, + ]" `; exports[`.toEqual() {pass: false} expect(Immutable.List [1]).not.toEqual(Immutable.List [1]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.List [1] + Immutable.List [1] Received: - Immutable.List [1]" + Immutable.List [1]" `; exports[`.toEqual() {pass: false} expect(Immutable.List [1]).toEqual(Immutable.List [2]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.List [2] + Immutable.List [2] Received: - Immutable.List [1] + Immutable.List [1] Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.List [ -- 2, -+ 1, - ]" + Immutable.List [ +- 2, ++ 1, + ]" `; exports[`.toEqual() {pass: false} 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) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} Received: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}}" + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}}" `; 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 11}}} + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 11}}} Received: - Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} + Immutable.Map {\\"1\\": Immutable.Map {\\"2\\": {\\"a\\": 99}}} Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Map {\\"b\\": 0} + Immutable.Map {\\"b\\": 0} Received: - Immutable.Map {\\"a\\": 0} + Immutable.Map {\\"a\\": 0} Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Map {\\"v\\": 2} + Immutable.Map {\\"v\\": 2} Received: - Immutable.Map {\\"v\\": 1} + Immutable.Map {\\"v\\": 1} Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.Map { -- \\"v\\": 2, -+ \\"v\\": 1, - }" + Immutable.Map { +- \\"v\\": 2, ++ \\"v\\": 1, + }" `; exports[`.toEqual() {pass: false} expect(Immutable.Map {}).not.toEqual(Immutable.Map {}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {} + Immutable.Map {} Received: - Immutable.Map {}" + Immutable.Map {}" `; exports[`.toEqual() {pass: false} expect(Immutable.Map {1: "one", 2: "two"}).not.toEqual(Immutable.Map {1: "one", 2: "two"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {1: \\"one\\", 2: \\"two\\"} + Immutable.Map {1: \\"one\\", 2: \\"two\\"} Received: - Immutable.Map {1: \\"one\\", 2: \\"two\\"}" + Immutable.Map {1: \\"one\\", 2: \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Immutable.Map {1: "one", 2: "two"}).not.toEqual(Immutable.Map {2: "two", 1: "one"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Map {2: \\"two\\", 1: \\"one\\"} + Immutable.Map {2: \\"two\\", 1: \\"one\\"} Received: - Immutable.Map {1: \\"one\\", 2: \\"two\\"}" + Immutable.Map {1: \\"one\\", 2: \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedMap {1: "one", 2: "two"}).not.toEqual(Immutable.OrderedMap {1: "one", 2: "two"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} + Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} Received: - Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"}" + Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedMap {1: "one", 2: "two"}).toEqual(Immutable.OrderedMap {2: "two", 1: "one"}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.OrderedMap {2: \\"two\\", 1: \\"one\\"} + Immutable.OrderedMap {2: \\"two\\", 1: \\"one\\"} Received: - Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} + Immutable.OrderedMap {1: \\"one\\", 2: \\"two\\"} Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.OrderedMap { -+ 1: \\"one\\", - 2: \\"two\\", -- 1: \\"one\\", - }" + Immutable.OrderedMap { ++ 1: \\"one\\", + 2: \\"two\\", +- 1: \\"one\\", + }" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedSet []).not.toEqual(Immutable.OrderedSet []) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.OrderedSet [] + Immutable.OrderedSet [] Received: - Immutable.OrderedSet []" + Immutable.OrderedSet []" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedSet [1, 2]).not.toEqual(Immutable.OrderedSet [1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.OrderedSet [1, 2] + Immutable.OrderedSet [1, 2] Received: - Immutable.OrderedSet [1, 2]" + Immutable.OrderedSet [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.OrderedSet [1, 2]).toEqual(Immutable.OrderedSet [2, 1]) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.OrderedSet [2, 1] + Immutable.OrderedSet [2, 1] Received: - Immutable.OrderedSet [1, 2] + Immutable.OrderedSet [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - Immutable.OrderedSet [ -+ 1, - 2, -- 1, - ]" + Immutable.OrderedSet [ ++ 1, + 2, +- 1, + ]" `; exports[`.toEqual() {pass: false} expect(Immutable.Set []).not.toEqual(Immutable.Set []) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Set [] + Immutable.Set [] Received: - Immutable.Set []" + Immutable.Set []" `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).not.toEqual(Immutable.Set [1, 2]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Set [1, 2] + Immutable.Set [1, 2] Received: - Immutable.Set [1, 2]" + Immutable.Set [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).not.toEqual(Immutable.Set [2, 1]) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Immutable.Set [2, 1] + Immutable.Set [2, 1] Received: - Immutable.Set [1, 2]" + Immutable.Set [1, 2]" `; exports[`.toEqual() {pass: false} expect(Immutable.Set [1, 2]).toEqual(Immutable.Set []) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Set [] + Immutable.Set [] Received: - Immutable.Set [1, 2] + Immutable.Set [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received -- 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) +"expect(received).toEqual(expected) Expected value to equal: - Immutable.Set [1, 2, 3] + Immutable.Set [1, 2, 3] Received: - Immutable.Set [1, 2] + Immutable.Set [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Map {\\"b\\" => 0} + Map {\\"b\\" => 0} Received: - Map {\\"a\\" => 0} + Map {\\"a\\" => 0} Difference: -- Expected -+ Received +- Expected ++ Received - 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) +"expect(received).toEqual(expected) Expected value to equal: - Map {\\"v\\" => 2} + Map {\\"v\\" => 2} Received: - Map {\\"v\\" => 1} + Map {\\"v\\" => 1} Difference: -- Expected -+ Received +- Expected ++ Received - Map { -- \\"v\\" => 2, -+ \\"v\\" => 1, - }" + Map { +- \\"v\\" => 2, ++ \\"v\\" => 1, + }" `; exports[`.toEqual() {pass: false} expect(Map {}).not.toEqual(Map {}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Map {} + Map {} Received: - Map {}" + Map {}" `; exports[`.toEqual() {pass: false} expect(Map {}).toEqual(Set {}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Set {} + Set {} Received: - Map {} + Map {} Difference: - Comparing two different types of values. Expected set but received map." + Comparing two different types of values. Expected set but received map." `; exports[`.toEqual() {pass: false} expect(Map {1 => "one", 2 => "two"}).not.toEqual(Map {1 => "one", 2 => "two"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Map {1 => \\"one\\", 2 => \\"two\\"} + Map {1 => \\"one\\", 2 => \\"two\\"} Received: - Map {1 => \\"one\\", 2 => \\"two\\"}" + Map {1 => \\"one\\", 2 => \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Map {1 => "one", 2 => "two"}).not.toEqual(Map {2 => "two", 1 => "one"}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Map {2 => \\"two\\", 1 => \\"one\\"} + Map {2 => \\"two\\", 1 => \\"one\\"} Received: - Map {1 => \\"one\\", 2 => \\"two\\"}" + Map {1 => \\"one\\", 2 => \\"two\\"}" `; exports[`.toEqual() {pass: false} expect(Map {1 => "one", 2 => "two"}).toEqual(Map {1 => "one"}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Map {1 => \\"one\\"} + Map {1 => \\"one\\"} Received: - Map {1 => \\"one\\", 2 => \\"two\\"} + Map {1 => \\"one\\", 2 => \\"two\\"} Difference: -- Expected -+ Received +- Expected ++ Received - Map { - 1 => \\"one\\", -+ 2 => \\"two\\", - }" + Map { + 1 => \\"one\\", ++ 2 => \\"two\\", + }" `; exports[`.toEqual() {pass: false} expect(Set {}).not.toEqual(Set {}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Set {} + Set {} Received: - Set {}" + Set {}" `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).not.toEqual(Set {1, 2}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Set {1, 2} + Set {1, 2} Received: - Set {1, 2}" + Set {1, 2}" `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).not.toEqual(Set {2, 1}) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Set {2, 1} + Set {2, 1} Received: - Set {1, 2}" + Set {1, 2}" `; exports[`.toEqual() {pass: false} expect(Set {1, 2}).toEqual(Set {}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Set {} + Set {} Received: - Set {1, 2} + Set {1, 2} Difference: -- Expected -+ Received +- Expected ++ Received -- 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) +"expect(received).toEqual(expected) Expected value to equal: - Set {1, 2, 3} + Set {1, 2, 3} Received: - Set {1, 2} + Set {1, 2} Difference: -- Expected -+ Received +- Expected ++ Received - Set { - 1, - 2, -- 3, - }" + Set { + 1, + 2, +- 3, + }" `; exports[`.toEqual() {pass: false} expect(false).toEqual(ObjectContaining {"a": 2}) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - ObjectContaining {\\"a\\": 2} + ObjectContaining {\\"a\\": 2} Received: - false + false Difference: - Comparing two different types of values. Expected object but received boolean." + Comparing two different types of values. Expected object but received boolean." `; exports[`.toEqual() {pass: false} expect(null).toEqual(undefined) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - undefined + undefined Received: - null + null Difference: - Comparing two different types of values. Expected undefined but received null." + Comparing two different types of values. Expected undefined but received null." `; exports[`.toEqual() {pass: false} expect(true).not.toEqual(Anything) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - Anything + Anything Received: - true" + true" `; exports[`.toEqual() {pass: false} expect(true).not.toEqual(true) 1`] = ` -"expect(received).not.toEqual(expected) +"expect(received).not.toEqual(expected) Expected value to not equal: - true + true Received: - true" + true" `; exports[`.toEqual() {pass: false} expect(true).toEqual(false) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - false + false Received: - true" + true" `; exports[`.toEqual() {pass: false} expect(undefined).toEqual(Any) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Any + Any Received: - undefined + undefined Difference: - Comparing two different types of values. Expected function but received undefined." + Comparing two different types of values. Expected function but received undefined." `; exports[`.toEqual() {pass: false} expect(undefined).toEqual(Anything) 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - Anything + Anything Received: - undefined" + undefined" `; exports[`.toHaveLength {pass: false} expect("").toHaveLength(1) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 1 + 1 Received: - \\"\\" + \\"\\" received.length: - 0" + 0" `; exports[`.toHaveLength {pass: false} expect("abc").toHaveLength(66) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 66 + 66 Received: - \\"abc\\" + \\"abc\\" received.length: - 3" + 3" `; exports[`.toHaveLength {pass: false} expect(["a", "b"]).toHaveLength(99) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 99 + 99 Received: - [\\"a\\", \\"b\\"] + [\\"a\\", \\"b\\"] received.length: - 2" + 2" `; exports[`.toHaveLength {pass: false} expect([]).toHaveLength(1) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 1 + 1 Received: - [] + [] received.length: - 0" + 0" `; exports[`.toHaveLength {pass: false} expect([1, 2]).toHaveLength(3) 1`] = ` -"expect(received).toHaveLength(length) +"expect(received).toHaveLength(length) Expected value to have length: - 3 + 3 Received: - [1, 2] + [1, 2] received.length: - 2" + 2" `; exports[`.toHaveLength {pass: true} expect("").toHaveLength(0) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 0 + 0 Received: - \\"\\" + \\"\\" received.length: - 0" + 0" `; exports[`.toHaveLength {pass: true} expect("abc").toHaveLength(3) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 3 + 3 Received: - \\"abc\\" + \\"abc\\" received.length: - 3" + 3" `; exports[`.toHaveLength {pass: true} expect(["a", "b"]).toHaveLength(2) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 2 + 2 Received: - [\\"a\\", \\"b\\"] + [\\"a\\", \\"b\\"] received.length: - 2" + 2" `; exports[`.toHaveLength {pass: true} expect([]).toHaveLength(0) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 0 + 0 Received: - [] + [] received.length: - 0" + 0" `; exports[`.toHaveLength {pass: true} expect([1, 2]).toHaveLength(2) 1`] = ` -"expect(received).not.toHaveLength(length) +"expect(received).not.toHaveLength(length) Expected value to not have length: - 2 + 2 Received: - [1, 2] + [1, 2] received.length: - 2" + 2" `; exports[`.toHaveLength error cases 1`] = ` -"expect(received)[.not].toHaveLength(length) +"expect(received)[.not].toHaveLength(length) Expected value to have a 'length' property that is a number. Received: - {\\"a\\": 9} + {\\"a\\": 9} received.length: - undefined" + undefined" `; exports[`.toHaveLength error cases 2`] = ` -"expect(received)[.not].toHaveLength(length) +"expect(received)[.not].toHaveLength(length) Expected value to have a 'length' property that is a number. Received: - 0 + 0 " `; exports[`.toHaveLength error cases 3`] = ` -"expect(received)[.not].toHaveLength(length) +"expect(received)[.not].toHaveLength(length) Expected value to have a 'length' property that is a number. Received: - undefined + undefined " `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('1') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected path to be a string or an array. Received: - number: 1" +Expected path to be a string or an array. Received: + number: 1" `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('null') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected path to be a string or an array. Received: - null: null" +Expected path to be a string or an array. Received: + null: null" `; exports[`.toHaveProperty() {error} expect({"a": {"b": {}}}).toHaveProperty('undefined') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected path to be a string or an array. Received: - undefined: undefined" +Expected path to be a string or an array. Received: + undefined: undefined" `; exports[`.toHaveProperty() {error} expect(null).toHaveProperty('a.b') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected object to be an object. Received: - null: null" +Expected object to be an object. Received: + null: null" `; exports[`.toHaveProperty() {error} expect(undefined).toHaveProperty('a') 1`] = ` -"expect(object)[.not].toHaveProperty(path) +"expect(object)[.not].toHaveProperty(path) -Expected object to be an object. Received: - undefined: undefined" +Expected object to be an object. Received: + undefined: undefined" `; exports[`.toHaveProperty() {pass: false} expect("abc").toHaveProperty('a.b.c') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - \\"abc\\" + \\"abc\\" To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" " `; exports[`.toHaveProperty() {pass: false} expect("abc").toHaveProperty('a.b.c', {"a": 5}) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - \\"abc\\" + \\"abc\\" To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" With a value of: - {\\"a\\": 5} + {\\"a\\": 5} " `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d', 2) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} To have a nested property: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] With a value of: - 2 + 2 Received: - 1" + 1" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d', 2) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 2 + 2 Received: - 1" + 1" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.ttt.d', 1) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} To have a nested property: - \\"a.b.ttt.d\\" + \\"a.b.ttt.d\\" With a value of: - 1 + 1 Received: - object.a.b: {\\"c\\": {\\"d\\": 1}}" + object.a.b: {\\"c\\": {\\"d\\": 1}}" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {}}}} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" Received: - object.a.b.c: {}" + object.a.b.c: {}" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": {}}}}).toHaveProperty('a.b.c.d', 1) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {}}}} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 1 + 1 Received: - object.a.b.c: {}" + object.a.b.c: {}" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": {"c": 5}}}).toHaveProperty('a.b', {"c": 4}) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": 5}}} + {\\"a\\": {\\"b\\": {\\"c\\": 5}}} To have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - {\\"c\\": 4} + {\\"c\\": 4} Received: - {\\"c\\": 5} + {\\"c\\": 5} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"c\\": 4, -+ \\"c\\": 5, - }" + Object { +- \\"c\\": 4, ++ \\"c\\": 5, + }" `; exports[`.toHaveProperty() {pass: false} expect({"a": {"b": 3}}).toHaveProperty('a.b', undefined) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": 3}} + {\\"a\\": {\\"b\\": 3}} To have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - undefined + undefined Received: - 3 + 3 Difference: - Comparing two different types of values. Expected undefined but received number." + Comparing two different types of values. Expected undefined but received number." `; exports[`.toHaveProperty() {pass: false} expect({"a": 1}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - {\\"a\\": 1} + {\\"a\\": 1} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" Received: - object.a: 1" + object.a: 1" `; exports[`.toHaveProperty() {pass: false} expect({"a": 1}).toHaveProperty('a.b.c.d', 5) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a\\": 1} + {\\"a\\": 1} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 5 + 5 Received: - object.a: 1" + object.a: 1" `; exports[`.toHaveProperty() {pass: false} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 2) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} To have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 2 + 2 " `; exports[`.toHaveProperty() {pass: false} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 2) 2`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} To have a nested property: - [\\"a.b.c.d\\"] + [\\"a.b.c.d\\"] With a value of: - 2 + 2 Received: - 1" + 1" `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - {} + {} To have a nested property: - \\"a\\" + \\"a\\" " `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a', "a") 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {} + {} To have a nested property: - \\"a\\" + \\"a\\" With a value of: - \\"a\\" + \\"a\\" Received: - undefined + undefined Difference: - Comparing two different types of values. Expected string but received undefined." + Comparing two different types of values. Expected string but received undefined." `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('a', "test") 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {} + {} To have a nested property: - \\"a\\" + \\"a\\" With a value of: - \\"test\\" + \\"test\\" " `; exports[`.toHaveProperty() {pass: false} expect({}).toHaveProperty('b', undefined) 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - {} + {} To have a nested property: - \\"b\\" + \\"b\\" With a value of: - undefined + undefined Received: - \\"b\\" + \\"b\\" Difference: - Comparing two different types of values. Expected undefined but received string." + Comparing two different types of values. Expected undefined but received string." `; exports[`.toHaveProperty() {pass: false} expect(1).toHaveProperty('a.b.c') 1`] = ` -"expect(object).toHaveProperty(path) +"expect(object).toHaveProperty(path) Expected the object: - 1 + 1 To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" " `; exports[`.toHaveProperty() {pass: false} expect(1).toHaveProperty('a.b.c', "test") 1`] = ` -"expect(object).toHaveProperty(path, value) +"expect(object).toHaveProperty(path, value) Expected the object: - 1 + 1 To have a nested property: - \\"a.b.c\\" + \\"a.b.c\\" With a value of: - \\"test\\" + \\"test\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": [1, 2, 3]}} + {\\"a\\": {\\"b\\": [1, 2, 3]}} Not to have a nested property: - [\\"a\\", \\"b\\", 1] + [\\"a\\", \\"b\\", 1] " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": [1, 2, 3]}}).toHaveProperty('a,b,1', 2) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": [1, 2, 3]}} + {\\"a\\": {\\"b\\": [1, 2, 3]}} Not to have a nested property: - [\\"a\\", \\"b\\", 1] + [\\"a\\", \\"b\\", 1] With a value of: - 2 + 2 " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a,b,c,d', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] + [\\"a\\", \\"b\\", \\"c\\", \\"d\\"] With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": {"d": 1}}}}).toHaveProperty('a.b.c.d', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} + {\\"a\\": {\\"b\\": {\\"c\\": {\\"d\\": 1}}}} Not to have a nested property: - \\"a.b.c.d\\" + \\"a.b.c.d\\" With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": {"c": 5}}}).toHaveProperty('a.b', {"c": 5}) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": {\\"c\\": 5}}} + {\\"a\\": {\\"b\\": {\\"c\\": 5}}} Not to have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - {\\"c\\": 5} + {\\"c\\": 5} " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": undefined}}).toHaveProperty('a.b') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": {\\"b\\": undefined}} + {\\"a\\": {\\"b\\": undefined}} Not to have a nested property: - \\"a.b\\" + \\"a.b\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": {"b": undefined}}).toHaveProperty('a.b', undefined) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": {\\"b\\": undefined}} + {\\"a\\": {\\"b\\": undefined}} Not to have a nested property: - \\"a.b\\" + \\"a.b\\" With a value of: - undefined + undefined " `; exports[`.toHaveProperty() {pass: true} expect({"a": 0}).toHaveProperty('a') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a\\": 0} + {\\"a\\": 0} Not to have a nested property: - \\"a\\" + \\"a\\" " `; exports[`.toHaveProperty() {pass: true} expect({"a": 0}).toHaveProperty('a', 0) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a\\": 0} + {\\"a\\": 0} Not to have a nested property: - \\"a\\" + \\"a\\" With a value of: - 0 + 0 " `; exports[`.toHaveProperty() {pass: true} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d') 1`] = ` -"expect(object).not.toHaveProperty(path) +"expect(object).not.toHaveProperty(path) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} Not to have a nested property: - [\\"a.b.c.d\\"] + [\\"a.b.c.d\\"] " `; exports[`.toHaveProperty() {pass: true} expect({"a.b.c.d": 1}).toHaveProperty('a.b.c.d', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"a.b.c.d\\": 1} + {\\"a.b.c.d\\": 1} Not to have a nested property: - [\\"a.b.c.d\\"] + [\\"a.b.c.d\\"] With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({"property": 1}).toHaveProperty('property', 1) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {\\"property\\": 1} + {\\"property\\": 1} Not to have a nested property: - \\"property\\" + \\"property\\" With a value of: - 1 + 1 " `; exports[`.toHaveProperty() {pass: true} expect({}).toHaveProperty('a', undefined) 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {} + {} Not to have a nested property: - \\"a\\" + \\"a\\" With a value of: - undefined + undefined " `; exports[`.toHaveProperty() {pass: true} expect({}).toHaveProperty('b', "b") 1`] = ` -"expect(object).not.toHaveProperty(path, value) +"expect(object).not.toHaveProperty(path, value) Expected the object: - {} + {} Not to have a nested property: - \\"b\\" + \\"b\\" With a value of: - \\"b\\" + \\"b\\" " `; exports[`.toMatch() {pass: true} expect(Foo bar).toMatch(/^foo/i) 1`] = ` -"expect(received).not.toMatch(expected) +"expect(received).not.toMatch(expected) Expected value not to match: - /^foo/i + /^foo/i Received: - \\"Foo bar\\"" + \\"Foo bar\\"" `; exports[`.toMatch() {pass: true} expect(foo).toMatch(foo) 1`] = ` -"expect(received).not.toMatch(expected) +"expect(received).not.toMatch(expected) Expected value not to match: - \\"foo\\" + \\"foo\\" Received: - \\"foo\\"" + \\"foo\\"" `; exports[`.toMatch() throws if non String actual value passed: [/foo/i, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - regexp: /foo/i" + regexp: /foo/i" `; exports[`.toMatch() throws if non String actual value passed: [[], "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - array: []" + array: []" `; exports[`.toMatch() throws if non String actual value passed: [[Function anonymous], "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.toMatch() throws if non String actual value passed: [{}, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - object: {}" + object: {}" `; exports[`.toMatch() throws if non String actual value passed: [1, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - number: 1" + number: 1" `; exports[`.toMatch() throws if non String actual value passed: [true, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. +string value must be a string. Received: - boolean: true" + boolean: true" `; exports[`.toMatch() throws if non String actual value passed: [undefined, "foo"] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -string value must be a string. -Received: undefined" +string value must be a string. +Received: undefined" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", []] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - array: []" + array: []" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", [Function anonymous]] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", {}] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - object: {}" + object: {}" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", 1] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - number: 1" + number: 1" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", true] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. +expected value must be a string or a regular expression. Expected: - boolean: true" + boolean: true" `; exports[`.toMatch() throws if non String/RegExp expected value passed: ["foo", undefined] 1`] = ` -"expect(string)[.not].toMatch(expected) +"expect(string)[.not].toMatch(expected) -expected value must be a string or a regular expression. -Expected: undefined" +expected value must be a string or a regular expression. +Expected: undefined" `; exports[`.toMatch() throws: [bar, /foo/] 1`] = ` -"expect(received).toMatch(expected) +"expect(received).toMatch(expected) Expected value to match: - /foo/ + /foo/ Received: - \\"bar\\"" + \\"bar\\"" `; exports[`.toMatch() throws: [bar, foo] 1`] = ` -"expect(received).toMatch(expected) +"expect(received).toMatch(expected) Expected value to match: - \\"foo\\" + \\"foo\\" Received: - \\"bar\\"" + \\"bar\\"" `; exports[`toMatchObject() {pass: false} expect([0]).toMatchObject([-0]) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - [-0] + [-0] Received: - [0] + [0] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [1, 2, 2] + [1, 2, 2] Received: - [1, 2, 3] + [1, 2, 3] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [2, 3, 1] + [2, 3, 1] Received: - [1, 2, 3] + [1, 2, 3] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [1, 3] + [1, 3] Received: - [1, 2] + [1, 2] Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - [Error: bar] + [Error: bar] Received: - [Error: foo] + [Error: foo] Difference: -- Expected -+ Received +- Expected ++ Received -- [Error: bar] -+ [Error: foo]" +- [Error: bar] ++ [Error: foo]" `; exports[`toMatchObject() {pass: false} expect({"a": "a", "c": "d"}).toMatchObject({"a": Any}) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - {\\"a\\": Any} + {\\"a\\": Any} Received: - {\\"a\\": \\"a\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"a\\", \\"c\\": \\"d\\"} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"a\\": Any, -+ \\"a\\": \\"a\\", - }" + Object { +- \\"a\\": Any, ++ \\"a\\": \\"a\\", + }" `; exports[`toMatchObject() {pass: false} expect({"a": "b", "c": "d"}).toMatchObject({"a": "b!", "c": "d"}) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - {\\"a\\": \\"b!\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b!\\", \\"c\\": \\"d\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"e\\": \\"b\\"} + {\\"e\\": \\"b\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": [3]}} + {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": [3]}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} + {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"t\\": {\\"l\\": {\\"r\\": \\"r\\"}}} + {\\"t\\": {\\"l\\": {\\"r\\": \\"r\\"}}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} + {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}} Difference: -- Expected -+ Received +- Expected ++ Received - 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": [{"a": "a", "b": "b"}]}).toMatchObject({"a": [{"a": "c"}]}) 1`] = ` -"expect(received).toMatchObject(expected) +"expect(received).toMatchObject(expected) Expected value to match object: - {\\"a\\": [{\\"a\\": \\"c\\"}]} + {\\"a\\": [{\\"a\\": \\"c\\"}]} Received: - {\\"a\\": [{\\"a\\": \\"a\\", \\"b\\": \\"b\\"}]} + {\\"a\\": [{\\"a\\": \\"a\\", \\"b\\": \\"b\\"}]} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": [\\"v\\"]} + {\\"a\\": [\\"v\\"]} Received: - {\\"a\\": [3, 4, \\"v\\"], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, \\"v\\"], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": [3, 4, 5, 6]} + {\\"a\\": [3, 4, 5, 6]} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": [3, 4]} + {\\"a\\": [3, 4]} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": {\\"b\\": 4}} + {\\"a\\": {\\"b\\": 4}} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": {\\"b\\": Any}} + {\\"a\\": {\\"b\\": Any}} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} + {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"d\\": {\\"e\\": {\\"f\\": 222}}} + {\\"d\\": {\\"e\\": {\\"f\\": 222}}} Received: - {\\"a\\": 1, \\"b\\": 1, \\"c\\": 1, \\"d\\": {\\"e\\": {\\"f\\": 555}}} + {\\"a\\": 1, \\"b\\": 1, \\"c\\": 1, \\"d\\": {\\"e\\": {\\"f\\": 555}}} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": 2015-10-10T00:00:00.000Z} + {\\"a\\": 2015-10-10T00:00:00.000Z} Received: - {\\"a\\": 2015-11-30T00:00:00.000Z, \\"b\\": \\"b\\"} + {\\"a\\": 2015-11-30T00:00:00.000Z, \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": \\"4\\"} + {\\"a\\": \\"4\\"} Received: - {\\"a\\": null, \\"b\\": \\"b\\"} + {\\"a\\": null, \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {\\"a\\": null, \\"b\\": \\"b\\"} + {\\"a\\": null, \\"b\\": \\"b\\"} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": null} + {\\"a\\": null} Received: - {\\"a\\": undefined} + {\\"a\\": undefined} Difference: -- Expected -+ Received +- Expected ++ Received - 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 value to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {} + {} Difference: -- Expected -+ Received +- Expected ++ Received -- 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 value to match object: - 2015-10-10T00:00:00.000Z + 2015-10-10T00:00:00.000Z Received: - 2015-11-30T00:00:00.000Z + 2015-11-30T00:00:00.000Z Difference: -- Expected -+ Received +- Expected ++ Received -- 2015-10-10T00:00:00.000Z -+ 2015-11-30T00:00:00.000Z" +- 2015-10-10T00:00:00.000Z ++ 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 value to match object: - Set {2} + Set {2} Received: - Set {1, 2} + Set {1, 2} Difference: -- Expected -+ Received +- Expected ++ Received - Set { -+ 1, - 2, - }" + Set { ++ 1, + 2, + }" `; exports[`toMatchObject() {pass: true} expect([]).toMatchObject([]) 1`] = ` -"expect(received).not.toMatchObject(expected) +"expect(received).not.toMatchObject(expected) Expected value not to match object: - [] + [] Received: - []" + []" `; exports[`toMatchObject() {pass: true} expect([1, 2]).toMatchObject([1, 2]) 1`] = ` -"expect(received).not.toMatchObject(expected) +"expect(received).not.toMatchObject(expected) Expected value not to match object: - [1, 2] + [1, 2] Received: - [1, 2]" + [1, 2]" `; exports[`toMatchObject() {pass: true} expect([Error: bar]).toMatchObject({"message": "bar"}) 1`] = ` @@ -3993,230 +3993,230 @@ Received: `; exports[`toMatchObject() {pass: true} expect([Error: foo]).toMatchObject([Error: foo]) 1`] = ` -"expect(received).not.toMatchObject(expected) +"expect(received).not.toMatchObject(expected) Expected value not to match object: - [Error: foo] + [Error: foo] Received: - [Error: foo]" + [Error: foo]" `; 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 value not to match object: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} + {\\"a\\": \\"b\\", \\"c\\": \\"d\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"}" + {\\"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 value not to match object: - {\\"a\\": \\"b\\"} + {\\"a\\": \\"b\\"} Received: - {\\"a\\": \\"b\\", \\"c\\": \\"d\\"}" + {\\"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 value not to match object: - {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": \\"z\\"}} + {\\"a\\": \\"b\\", \\"t\\": {\\"z\\": \\"z\\"}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}}" + {\\"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 value not to match object: - {\\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}}} + {\\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}}} Received: - {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}}" + {\\"a\\": \\"b\\", \\"t\\": {\\"x\\": {\\"r\\": \\"r\\"}, \\"z\\": \\"z\\"}}" `; 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 value not to match object: - {\\"a\\": [{\\"a\\": \\"a\\"}]} + {\\"a\\": [{\\"a\\": \\"a\\"}]} Received: - {\\"a\\": [{\\"a\\": \\"a\\", \\"b\\": \\"b\\"}]}" + {\\"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 value not to match object: - {\\"a\\": [3, 4, 5, \\"v\\"]} + {\\"a\\": [3, 4, 5, \\"v\\"]} Received: - {\\"a\\": [3, 4, 5, \\"v\\"], \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": [3, 4, 5]} + {\\"a\\": [3, 4, 5]} Received: - {\\"a\\": [3, 4, 5], \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": {\\"x\\": Any}} + {\\"a\\": {\\"x\\": Any}} Received: - {\\"a\\": {\\"x\\": \\"x\\", \\"y\\": \\"y\\"}}" + {\\"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 value not to match object: - {\\"a\\": Any} + {\\"a\\": Any} Received: - {\\"a\\": 1, \\"c\\": 2}" + {\\"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 value not to match object: - {\\"a\\": 2015-11-30T00:00:00.000Z} + {\\"a\\": 2015-11-30T00:00:00.000Z} Received: - {\\"a\\": 2015-11-30T00:00:00.000Z, \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": null} + {\\"a\\": null} Received: - {\\"a\\": null, \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {\\"a\\": undefined, \\"b\\": \\"b\\"}" + {\\"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 value not to match object: - {\\"a\\": undefined} + {\\"a\\": undefined} Received: - {\\"a\\": undefined}" + {\\"a\\": undefined}" `; 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 value not to match object: - 2015-11-30T00:00:00.000Z + 2015-11-30T00:00:00.000Z Received: - 2015-11-30T00:00:00.000Z" + 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 value not to match object: - Set {1, 2} + Set {1, 2} Received: - Set {1, 2}" + 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 value not to match object: - Set {2, 1} + Set {2, 1} Received: - Set {1, 2}" + Set {1, 2}" `; exports[`toMatchObject() throws expect("44").toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. +received value must be an object. Received: - string: \\"44\\"" + string: \\"44\\"" `; exports[`toMatchObject() throws expect({}).toMatchObject("some string") 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. +expected value must be an object. Expected: - string: \\"some string\\"" + string: \\"some string\\"" `; exports[`toMatchObject() throws expect({}).toMatchObject(4) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. +expected value must be an object. Expected: - number: 4" + number: 4" `; exports[`toMatchObject() throws expect({}).toMatchObject(null) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. -Expected: null" +expected value must be an object. +Expected: null" `; exports[`toMatchObject() throws expect({}).toMatchObject(true) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. +expected value must be an object. Expected: - boolean: true" + boolean: true" `; exports[`toMatchObject() throws expect({}).toMatchObject(undefined) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -expected value must be an object. -Expected: undefined" +expected value must be an object. +Expected: undefined" `; exports[`toMatchObject() throws expect(4).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. +received value must be an object. Received: - number: 4" + number: 4" `; exports[`toMatchObject() throws expect(null).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. -Received: null" +received value must be an object. +Received: null" `; exports[`toMatchObject() throws expect(true).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. +received value must be an object. Received: - boolean: true" + boolean: true" `; exports[`toMatchObject() throws expect(undefined).toMatchObject({}) 1`] = ` -"expect(object)[.not].toMatchObject(expected) +"expect(object)[.not].toMatchObject(expected) -received value must be an object. -Received: undefined" -`; +received value must be an object. +Received: undefined" +`; \ No newline at end of file diff --git a/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap index 73f19bbda31d..57d0359bbec7 100644 --- a/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap @@ -1,82 +1,82 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`lastCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].lastCalledWith() +"expect(jest.fn())[.not].lastCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`lastCalledWith works when not called 1`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - [\\"foo\\", \\"bar\\"] -But it was not called." + [\\"foo\\", \\"bar\\"] +But it was not called." `; exports[`lastCalledWith works with Immutable.js objects 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" + [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" `; exports[`lastCalledWith works with Map 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [Map {1 => 2, 2 => 1}]" + [Map {1 => 2, 2 => 1}]" `; exports[`lastCalledWith works with Map 2`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." + Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." `; exports[`lastCalledWith works with Set 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [Set {1, 2}]" + [Set {1, 2}]" `; exports[`lastCalledWith works with Set 2`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - Set {3, 4} as argument 1, but it was called with Set {1, 2}." + Set {3, 4} as argument 1, but it was called with Set {1, 2}." `; exports[`lastCalledWith works with arguments that don't match 1`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`lastCalledWith works with arguments that match 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`lastCalledWith works with many arguments 1`] = ` -"expect(jest.fn()).not.lastCalledWith(expected) +"expect(jest.fn()).not.lastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`lastCalledWith works with many arguments that don't match 1`] = ` -"expect(jest.fn()).lastCalledWith(expected) +"expect(jest.fn()).lastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar3\\"." + \\"bar\\" as argument 2, but it was called with \\"bar3\\"." `; exports[`lastCalledWith works with trailing undefined arguments 1`] = ` @@ -87,226 +87,226 @@ Expected mock function to have been last called with: `; exports[`toBeCalled works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toBeCalled() +"expect(jest.fn())[.not].toBeCalled() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toBeCalled works with jest.fn 1`] = ` -"expect(jest.fn()).toBeCalled() +"expect(jest.fn()).toBeCalled() Expected mock function to have been called." `; exports[`toBeCalled works with jest.fn 2`] = ` -"expect(jest.fn()).not.toBeCalled() +"expect(jest.fn()).not.toBeCalled() Expected mock function not to be called but it was called with: - []" + []" `; exports[`toBeCalled works with jest.fn 3`] = ` -"expect(received)[.not].toBeCalled() +"expect(received)[.not].toBeCalled() Matcher does not accept any arguments. Got: - number: 555" + number: 555" `; exports[`toBeCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toBeCalledWith() +"expect(jest.fn())[.not].toBeCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalled works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toHaveBeenCalled() +"expect(jest.fn())[.not].toHaveBeenCalled() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalled works with jest.fn 1`] = ` -"expect(jest.fn()).toHaveBeenCalled() +"expect(jest.fn()).toHaveBeenCalled() Expected mock function to have been called." `; exports[`toHaveBeenCalled works with jest.fn 2`] = ` -"expect(jest.fn()).not.toHaveBeenCalled() +"expect(jest.fn()).not.toHaveBeenCalled() Expected mock function not to be called but it was called with: - []" + []" `; exports[`toHaveBeenCalled works with jest.fn 3`] = ` -"expect(received)[.not].toHaveBeenCalled() +"expect(received)[.not].toHaveBeenCalled() Matcher does not accept any arguments. Got: - number: 555" + number: 555" `; exports[`toHaveBeenCalledTimes accepts only numbers 1`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - object: {}" + object: {}" `; exports[`toHaveBeenCalledTimes accepts only numbers 2`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - array: []" + array: []" `; exports[`toHaveBeenCalledTimes accepts only numbers 3`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - boolean: true" + boolean: true" `; exports[`toHaveBeenCalledTimes accepts only numbers 4`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - string: \\"a\\"" + string: \\"a\\"" `; exports[`toHaveBeenCalledTimes accepts only numbers 5`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - map: Map {}" + map: Map {}" `; exports[`toHaveBeenCalledTimes accepts only numbers 6`] = ` -"expect(received)[.not].toHaveBeenCalledTimes(expected) +"expect(received)[.not].toHaveBeenCalledTimes(expected) Expected value must be a number. Got: - function: [Function anonymous]" + function: [Function anonymous]" `; exports[`toHaveBeenCalledTimes fails if function called less than expected times 1`] = ` -"expect(jest.fn()).toHaveBeenCalledTimes(2) +"expect(jest.fn()).toHaveBeenCalledTimes(2) -Expected mock function to have been called two times, but it was called one time." +Expected mock function to have been called two times, but it was called one time." `; exports[`toHaveBeenCalledTimes fails if function called more than expected times 1`] = ` -"expect(jest.fn()).toHaveBeenCalledTimes(2) +"expect(jest.fn()).toHaveBeenCalledTimes(2) -Expected mock function to have been called two times, but it was called three times." +Expected mock function to have been called two times, but it was called three times." `; exports[`toHaveBeenCalledTimes passes if function called equal to expected times 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledTimes(2) +"expect(jest.fn()).not.toHaveBeenCalledTimes(2) -Expected mock function not to be called two times, but it was called exactly two times." +Expected mock function not to be called two times, but it was called exactly two times." `; exports[`toHaveBeenCalledTimes verifies that actual is a Spy 1`] = ` -"expect(jest.fn())[.not].toHaveBeenCalledTimes() +"expect(jest.fn())[.not].toHaveBeenCalledTimes() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toHaveBeenCalledWith() +"expect(jest.fn())[.not].toHaveBeenCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenCalledWith works when not called 1`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - [\\"foo\\", \\"bar\\"] -But it was not called." + [\\"foo\\", \\"bar\\"] +But it was not called." `; exports[`toHaveBeenCalledWith works with Immutable.js objects 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" + [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" `; exports[`toHaveBeenCalledWith works with Map 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [Map {1 => 2, 2 => 1}]" + [Map {1 => 2, 2 => 1}]" `; exports[`toHaveBeenCalledWith works with Map 2`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." + Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." `; exports[`toHaveBeenCalledWith works with Set 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [Set {1, 2}]" + [Set {1, 2}]" `; exports[`toHaveBeenCalledWith works with Set 2`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - Set {3, 4} as argument 1, but it was called with Set {1, 2}." + Set {3, 4} as argument 1, but it was called with Set {1, 2}." `; exports[`toHaveBeenCalledWith works with arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`toHaveBeenCalledWith works with arguments that match 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenCalledWith works with many arguments 1`] = ` -"expect(jest.fn()).not.toHaveBeenCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenCalledWith(expected) Expected mock function not to have been called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenCalledWith works with many arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenCalledWith(expected) +"expect(jest.fn()).toHaveBeenCalledWith(expected) Expected mock function to have been called with: - \\"bar\\" as argument 2, but it was called with \\"bar3\\". + \\"bar\\" as argument 2, but it was called with \\"bar3\\". - \\"bar\\" as argument 2, but it was called with \\"bar2\\". + \\"bar\\" as argument 2, but it was called with \\"bar2\\". - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`toHaveBeenCalledWith works with trailing undefined arguments 1`] = ` @@ -317,82 +317,82 @@ Expected mock function to have been called with: `; exports[`toHaveBeenLastCalledWith works only on spies or jest.fn 1`] = ` -"expect(jest.fn())[.not].toHaveBeenLastCalledWith() +"expect(jest.fn())[.not].toHaveBeenLastCalledWith() -jest.fn() value must be a mock function or spy. +jest.fn() value must be a mock function or spy. Received: - function: [Function fn]" + function: [Function fn]" `; exports[`toHaveBeenLastCalledWith works when not called 1`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - [\\"foo\\", \\"bar\\"] -But it was not called." + [\\"foo\\", \\"bar\\"] +But it was not called." `; exports[`toHaveBeenLastCalledWith works with Immutable.js objects 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" + [Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}, Immutable.Map {\\"a\\": {\\"b\\": \\"c\\"}}]" `; exports[`toHaveBeenLastCalledWith works with Map 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [Map {1 => 2, 2 => 1}]" + [Map {1 => 2, 2 => 1}]" `; exports[`toHaveBeenLastCalledWith works with Map 2`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." + Map {\\"a\\" => \\"b\\", \\"b\\" => \\"a\\"} as argument 1, but it was called with Map {1 => 2, 2 => 1}." `; exports[`toHaveBeenLastCalledWith works with Set 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [Set {1, 2}]" + [Set {1, 2}]" `; exports[`toHaveBeenLastCalledWith works with Set 2`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - Set {3, 4} as argument 1, but it was called with Set {1, 2}." + Set {3, 4} as argument 1, but it was called with Set {1, 2}." `; exports[`toHaveBeenLastCalledWith works with arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar1\\"." + \\"bar\\" as argument 2, but it was called with \\"bar1\\"." `; exports[`toHaveBeenLastCalledWith works with arguments that match 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenLastCalledWith works with many arguments 1`] = ` -"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).not.toHaveBeenLastCalledWith(expected) Expected mock function to not have been last called with: - [\\"foo\\", \\"bar\\"]" + [\\"foo\\", \\"bar\\"]" `; exports[`toHaveBeenLastCalledWith works with many arguments that don't match 1`] = ` -"expect(jest.fn()).toHaveBeenLastCalledWith(expected) +"expect(jest.fn()).toHaveBeenLastCalledWith(expected) Expected mock function to have been last called with: - \\"bar\\" as argument 2, but it was called with \\"bar3\\"." + \\"bar\\" as argument 2, but it was called with \\"bar3\\"." `; exports[`toHaveBeenLastCalledWith works with trailing undefined arguments 1`] = ` @@ -400,4 +400,4 @@ exports[`toHaveBeenLastCalledWith works with trailing undefined arguments 1`] = Expected mock function to have been last called with: Did not expect argument 2 but it was called with undefined." -`; +`; \ No newline at end of file diff --git a/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap index 33966504aec7..7543f1a61c54 100644 --- a/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap @@ -1,199 +1,199 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`.toThrow() error class did not throw at all 1`] = ` -"expect(function).toThrow(type) +"expect(function).toThrow(type) Expected the function to throw an error of type: - \\"Err\\" + \\"Err\\" But it didn't throw anything." `; exports[`.toThrow() error class threw, but class did not match 1`] = ` -"expect(function).toThrow(type) +"expect(function).toThrow(type) Expected the function to throw an error of type: - \\"Err2\\" + \\"Err2\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() error class threw, but should not have 1`] = ` -"expect(function).not.toThrow(type) +"expect(function).not.toThrow(type) Expected the function not to throw an error of type: - \\"Err\\" + \\"Err\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() invalid actual 1`] = ` -"expect(function).toThrow(undefined) +"expect(function).toThrow(undefined) Received value must be a function, but instead \\"string\\" was found" `; exports[`.toThrow() invalid arguments 1`] = ` -"expect(function).not.toThrow(number) +"expect(function).not.toThrow(number) Unexpected argument passed. -Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". +Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". Got: - string: \\"111\\"" + string: \\"111\\"" `; exports[`.toThrow() regexp did not throw at all 1`] = ` -"expect(function).toThrow(regexp) +"expect(function).toThrow(regexp) Expected the function to throw an error matching: - /apple/ + /apple/ But it didn't throw anything." `; exports[`.toThrow() regexp threw, but message did not match 1`] = ` -"expect(function).toThrow(regexp) +"expect(function).toThrow(regexp) Expected the function to throw an error matching: - /banana/ + /banana/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() regexp threw, but should not have 1`] = ` -"expect(function).not.toThrow(regexp) +"expect(function).not.toThrow(regexp) Expected the function not to throw an error matching: - /apple/ + /apple/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() strings did not throw at all 1`] = ` -"expect(function).toThrow(string) +"expect(function).toThrow(string) Expected the function to throw an error matching: - \\"apple\\" + \\"apple\\" But it didn't throw anything." `; exports[`.toThrow() strings threw, but message did not match 1`] = ` -"expect(function).toThrow(string) +"expect(function).toThrow(string) Expected the function to throw an error matching: - \\"banana\\" + \\"banana\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrow() strings threw, but should not have 1`] = ` -"expect(function).not.toThrow(string) +"expect(function).not.toThrow(string) Expected the function not to throw an error matching: - \\"apple\\" + \\"apple\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() error class did not throw at all 1`] = ` -"expect(function).toThrowError(type) +"expect(function).toThrowError(type) Expected the function to throw an error of type: - \\"Err\\" + \\"Err\\" But it didn't throw anything." `; exports[`.toThrowError() error class threw, but class did not match 1`] = ` -"expect(function).toThrowError(type) +"expect(function).toThrowError(type) Expected the function to throw an error of type: - \\"Err2\\" + \\"Err2\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() error class threw, but should not have 1`] = ` -"expect(function).not.toThrowError(type) +"expect(function).not.toThrowError(type) Expected the function not to throw an error of type: - \\"Err\\" + \\"Err\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() invalid actual 1`] = ` -"expect(function).toThrowError(undefined) +"expect(function).toThrowError(undefined) Received value must be a function, but instead \\"string\\" was found" `; exports[`.toThrowError() invalid arguments 1`] = ` -"expect(function).not.toThrowError(number) +"expect(function).not.toThrowError(number) Unexpected argument passed. -Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". +Expected: \\"string\\", \\"Error (type)\\" or \\"regexp\\". Got: - string: \\"111\\"" + string: \\"111\\"" `; exports[`.toThrowError() regexp did not throw at all 1`] = ` -"expect(function).toThrowError(regexp) +"expect(function).toThrowError(regexp) Expected the function to throw an error matching: - /apple/ + /apple/ But it didn't throw anything." `; exports[`.toThrowError() regexp threw, but message did not match 1`] = ` -"expect(function).toThrowError(regexp) +"expect(function).toThrowError(regexp) Expected the function to throw an error matching: - /banana/ + /banana/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() regexp threw, but should not have 1`] = ` -"expect(function).not.toThrowError(regexp) +"expect(function).not.toThrowError(regexp) Expected the function not to throw an error matching: - /apple/ + /apple/ Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() strings did not throw at all 1`] = ` -"expect(function).toThrowError(string) +"expect(function).toThrowError(string) Expected the function to throw an error matching: - \\"apple\\" + \\"apple\\" But it didn't throw anything." `; exports[`.toThrowError() strings threw, but message did not match 1`] = ` -"expect(function).toThrowError(string) +"expect(function).toThrowError(string) Expected the function to throw an error matching: - \\"banana\\" + \\"banana\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" `; exports[`.toThrowError() strings threw, but should not have 1`] = ` -"expect(function).not.toThrowError(string) +"expect(function).not.toThrowError(string) Expected the function not to throw an error matching: - \\"apple\\" + \\"apple\\" Instead, it threw: - Error - at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" -`; + Error + at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" +`; \ No newline at end of file diff --git a/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap b/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap index 57879e05ccdb..d5c530f9cf18 100644 --- a/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap +++ b/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap @@ -7,14 +7,14 @@ exports[`SnapshotInteractiveMode updateWithResults overlay handle progress UI 1` [MOCK - cursorUp] [MOCK - eraseDown] -Interactive Snapshot Progress - › 2 suites failed, 1 suite passed - -Watch Usage - › Press u to update failing snapshots for this test. - › Press s to skip the current test suite. - › Press q to quit Interactive Snapshot Update Mode. - › Press Enter to trigger a test run. +Interactive Snapshot Progress + › 2 suites failed, 1 suite passed + +Watch Usage + › Press u to update failing snapshots for this test. + › Press s to skip the current test suite. + › Press q to quit Interactive Snapshot Update Mode. + › Press Enter to trigger a test run. " `; @@ -23,14 +23,14 @@ exports[`SnapshotInteractiveMode updateWithResults with a test failure simply up [MOCK - cursorUp] [MOCK - eraseDown] -Interactive Snapshot Progress - › 1 suite failed +Interactive Snapshot Progress + › 1 suite failed -Watch Usage - › Press u to update failing snapshots for this test. - › Press q to quit Interactive Snapshot Update Mode. - › Press Enter to trigger a test run. +Watch Usage + › Press u to update failing snapshots for this test. + › Press q to quit Interactive Snapshot Update Mode. + › Press Enter to trigger a test run. " `; -exports[`SnapshotInteractiveMode updateWithResults with a test success, call the next test 1`] = `"TEST RESULTS CONTENTS"`; +exports[`SnapshotInteractiveMode updateWithResults with a test success, call the next test 1`] = `"TEST RESULTS CONTENTS"`; \ No newline at end of file diff --git a/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js b/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js index 08b688f77aae..ea07bfc726ee 100644 --- a/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js +++ b/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js @@ -7,78 +7,55 @@ * @flow */ -'use strict'; - -import formatTestNameByPattern from '../format_test_name_by_pattern'; - -describe('for multiline test name returns', () => { - const testNames = [ - 'should\n name the \nfunction you attach', - 'should\r\n name the \r\nfunction you attach', - 'should\r name the \rfunction you attach', - ]; - - it('test name with highlighted pattern and replaced line breaks', () => { - const pattern = 'name'; - - testNames.forEach(testName => { - expect(formatTestNameByPattern(testName, pattern, 36)).toMatchSnapshot(); - }); - }); -}); - -describe('for one line test name', () => { - const testName = 'should name the function you attach'; - - describe('with pattern in the head returns', () => { - const pattern = 'should'; - - it('test name with highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); - }); - - it('test name with cutted tail and highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 30)).toMatchSnapshot(); - }); - - it('test name with cutted tail and cutted highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 8)).toMatchSnapshot(); - }); - }); - - describe('pattern in the middle', () => { - const pattern = 'name'; - - it('test name with highlighted pattern returns', () => { - expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); - }); - - it('test name with cutted tail and highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 25)).toMatchSnapshot(); - }); - - it('test name with cutted tail and cutted highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 13)).toMatchSnapshot(); - }); - - it('test name with highlighted cutted', () => { - expect(formatTestNameByPattern(testName, pattern, 6)).toMatchSnapshot(); - }); - }); - - describe('pattern in the tail returns', () => { - const pattern = 'attach'; - - it('test name with highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); - }); - - it('test name with cutted tail and cutted highlighted pattern', () => { - expect(formatTestNameByPattern(testName, pattern, 33)).toMatchSnapshot(); - }); - - it('test name with highlighted cutted', () => { - expect(formatTestNameByPattern(testName, pattern, 6)).toMatchSnapshot(); - }); - }); -}); +import chalk from 'chalk'; + +import colorize from './colorize'; + +const DOTS = '...'; +const ENTER = '⏎'; + +export default (testName: string, pattern: string, width: number) => { + const inlineTestName = testName.replace(/(\r\n|\n|\r)/gm, ENTER); + + let regexp; + + try { + regexp = new RegExp(pattern, 'i'); + } catch (e) { + return chalk.dim(inlineTestName); + } + + const match = inlineTestName.match(regexp); + + if (!match) { + return chalk.dim(inlineTestName); + } + + // $FlowFixMe + const startPatternIndex = Math.max(match.index, 0); + const endPatternIndex = startPatternIndex + match[0].length; + + if (inlineTestName.length <= width) { + return colorize(inlineTestName, startPatternIndex, endPatternIndex); + } + + const slicedTestName = inlineTestName.slice(0, width - DOTS.length); + + if (startPatternIndex < slicedTestName.length) { + if (endPatternIndex > slicedTestName.length) { + return colorize( + slicedTestName + DOTS, + startPatternIndex, + slicedTestName.length + DOTS.length, + ); + } else { + return colorize( + slicedTestName + DOTS, + Math.min(startPatternIndex, slicedTestName.length), + endPatternIndex, + ); + } + } + + return `${chalk.dim(slicedTestName)}${chalk.reset(DOTS)}`; +}; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap index 735c56ff9c78..5dd8bd9902b9 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap @@ -2,24 +2,24 @@ exports[`Retrieves the snapshot status 1`] = ` Array [ - " › 1 snapshot written.", - " › 1 snapshot updated.", - " › 1 obsolete snapshot found.", - " - test suite with unchecked snapshot", - " › 1 snapshot test failed.", + " › 1 snapshot written.", + " › 1 snapshot updated.", + " › 1 obsolete snapshot found.", + " - test suite with unchecked snapshot", + " › 1 snapshot test failed.", ] `; exports[`Retrieves the snapshot status after a snapshot update 1`] = ` Array [ - " › 2 snapshots written.", - " › 2 snapshots updated.", - " › 2 obsolete snapshots removed.", - " - first test suite with unchecked snapshot", - " - second test suite with unchecked snapshot", - " › Obsolete snapshot file removed.", - " › 2 snapshot tests failed.", + " › 2 snapshots written.", + " › 2 snapshots updated.", + " › 2 obsolete snapshots removed.", + " - first test suite with unchecked snapshot", + " - second test suite with unchecked snapshot", + " › Obsolete snapshot file removed.", + " › 2 snapshot tests failed.", ] `; -exports[`Shows no snapshot updates if all snapshots matched 1`] = `Array []`; +exports[`Shows no snapshot updates if all snapshots matched 1`] = `Array []`; \ No newline at end of file diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap index dafc55777837..0a64a48df342 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap @@ -2,39 +2,39 @@ exports[`creates a snapshot summary 1`] = ` Array [ - "Snapshot Summary", - " › 1 snapshot written in 1 test suite.", - " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", - " › 1 snapshot updated in 1 test suite.", - " › 1 obsolete snapshot file found, press --u to remove it.", - " › 1 obsolete snapshot found, press --u to remove it.", + "Snapshot Summary", + " › 1 snapshot written in 1 test suite.", + " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", + " › 1 snapshot updated in 1 test suite.", + " › 1 obsolete snapshot file found, press --u to remove it.", + " › 1 obsolete snapshot found, press --u to remove it.", ] `; exports[`creates a snapshot summary after an update 1`] = ` Array [ - "Snapshot Summary", - " › 1 snapshot written in 1 test suite.", - " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", - " › 1 snapshot updated in 1 test suite.", - " › 1 obsolete snapshot file removed.", - " › 1 obsolete snapshot removed.", + "Snapshot Summary", + " › 1 snapshot written in 1 test suite.", + " › 1 snapshot test failed in 1 test suite. Inspect your code changes or press --u to update them.", + " › 1 snapshot updated in 1 test suite.", + " › 1 obsolete snapshot file removed.", + " › 1 obsolete snapshot removed.", ] `; exports[`creates a snapshot summary with multiple snapshot being written/updated 1`] = ` Array [ - "Snapshot Summary", - " › 2 snapshots written in 2 test suites.", - " › 2 snapshot tests failed in 2 test suites. Inspect your code changes or press --u to update them.", - " › 2 snapshots updated in 2 test suites.", - " › 2 obsolete snapshot files found, press --u to remove them..", - " › 2 obsolete snapshots found, press --u to remove them.", + "Snapshot Summary", + " › 2 snapshots written in 2 test suites.", + " › 2 snapshot tests failed in 2 test suites. Inspect your code changes or press --u to update them.", + " › 2 snapshots updated in 2 test suites.", + " › 2 obsolete snapshot files found, press --u to remove them..", + " › 2 obsolete snapshots found, press --u to remove them.", ] `; exports[`returns nothing if there are no updates 1`] = ` Array [ - "Snapshot Summary", + "Snapshot Summary", ] -`; +`; \ No newline at end of file diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap index 5b0c9b3800dc..338541f969b8 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap @@ -1,25 +1,25 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`snapshots needs update with npm test 1`] = ` -"Snapshot Summary - › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`npm test -- -u\` to update them. +"Snapshot Summary + › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`npm test -- -u\` to update them. -Test Suites: 1 failed, 1 total -Tests: 1 failed, 1 total -Snapshots: 2 failed, 2 total -Time: 0.01s -Ran all test suites. +Test Suites: 1 failed, 1 total +Tests: 1 failed, 1 total +Snapshots: 2 failed, 2 total +Time: 0.01s +Ran all test suites. " `; exports[`snapshots needs update with yarn test 1`] = ` -"Snapshot Summary - › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`yarn test -u\` to update them. +"Snapshot Summary + › 2 snapshot tests failed in 1 test suite. Inspect your code changes or run \`yarn test -u\` to update them. -Test Suites: 1 failed, 1 total -Tests: 1 failed, 1 total -Snapshots: 2 failed, 2 total -Time: 0.01s -Ran all test suites. +Test Suites: 1 failed, 1 total +Tests: 1 failed, 1 total +Snapshots: 2 failed, 2 total +Time: 0.01s +Ran all test suites. " -`; +`; \ No newline at end of file diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap index d063c2f9bfc8..103cfb815e4a 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap @@ -1,23 +1,23 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`trimAndFormatPath() does not trim anything 1`] = `"1234567890/1234567890/1234.js"`; +exports[`trimAndFormatPath() does not trim anything 1`] = `"1234567890/1234567890/1234.js"`; -exports[`trimAndFormatPath() split at the path.sep index 1`] = `".../1234.js"`; +exports[`trimAndFormatPath() split at the path.sep index 1`] = `".../1234.js"`; -exports[`trimAndFormatPath() trims dirname (longer line width) 1`] = `"...890/1234567890/1234.js"`; +exports[`trimAndFormatPath() trims dirname (longer line width) 1`] = `"...890/1234567890/1234.js"`; -exports[`trimAndFormatPath() trims dirname 1`] = `"...234567890/1234.js"`; +exports[`trimAndFormatPath() trims dirname 1`] = `"...234567890/1234.js"`; -exports[`trimAndFormatPath() trims dirname and basename 1`] = `"...1234.js"`; +exports[`trimAndFormatPath() trims dirname and basename 1`] = `"...1234.js"`; exports[`wrapAnsiString() returns the string unaltered if given a terminal width of zero 1`] = `"This string shouldn't cause you any trouble"`; exports[`wrapAnsiString() returns the string unaltered if given a terminal width of zero 2`] = `"This string shouldn't cause you any trouble"`; exports[`wrapAnsiString() wraps a long string containing ansi chars 1`] = ` -"abcde red- -bold 12344 -56bcd 123t +"abcde red- +bold 12344 +56bcd 123t tttttththt hththththt hththththt @@ -25,8 +25,8 @@ hththththt hthththtet etetetette tetetetete -tetetestnh -snthsnthss +tetetestnh +snthsnthss ot" `; @@ -44,4 +44,4 @@ tetetetete tetetestnh snthsnthss ot" -`; +`; \ No newline at end of file diff --git a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap index d61ef3cce67d..d466da778134 100644 --- a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap +++ b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap @@ -1,73 +1,73 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Upgrade help logs a warning when \`scriptPreprocessor\` and/or \`preprocessorIgnorePatterns\` are used 1`] = ` -"● Deprecation Warning: - - Option \\"preprocessorIgnorePatterns\\" was replaced by \\"transformIgnorePatterns\\", which support multiple preprocessors. - - Jest now treats your current configuration as: - { - \\"transformIgnorePatterns\\": [\\"bar/baz\\", \\"qux/quux\\"] - } - - Please update your configuration. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +" Deprecation Warning: + + Option \\"preprocessorIgnorePatterns\\" was replaced by \\"transformIgnorePatterns\\", which support multiple preprocessors. + + Jest now treats your current configuration as: + { + \\"transformIgnorePatterns\\": [\\"bar/baz\\", \\"qux/quux\\"] + } + + Please update your configuration. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`preset throws when preset is invalid 1`] = ` -"● Validation Error: - - Preset react-native is invalid: - Unexpected token } in JSON at position 104 - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"Validation Error: + + Preset react-native is invalid: + Unexpected token } in JSON at position 104 + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`preset throws when preset not found 1`] = ` -"● Validation Error: - - Preset doesnt-exist not found. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"Validation Error: + + Preset doesnt-exist not found. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`rootDir throws if the options is missing a rootDir property 1`] = ` -"● Validation Error: - - Configuration option rootDir must be specified. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"Validation Error: + + Configuration option rootDir must be specified. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`testEnvironment throws on invalid environment names 1`] = ` -"● Validation Error: - - Test environment phantom cannot be found. Make sure the testEnvironment configuration option points to an existing node module. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"Validation Error: + + Test environment phantom cannot be found. Make sure the testEnvironment configuration option points to an existing node module. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; exports[`testMatch throws if testRegex and testMatch are both specified 1`] = ` -"● Validation Error: - - Configuration options testMatch and testRegex cannot be used together. - - Configuration Documentation: - https://facebook.github.io/jest/docs/configuration.html -" +"Validation Error: + + Configuration options testMatch and testRegex cannot be used together. + + Configuration Documentation: + https://facebook.github.io/jest/docs/configuration.html +" `; -exports[`testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; +exports[`testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; -exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; +exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; \ No newline at end of file diff --git a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap index f2e4a904697a..fc0d5efbd332 100644 --- a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap +++ b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap @@ -1,210 +1,210 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`background color of spaces cyan for inchanged (expanded) 1`] = ` -"- Expected -+ Received - -
-+

- - following string consists of a space: - - line has preceding space only - line has both preceding and following space - line has following space only - -+

-
" +"- Expected ++ Received + +
++

+ + following string consists of a space: + + line has preceding space only + line has both preceding and following space + line has following space only + ++

+
" `; exports[`background color of spaces green for removed (expanded) 1`] = ` -"- Expected -+ Received - -
- -- following string consists of a space: -- -- line has preceding space only -- line has both preceding and following space -- line has following space only -+ - -
" +"- Expected ++ Received + +
+ +- following string consists of a space: +- +- line has preceding space only +- line has both preceding and following space +- line has following space only ++ + +
" `; exports[`background color of spaces red for added (expanded) 1`] = ` -"- Expected -+ Received - -
- -- -+ following string consists of a space: -+ -+ line has preceding space only -+ line has both preceding and following space -+ line has following space only - -
" +"- Expected ++ Received + +
+ +- ++ following string consists of a space: ++ ++ line has preceding space only ++ line has both preceding and following space ++ line has following space only + +
" `; exports[`background color of spaces yellow for unchanged (expanded) 1`] = ` -"- Expected -+ Received - -
-- -+

- following string consists of a space: - - line has preceding space only - line has both preceding and following space - line has following space only -- -+

-
" +"- Expected ++ Received + +
+- ++

+ following string consists of a space: + + line has preceding space only + line has both preceding and following space + line has following space only +- ++

+
" `; exports[`collapses big diffs to patch format 1`] = ` -"- Expected -+ Received - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`color of text (expanded) 1`] = ` -"- Expected -+ Received - - Object { - \\"searching\\": \\"\\", -- \\"sorting\\": Object { -+ \\"sorting\\": Array [ -+ Object { - \\"descending\\": false, - \\"fieldKey\\": \\"what\\", - }, -+ ], - }" +"- Expected ++ Received + + Object { + \\"searching\\": \\"\\", +- \\"sorting\\": Object { ++ \\"sorting\\": Array [ ++ Object { + \\"descending\\": false, + \\"fieldKey\\": \\"what\\", + }, ++ ], + }" `; exports[`context number of lines: -1 (5 default) 1`] = ` -"- Expected -+ Received - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`context number of lines: 0 1`] = ` -"- Expected -+ Received +"- Expected ++ Received -@@ -11,0 +11,1 @@ -+ 10, -@@ -12,1 +13,0 @@ -- 10," +@@ -11,0 +11,1 @@ ++ 10, +@@ -12,1 +13,0 @@ +- 10," `; exports[`context number of lines: 1 1`] = ` -"- Expected -+ Received - -@@ -10,4 +10,4 @@ - 8, -+ 10, - 9, -- 10, - ]," +"- Expected ++ Received + +@@ -10,4 +10,4 @@ + 8, ++ 10, + 9, +- 10, + ]," `; exports[`context number of lines: 2 1`] = ` -"- Expected -+ Received - -@@ -9,6 +9,6 @@ - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -9,6 +9,6 @@ + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`context number of lines: null (5 default) 1`] = ` -"- Expected -+ Received - -@@ -6,9 +6,9 @@ - 4, - 5, - 6, - 7, - 8, -+ 10, - 9, -- 10, - ], - }" +"- Expected ++ Received + +@@ -6,9 +6,9 @@ + 4, + 5, + 6, + 7, + 8, ++ 10, + 9, +- 10, + ], + }" `; exports[`falls back to not call toJSON if it throws and then objects have differences 1`] = ` -"- Expected -+ Received - - Object { -- \\"line\\": 1, -+ \\"line\\": 2, - \\"toJSON\\": [Function toJSON], - }" +"- Expected ++ Received + + Object { +- \\"line\\": 1, ++ \\"line\\": 2, + \\"toJSON\\": [Function toJSON], + }" `; exports[`falls back to not call toJSON if serialization has no differences but then objects have differences 1`] = ` -"Compared values serialize to the same structure. -Printing internal object structure without calling \`toJSON\` instead. +"Compared values serialize to the same structure. +Printing internal object structure without calling \`toJSON\` instead. -- Expected -+ Received +- Expected ++ Received - Object { -- \\"line\\": 1, -+ \\"line\\": 2, - \\"toJSON\\": [Function toJSON], - }" + Object { +- \\"line\\": 1, ++ \\"line\\": 2, + \\"toJSON\\": [Function toJSON], + }" `; exports[`highlight only the last in odd length of leading spaces (expanded) 1`] = ` -"- Expected -+ Received - -
--   attributes.reduce(function (props, attribute) {
--    props[attribute.name] = attribute.value;
-+   attributes.reduce((props, {name, value}) => {
-+   props[name] = value;
-    return props;
--  }, {});
-+ }, {});
-  
" -`; +"- Expected ++ Received + +
+-   attributes.reduce(function (props, attribute) {
+-    props[attribute.name] = attribute.value;
++   attributes.reduce((props, {name, value}) => {
++   props[name] = value;
+    return props;
+-  }, {});
++ }, {});
+  
" +`; \ No newline at end of file diff --git a/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap index ffb7743af5ed..75ec0765f3a3 100644 --- a/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap @@ -1,10 +1,10 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`matchers proxies matchers to expect 1`] = ` -"expect(received).toBe(expected) // Object.is equality +"expect(received).toBe(expected) // Object.is equality Expected value to be: - 2 + 2 Received: - 1" -`; + 1" +`; \ No newline at end of file diff --git a/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap b/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap index 8970f4e993db..6dd5b8844bb7 100644 --- a/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap +++ b/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap @@ -5,21 +5,21 @@ exports[`.stringify() reduces maxDepth if stringifying very large objects 1`] = exports[`.stringify() reduces maxDepth if stringifying very large objects 2`] = `"{\\"a\\": 1, \\"b\\": {\\"0\\": \\"test\\", \\"1\\": \\"test\\", \\"2\\": \\"test\\", \\"3\\": \\"test\\", \\"4\\": \\"test\\", \\"5\\": \\"test\\", \\"6\\": \\"test\\", \\"7\\": \\"test\\", \\"8\\": \\"test\\", \\"9\\": \\"test\\"}}"`; exports[`.stringify() toJSON errors when comparing two objects 1`] = ` -"expect(received).toEqual(expected) +"expect(received).toEqual(expected) Expected value to equal: - {\\"b\\": 1, \\"toJSON\\": [Function toJSON]} + {\\"b\\": 1, \\"toJSON\\": [Function toJSON]} Received: - {\\"a\\": 1, \\"toJSON\\": [Function toJSON]} + {\\"a\\": 1, \\"toJSON\\": [Function toJSON]} Difference: -- Expected -+ Received +- Expected ++ Received - Object { -- \\"b\\": 1, -+ \\"a\\": 1, - \\"toJSON\\": [Function toJSON], - }" -`; + Object { +- \\"b\\": 1, ++ \\"a\\": 1, + \\"toJSON\\": [Function toJSON], + }" +`; \ No newline at end of file diff --git a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap index 2d79ba387112..63132b20b0fd 100644 --- a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap +++ b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`.formatExecError() 1`] = ` -" ● Test suite failed to run +" ● Test suite failed to run Whoops! " `; exports[`formatStackTrace should strip node internals 1`] = ` -" ● Unix test +" Unix test Expected value to be of type: @@ -17,19 +17,19 @@ exports[`formatStackTrace should strip node internals 1`] = ` \\"\\" type: \\"string\\" - - - at Object.it (__tests__/test.js:8:14) - + + + at Object.it (__tests__/test.js:8:14) + " `; exports[`should exclude jasmine from stack trace for Unix paths. 1`] = ` -" ● Unix test +" Unix test at stack (../jest-jasmine2/build/jasmine-2.4.1.js:1580:17) - - at Object.addResult (../jest-jasmine2/build/jasmine-2.4.1.js:1550:14) - at Object.it (build/__tests__/messages-test.js:45:41) + + at Object.addResult (../jest-jasmine2/build/jasmine-2.4.1.js:1550:14) + at Object.it (build/__tests__/messages-test.js:45:41) " -`; +`; \ No newline at end of file diff --git a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap index af77f3aca1ee..b4587c314bcb 100644 --- a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap +++ b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap @@ -1,138 +1,138 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`displays warning for deprecated config options 1`] = ` -"● Deprecation Warning: - - Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. - - Jest now treats your current configuration as: - { - \\"transform\\": {\\".*\\": \\"test\\"} - } - - Please update your configuration. -" +" Deprecation Warning: + + Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. + + Jest now treats your current configuration as: + { + \\"transform\\": {\\".*\\": \\"test\\"} + } + + Please update your configuration. +" `; exports[`displays warning for unknown config options 1`] = ` -"● Validation Warning: - - Unknown option \\"unkwon\\" with value {} was found. Did you mean \\"unknown\\"? - This is probably a typing mistake. Fixing it will remove this message. -" +" Validation Warning: + + Unknown option \\"unkwon\\" with value {} was found. Did you mean \\"unknown\\"? + This is probably a typing mistake. Fixing it will remove this message. +" `; exports[`pretty prints valid config for Array 1`] = ` -"● Validation Error: - - Option \\"coverageReporters\\" must be of type: - array - but instead received: - object - - Example: - { - \\"coverageReporters\\": [\\"json\\", \\"text\\", \\"lcov\\", \\"clover\\"] - } -" +" Validation Error: + + Option \\"coverageReporters\\" must be of type: + array + but instead received: + object + + Example: + { + \\"coverageReporters\\": [\\"json\\", \\"text\\", \\"lcov\\", \\"clover\\"] + } +" `; exports[`pretty prints valid config for Boolean 1`] = ` -"● Validation Error: - - Option \\"automock\\" must be of type: - boolean - but instead received: - array - - Example: - { - \\"automock\\": false - } -" +" Validation Error: + + Option \\"automock\\" must be of type: + boolean + but instead received: + array + + Example: + { + \\"automock\\": false + } +" `; exports[`pretty prints valid config for Function 1`] = ` -"● Validation Error: - - Option \\"fn\\" must be of type: - function - but instead received: - string - - Example: - { - \\"fn\\": (config, option, deprecatedOptions) => true - } -" +" Validation Error: + + Option \\"fn\\" must be of type: + function + but instead received: + string + + Example: + { + \\"fn\\": (config, option, deprecatedOptions) => true + } +" `; exports[`pretty prints valid config for Object 1`] = ` -"● Validation Error: - - Option \\"haste\\" must be of type: - object - but instead received: - number - - Example: - { - \\"haste\\": {\\"providesModuleNodeModules\\": [\\"react\\", \\"react-native\\"]} - } -" +" Validation Error: + + Option \\"haste\\" must be of type: + object + but instead received: + number + + Example: + { + \\"haste\\": {\\"providesModuleNodeModules\\": [\\"react\\", \\"react-native\\"]} + } +" `; exports[`pretty prints valid config for String 1`] = ` -"● Validation Error: - - Option \\"preset\\" must be of type: - string - but instead received: - number - - Example: - { - \\"preset\\": \\"react-native\\" - } -" +" Validation Error: + + Option \\"preset\\" must be of type: + string + but instead received: + number + + Example: + { + \\"preset\\": \\"react-native\\" + } +" `; exports[`works with custom deprecations 1`] = ` -"My Custom Deprecation Warning: - - Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. - - Jest now treats your current configuration as: - { - \\"transform\\": {\\".*\\": \\"test\\"} - } - - Please update your configuration. - -My custom comment" +"My Custom Deprecation Warning: + + Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. + + Jest now treats your current configuration as: + { + \\"transform\\": {\\".*\\": \\"test\\"} + } + + Please update your configuration. + +My custom comment" `; exports[`works with custom errors 1`] = ` -"My Custom Error: - - Option \\"test\\" must be of type: - array - but instead received: - string - - Example: - { - \\"test\\": [1, 2] - } - -My custom comment" +"My Custom Error: + + Option \\"test\\" must be of type: + array + but instead received: + string + + Example: + { + \\"test\\": [1, 2] + } + +My custom comment" `; exports[`works with custom warnings 1`] = ` -"My Custom Warning: - - Unknown option \\"unknown\\" with value \\"string\\" was found. - This is probably a typing mistake. Fixing it will remove this message. - -My custom comment" -`; +"My Custom Warning: + + Unknown option \\"unknown\\" with value \\"string\\" was found. + This is probably a typing mistake. Fixing it will remove this message. + +My custom comment" +`; \ No newline at end of file diff --git a/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap index f244b8e2570b..178837444409 100644 --- a/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap +++ b/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap @@ -1,22 +1,22 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`fails for multiple unknown options 1`] = ` -"● Unrecognized CLI Parameters: - - Following options were not recognized: - [\\"jest\\", \\"test\\"] - - CLI Options Documentation: - https://facebook.github.io/jest/docs/en/cli.html -" +" Unrecognized CLI Parameters: + + Following options were not recognized: + [\\"jest\\", \\"test\\"] + + CLI Options Documentation: + https://facebook.github.io/jest/docs/en/cli.html +" `; exports[`fails for unknown option 1`] = ` -"● Unrecognized CLI Parameter: - - Unrecognized option \\"unknown\\". - - CLI Options Documentation: - https://facebook.github.io/jest/docs/en/cli.html -" -`; +" Unrecognized CLI Parameter: + + Unrecognized option \\"unknown\\". + + CLI Options Documentation: + https://facebook.github.io/jest/docs/en/cli.html +" +`; \ No newline at end of file From f92e7255fc0209a25787d09e512e87005ef3df81 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 22:30:24 -0500 Subject: [PATCH 92/97] fix: adds missing cli snapshot --- .../format_test_name_by_pattern.test.js.snap | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap b/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap index 9051a1b9174d..7b0a66d21785 100644 --- a/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap +++ b/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap @@ -1,27 +1,27 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 1`] = `"should⏎ name the ⏎function you at..."`; +exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 1`] = `"should⏎ name the ⏎function you at..."`; -exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 2`] = `"should⏎ name the ⏎function you at..."`; +exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 2`] = `"should⏎ name the ⏎function you at..."`; -exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 3`] = `"should⏎ name the ⏎function you at..."`; +exports[`for multiline test name returns test name with highlighted pattern and replaced line breaks 3`] = `"should⏎ name the ⏎function you at..."`; -exports[`for one line test name pattern in the middle test name with cutted tail and cutted highlighted pattern 1`] = `"should nam..."`; +exports[`for one line test name pattern in the middle test name with cutted tail and cutted highlighted pattern 1`] = `"should nam..."`; -exports[`for one line test name pattern in the middle test name with cutted tail and highlighted pattern 1`] = `"should name the functi..."`; +exports[`for one line test name pattern in the middle test name with cutted tail and highlighted pattern 1`] = `"should name the functi..."`; -exports[`for one line test name pattern in the middle test name with highlighted cutted 1`] = `"sho..."`; +exports[`for one line test name pattern in the middle test name with highlighted cutted 1`] = `"sho..."`; -exports[`for one line test name pattern in the middle test name with highlighted pattern returns 1`] = `"should name the function you attach"`; +exports[`for one line test name pattern in the middle test name with highlighted pattern returns 1`] = `"should name the function you attach"`; -exports[`for one line test name pattern in the tail returns test name with cutted tail and cutted highlighted pattern 1`] = `"should name the function you a..."`; +exports[`for one line test name pattern in the tail returns test name with cutted tail and cutted highlighted pattern 1`] = `"should name the function you a..."`; -exports[`for one line test name pattern in the tail returns test name with highlighted cutted 1`] = `"sho..."`; +exports[`for one line test name pattern in the tail returns test name with highlighted cutted 1`] = `"sho..."`; -exports[`for one line test name pattern in the tail returns test name with highlighted pattern 1`] = `"should name the function you attach"`; +exports[`for one line test name pattern in the tail returns test name with highlighted pattern 1`] = `"should name the function you attach"`; -exports[`for one line test name with pattern in the head returns test name with cutted tail and cutted highlighted pattern 1`] = `"shoul..."`; +exports[`for one line test name with pattern in the head returns test name with cutted tail and cutted highlighted pattern 1`] = `"shoul..."`; -exports[`for one line test name with pattern in the head returns test name with cutted tail and highlighted pattern 1`] = `"should name the function yo..."`; +exports[`for one line test name with pattern in the head returns test name with cutted tail and highlighted pattern 1`] = `"should name the function yo..."`; -exports[`for one line test name with pattern in the head returns test name with highlighted pattern 1`] = `"should name the function you attach"`; +exports[`for one line test name with pattern in the head returns test name with highlighted pattern 1`] = `"should name the function you attach"`; \ No newline at end of file From 7ab85b19133a681271a0fa6dc4f85e7df8d9b7df Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Mon, 19 Feb 2018 22:53:16 -0500 Subject: [PATCH 93/97] fix: format test name bad commit --- .../format_test_name_by_pattern.test.js.snap | 2 +- .../format_test_name_by_pattern.test.js | 127 +++++++++++------- 2 files changed, 76 insertions(+), 53 deletions(-) diff --git a/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap b/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap index 7b0a66d21785..64210a3277f4 100644 --- a/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap +++ b/packages/jest-cli/src/lib/__tests__/__snapshots__/format_test_name_by_pattern.test.js.snap @@ -24,4 +24,4 @@ exports[`for one line test name with pattern in the head returns test name with exports[`for one line test name with pattern in the head returns test name with cutted tail and highlighted pattern 1`] = `"should name the function yo..."`; -exports[`for one line test name with pattern in the head returns test name with highlighted pattern 1`] = `"should name the function you attach"`; \ No newline at end of file +exports[`for one line test name with pattern in the head returns test name with highlighted pattern 1`] = `"should name the function you attach"`; diff --git a/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js b/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js index ea07bfc726ee..08b688f77aae 100644 --- a/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js +++ b/packages/jest-cli/src/lib/__tests__/format_test_name_by_pattern.test.js @@ -7,55 +7,78 @@ * @flow */ -import chalk from 'chalk'; - -import colorize from './colorize'; - -const DOTS = '...'; -const ENTER = '⏎'; - -export default (testName: string, pattern: string, width: number) => { - const inlineTestName = testName.replace(/(\r\n|\n|\r)/gm, ENTER); - - let regexp; - - try { - regexp = new RegExp(pattern, 'i'); - } catch (e) { - return chalk.dim(inlineTestName); - } - - const match = inlineTestName.match(regexp); - - if (!match) { - return chalk.dim(inlineTestName); - } - - // $FlowFixMe - const startPatternIndex = Math.max(match.index, 0); - const endPatternIndex = startPatternIndex + match[0].length; - - if (inlineTestName.length <= width) { - return colorize(inlineTestName, startPatternIndex, endPatternIndex); - } - - const slicedTestName = inlineTestName.slice(0, width - DOTS.length); - - if (startPatternIndex < slicedTestName.length) { - if (endPatternIndex > slicedTestName.length) { - return colorize( - slicedTestName + DOTS, - startPatternIndex, - slicedTestName.length + DOTS.length, - ); - } else { - return colorize( - slicedTestName + DOTS, - Math.min(startPatternIndex, slicedTestName.length), - endPatternIndex, - ); - } - } - - return `${chalk.dim(slicedTestName)}${chalk.reset(DOTS)}`; -}; +'use strict'; + +import formatTestNameByPattern from '../format_test_name_by_pattern'; + +describe('for multiline test name returns', () => { + const testNames = [ + 'should\n name the \nfunction you attach', + 'should\r\n name the \r\nfunction you attach', + 'should\r name the \rfunction you attach', + ]; + + it('test name with highlighted pattern and replaced line breaks', () => { + const pattern = 'name'; + + testNames.forEach(testName => { + expect(formatTestNameByPattern(testName, pattern, 36)).toMatchSnapshot(); + }); + }); +}); + +describe('for one line test name', () => { + const testName = 'should name the function you attach'; + + describe('with pattern in the head returns', () => { + const pattern = 'should'; + + it('test name with highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); + }); + + it('test name with cutted tail and highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 30)).toMatchSnapshot(); + }); + + it('test name with cutted tail and cutted highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 8)).toMatchSnapshot(); + }); + }); + + describe('pattern in the middle', () => { + const pattern = 'name'; + + it('test name with highlighted pattern returns', () => { + expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); + }); + + it('test name with cutted tail and highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 25)).toMatchSnapshot(); + }); + + it('test name with cutted tail and cutted highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 13)).toMatchSnapshot(); + }); + + it('test name with highlighted cutted', () => { + expect(formatTestNameByPattern(testName, pattern, 6)).toMatchSnapshot(); + }); + }); + + describe('pattern in the tail returns', () => { + const pattern = 'attach'; + + it('test name with highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 35)).toMatchSnapshot(); + }); + + it('test name with cutted tail and cutted highlighted pattern', () => { + expect(formatTestNameByPattern(testName, pattern, 33)).toMatchSnapshot(); + }); + + it('test name with highlighted cutted', () => { + expect(formatTestNameByPattern(testName, pattern, 6)).toMatchSnapshot(); + }); + }); +}); From c1753b3a9472e1dd8b18f7e36d3326374f64ba48 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Tue, 20 Feb 2018 09:51:22 -0500 Subject: [PATCH 94/97] fix: adds back trailing newline --- packages/expect/src/__tests__/__snapshots__/extend.test.js.snap | 2 +- .../expect/src/__tests__/__snapshots__/matchers.test.js.snap | 2 +- .../src/__tests__/__snapshots__/spy_matchers.test.js.snap | 2 +- .../src/__tests__/__snapshots__/to_throw_matchers.test.js.snap | 2 +- .../__snapshots__/snapshot_interactive_mode.test.js.snap | 2 +- .../__tests__/__snapshots__/get_snapshot_status.test.js.snap | 2 +- .../__tests__/__snapshots__/get_snapshot_summary.test.js.snap | 2 +- .../__tests__/__snapshots__/summary_reporter.test.js.snap | 2 +- .../src/reporters/__tests__/__snapshots__/utils.test.js.snap | 2 +- .../src/__tests__/__snapshots__/normalize.test.js.snap | 2 +- .../jest-diff/src/__tests__/__snapshots__/diff.test.js.snap | 2 +- .../src/__tests__/__snapshots__/matchers.test.js.snap | 2 +- .../src/__tests__/__snapshots__/index.test.js.snap | 2 +- .../src/__tests__/__snapshots__/messages.test.js.snap | 2 +- .../src/__tests__/__snapshots__/validate.test.js.snap | 2 +- .../__tests__/__snapshots__/validate_cli_options.test.js.snap | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap b/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap index a9d13ec56996..7565cb732261 100644 --- a/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/extend.test.js.snap @@ -2,4 +2,4 @@ exports[`is available globally 1`] = `"expected 15 to be divisible by 2"`; -exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`; \ No newline at end of file +exports[`is ok if there is no message specified 1`] = `"No message was specified for this matcher."`; diff --git a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap index d22487ff6113..88231feef9a7 100644 --- a/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/matchers.test.js.snap @@ -4219,4 +4219,4 @@ exports[`toMatchObject() throws expect(undefined).toMatchObject({}) 1`] = ` received value must be an object. Received: undefined" -`; \ No newline at end of file +`; diff --git a/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap index 57d0359bbec7..484e8f52260e 100644 --- a/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/spy_matchers.test.js.snap @@ -400,4 +400,4 @@ exports[`toHaveBeenLastCalledWith works with trailing undefined arguments 1`] = Expected mock function to have been last called with: Did not expect argument 2 but it was called with undefined." -`; \ No newline at end of file +`; diff --git a/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap b/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap index 7543f1a61c54..3c7fd01c7f58 100644 --- a/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap +++ b/packages/expect/src/__tests__/__snapshots__/to_throw_matchers.test.js.snap @@ -196,4 +196,4 @@ Expected the function not to throw an error matching: Instead, it threw: Error at jestExpect (packages/expect/src/__tests__/toThrowMatchers-test.js:24:74)" -`; \ No newline at end of file +`; diff --git a/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap b/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap index d5c530f9cf18..fd47bf1ef31f 100644 --- a/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap +++ b/packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap @@ -33,4 +33,4 @@ exports[`SnapshotInteractiveMode updateWithResults with a test failure simply up " `; -exports[`SnapshotInteractiveMode updateWithResults with a test success, call the next test 1`] = `"TEST RESULTS CONTENTS"`; \ No newline at end of file +exports[`SnapshotInteractiveMode updateWithResults with a test success, call the next test 1`] = `"TEST RESULTS CONTENTS"`; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap index 5dd8bd9902b9..45a0d0760608 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_status.test.js.snap @@ -22,4 +22,4 @@ Array [ ] `; -exports[`Shows no snapshot updates if all snapshots matched 1`] = `Array []`; \ No newline at end of file +exports[`Shows no snapshot updates if all snapshots matched 1`] = `Array []`; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap index 0a64a48df342..ceb2aa87d21b 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/get_snapshot_summary.test.js.snap @@ -37,4 +37,4 @@ exports[`returns nothing if there are no updates 1`] = ` Array [ "Snapshot Summary", ] -`; \ No newline at end of file +`; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap index 338541f969b8..55fb2f7428f7 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap @@ -22,4 +22,4 @@ exports[`snapshots needs update with yarn test 1`] = ` Time: 0.01s Ran all test suites. " -`; \ No newline at end of file +`; diff --git a/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap b/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap index 103cfb815e4a..4c7556f9f5f0 100644 --- a/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap +++ b/packages/jest-cli/src/reporters/__tests__/__snapshots__/utils.test.js.snap @@ -44,4 +44,4 @@ tetetetete tetetestnh snthsnthss ot" -`; \ No newline at end of file +`; diff --git a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap index d466da778134..b3c6e240ddd7 100644 --- a/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap +++ b/packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap @@ -70,4 +70,4 @@ exports[`testMatch throws if testRegex and testMatch are both specified 1`] = ` exports[`testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; -exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; \ No newline at end of file +exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `" Invalid testPattern a( supplied. Running all tests instead."`; diff --git a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap index fc0d5efbd332..e6dc7169be86 100644 --- a/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap +++ b/packages/jest-diff/src/__tests__/__snapshots__/diff.test.js.snap @@ -207,4 +207,4 @@ exports[`highlight only the last in odd length of leading spaces (expanded) 1`] - }, {}); + }, {}); " -`; \ No newline at end of file +`; diff --git a/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap b/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap index 75ec0765f3a3..d94175512f98 100644 --- a/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap +++ b/packages/jest-jasmine2/src/__tests__/__snapshots__/matchers.test.js.snap @@ -7,4 +7,4 @@ Expected value to be: 2 Received: 1" -`; \ No newline at end of file +`; diff --git a/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap b/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap index 6dd5b8844bb7..7a8565648a34 100644 --- a/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap +++ b/packages/jest-matcher-utils/src/__tests__/__snapshots__/index.test.js.snap @@ -22,4 +22,4 @@ Difference: + \\"a\\": 1, \\"toJSON\\": [Function toJSON], }" -`; \ No newline at end of file +`; diff --git a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap index 63132b20b0fd..b4ebdf847fe3 100644 --- a/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap +++ b/packages/jest-message-util/src/__tests__/__snapshots__/messages.test.js.snap @@ -32,4 +32,4 @@ exports[`should exclude jasmine from stack trace for Unix paths. 1`] = ` at Object.addResult (../jest-jasmine2/build/jasmine-2.4.1.js:1550:14) at Object.it (build/__tests__/messages-test.js:45:41) " -`; \ No newline at end of file +`; diff --git a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap index b4587c314bcb..de79961455f5 100644 --- a/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap +++ b/packages/jest-validate/src/__tests__/__snapshots__/validate.test.js.snap @@ -135,4 +135,4 @@ exports[`works with custom warnings 1`] = ` This is probably a typing mistake. Fixing it will remove this message. My custom comment" -`; \ No newline at end of file +`; diff --git a/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap b/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap index 178837444409..21a703ef034f 100644 --- a/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap +++ b/packages/jest-validate/src/__tests__/__snapshots__/validate_cli_options.test.js.snap @@ -19,4 +19,4 @@ exports[`fails for unknown option 1`] = ` CLI Options Documentation: https://facebook.github.io/jest/docs/en/cli.html " -`; \ No newline at end of file +`; From b5985e1d0738d05fd281b20c4cc924bd0b95c902 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Thu, 22 Feb 2018 10:21:29 -0500 Subject: [PATCH 95/97] fix: removes redundant BUILD path. updates snapshots --- .../__tests__/__snapshots__/failures.test.js.snap | 2 +- .../__tests__/__snapshots__/globals.test.js.snap | 4 ++-- packages/jest-message-util/src/index.js | 7 +------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/integration-tests/__tests__/__snapshots__/failures.test.js.snap b/integration-tests/__tests__/__snapshots__/failures.test.js.snap index 8ed114207cfb..4f9cd33c1d1b 100644 --- a/integration-tests/__tests__/__snapshots__/failures.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/failures.test.js.snap @@ -118,7 +118,7 @@ exports[`works with async failures 1`] = ` + \\"foo\\": \\"bar\\", } - at packages/expect/build/index.js:145:57 + at packages/expect/build/index.js:104:76 " `; diff --git a/integration-tests/__tests__/__snapshots__/globals.test.js.snap b/integration-tests/__tests__/__snapshots__/globals.test.js.snap index fc640eca0c36..280ee77d5556 100644 --- a/integration-tests/__tests__/__snapshots__/globals.test.js.snap +++ b/integration-tests/__tests__/__snapshots__/globals.test.js.snap @@ -32,7 +32,7 @@ exports[`cannot test with no implementation 1`] = ` 4 | test('test, no implementation'); 5 | - at packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at packages/jest-jasmine2/build/jasmine/Env.js:390:15 at __tests__/only-constructs.test.js:3:5 " @@ -59,7 +59,7 @@ exports[`cannot test with no implementation with expand arg 1`] = ` 4 | test('test, no implementation'); 5 | - at packages/jest-jasmine2/build/jasmine/Env.js:433:15 + at packages/jest-jasmine2/build/jasmine/Env.js:390:15 at __tests__/only-constructs.test.js:3:5 " diff --git a/packages/jest-message-util/src/index.js b/packages/jest-message-util/src/index.js index 504e3aee8f17..a990cde4aa65 100644 --- a/packages/jest-message-util/src/index.js +++ b/packages/jest-message-util/src/index.js @@ -45,7 +45,6 @@ type StackTraceOptions = { }; const PATH_NODE_MODULES = `${path.sep}node_modules${path.sep}`; -const PATH_EXPECT_BUILD = `${path.sep}expect${path.sep}build${path.sep}`; const PATH_JEST_PACKAGES = `${path.sep}jest${path.sep}packages${path.sep}`; // filter for noisy stack trace lines @@ -221,11 +220,7 @@ const formatPaths = ( const getTopFrame = (lines: string[]) => { for (const line of lines) { - if ( - line.includes(PATH_NODE_MODULES) || - line.includes(PATH_EXPECT_BUILD) || - line.includes(PATH_JEST_PACKAGES) - ) { + if (line.includes(PATH_NODE_MODULES) || line.includes(PATH_JEST_PACKAGES)) { continue; } From 06875a809c9913274c674b18b1322ceeefe32148 Mon Sep 17 00:00:00 2001 From: Brian Macdonald Date: Fri, 23 Feb 2018 07:10:03 -0500 Subject: [PATCH 96/97] fix: deletes empty file, updates changelog --- .circleci/rn | 0 CHANGELOG.md | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 .circleci/rn diff --git a/.circleci/rn b/.circleci/rn deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1085beded81d..341c59cbf9b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ ### Features +* `[jest-jasmine2]` Adds error throwing and descriptive errors to `it`/ `test` + for invalid arguements. `[jest-circus]` Adds error throwing and descriptive + errors to `it`/ `test` for invalid arguements. * `[jest-runtime]` Provide `require.main` property set to module with test suite ([#5618](https://github.com/facebook/jest/pull/5618)) @@ -79,9 +82,6 @@ ### Features -* `[jest-jasmine2]` Adds error throwing and descriptive errors to `it`/ `test` - for invalid arguements. `[jest-circus]` Adds error throwing and descriptive - errors to `it`/ `test` for invalid arguements. * `[jest-util]` Add the following methods to the "console" implementations: `assert`, `count`, `countReset`, `dir`, `dirxml`, `group`, `groupCollapsed`, `groupEnd`, `time`, `timeEnd` From f3f12135bc98e80f3bc4fefa2aa8b47f0f5c847e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Fri, 23 Feb 2018 16:06:54 +0100 Subject: [PATCH 97/97] fix: handle flow ignores in circus tests --- .flowconfig | 1 - .../__tests__/circus_it_test_error.test.js | 8 +++- yarn.lock | 44 ------------------- 3 files changed, 7 insertions(+), 46 deletions(-) diff --git a/.flowconfig b/.flowconfig index 8b4332fc2745..30bdfc526a60 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,7 +1,6 @@ [ignore] .*/examples/.* .*/node_modules/metro-bundler/.* -.*/circus_it_test_error.test.js*. [options] module.name_mapper='^pretty-format$' -> '/packages/pretty-format/src/index.js' diff --git a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js index 7b72fef20015..da2e8d234e00 100644 --- a/packages/jest-circus/src/__tests__/circus_it_test_error.test.js +++ b/packages/jest-circus/src/__tests__/circus_it_test_error.test.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * *@flow + * @flow */ 'use strict'; @@ -35,16 +35,19 @@ describe('test/it error throwing', () => { }); it(`it throws error with missing callback function`, () => { expect(() => { + // $FlowFixMe: Easy, we're testing runitme errors here circusIt('test2'); }).toThrowError('Missing second argument. It must be a callback function.'); }); it(`it throws an error when first argument isn't a string`, () => { expect(() => { + // $FlowFixMe: Easy, we're testing runitme errors here circusIt(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); it('it throws an error when callback function is not a function', () => { expect(() => { + // $FlowFixMe: Easy, we're testing runitme errors here circusIt('test4', 'test4b'); }).toThrowError( `Invalid second argument, test4b. It must be a callback function.`, @@ -57,16 +60,19 @@ describe('test/it error throwing', () => { }); it(`test throws error with missing callback function`, () => { expect(() => { + // $FlowFixMe: Easy, we're testing runitme errors here circusTest('test6'); }).toThrowError('Missing second argument. It must be a callback function.'); }); it(`test throws an error when first argument isn't a string`, () => { expect(() => { + // $FlowFixMe: Easy, we're testing runitme errors here circusTest(() => {}); }).toThrowError(`Invalid first argument, () => {}. It must be a string.`); }); it('test throws an error when callback function is not a function', () => { expect(() => { + // $FlowFixMe: Easy, we're testing runitme errors here circusTest('test8', 'test8b'); }).toThrowError( `Invalid second argument, test8b. It must be a callback function.`, diff --git a/yarn.lock b/yarn.lock index 1e32c1df1b78..4fb55bb21993 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4534,10 +4534,6 @@ jest-docblock@^21, jest-docblock@^21.0.0, jest-docblock@^21.2.0: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" -jest-get-type@^21.2.0: - version "21.2.0" - resolved "https://onedrive.pkgs.visualstudio.com/_packaging/odsp-npm/npm/registry/jest-get-type/-/jest-get-type-21.2.0.tgz#f6376ab9db4b60d81e39f30749c6c466f40d4a23" - jest-haste-map@^21: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-21.2.0.tgz#1363f0a8bb4338f24f001806571eff7a4b2ff3d8" @@ -4549,39 +4545,6 @@ jest-haste-map@^21: sane "^2.0.0" worker-farm "^1.3.1" -jest-message-util@^21.2.1: - version "21.2.1" - resolved "https://onedrive.pkgs.visualstudio.com/_packaging/odsp-npm/npm/registry/jest-message-util/-/jest-message-util-21.2.1.tgz#bfe5d4692c84c827d1dcf41823795558f0a1acbe" - dependencies: - chalk "^2.0.1" - micromatch "^2.3.11" - slash "^1.0.0" - -jest-mock@^21.2.0: - version "21.2.0" - resolved "https://onedrive.pkgs.visualstudio.com/_packaging/odsp-npm/npm/registry/jest-mock/-/jest-mock-21.2.0.tgz#7eb0770e7317968165f61ea2a7281131534b3c0f" - -jest-util@^21.2.1: - version "21.2.1" - resolved "https://onedrive.pkgs.visualstudio.com/_packaging/odsp-npm/npm/registry/jest-util/-/jest-util-21.2.1.tgz#a274b2f726b0897494d694a6c3d6a61ab819bb78" - dependencies: - callsites "^2.0.0" - chalk "^2.0.1" - graceful-fs "^4.1.11" - jest-message-util "^21.2.1" - jest-mock "^21.2.0" - jest-validate "^21.2.1" - mkdirp "^0.5.1" - -jest-validate@^21.2.1: - version "21.2.1" - resolved "https://onedrive.pkgs.visualstudio.com/_packaging/odsp-npm/npm/registry/jest-validate/-/jest-validate-21.2.1.tgz#cc0cbca653cd54937ba4f2a111796774530dd3c7" - dependencies: - chalk "^2.0.1" - jest-get-type "^21.2.0" - leven "^2.1.0" - pretty-format "^21.2.1" - jquery@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787" @@ -6237,13 +6200,6 @@ prettier@^1.10.1: version "1.10.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.1.tgz#01423fea6957ea23618d37d339ef0e7f7c967fc6" -pretty-format@^21.2.1: - version "21.2.1" - resolved "https://onedrive.pkgs.visualstudio.com/_packaging/odsp-npm/npm/registry/pretty-format/-/pretty-format-21.2.1.tgz#ae5407f3cf21066cd011aa1ba5fce7b6a2eddb36" - dependencies: - ansi-regex "^3.0.0" - ansi-styles "^3.2.0" - pretty-format@^4.2.1: version "4.3.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-4.3.1.tgz#530be5c42b3c05b36414a7a2a4337aa80acd0e8d"