Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Nov 9, 2019
1 parent 5410640 commit f889eaa
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 80 deletions.
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Upgrade help logs a warning when \`scriptPreprocessor\` and/or \`preprocessorIgnorePatterns\` are used 1`] = `
"<yellow><bold><bold>●<bold> Deprecation Warning</>:</>
"<yellow><bold><bold>●</><bold> Deprecation Warning</>:</>
<yellow></>
<yellow> Option <bold>\\"preprocessorIgnorePatterns\\"</> was replaced by <bold>\\"transformIgnorePatterns\\"</>, which support multiple preprocessors.</>
<yellow></>
Expand All @@ -28,7 +28,7 @@ exports[`displayName generates a default color for the runner jest-runner-tslint
exports[`displayName generates a default color for the runner undefined 1`] = `"white"`;
exports[`displayName should throw an error when displayName is is an empty object 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Option \\"<bold>displayName</>\\" must be of type:</>
<red></>
Expand All @@ -44,7 +44,7 @@ exports[`displayName should throw an error when displayName is is an empty objec
`;
exports[`displayName should throw an error when displayName is missing color 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Option \\"<bold>displayName</>\\" must be of type:</>
<red></>
Expand All @@ -60,7 +60,7 @@ exports[`displayName should throw an error when displayName is missing color 1`]
`;
exports[`displayName should throw an error when displayName is missing name 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Option \\"<bold>displayName</>\\" must be of type:</>
<red></>
Expand All @@ -76,7 +76,7 @@ exports[`displayName should throw an error when displayName is missing name 1`]
`;
exports[`displayName should throw an error when displayName is using invalid values 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Option \\"<bold>displayName</>\\" must be of type:</>
<red></>
Expand All @@ -92,7 +92,7 @@ exports[`displayName should throw an error when displayName is using invalid val
`;
exports[`preset throws when module was found but no "jest-preset.js" or "jest-preset.json" files 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Module <bold>exist-but-no-jest-preset</> should have \\"jest-preset.js\\" or \\"jest-preset.json\\" file at the root.</>
<red></>
Expand All @@ -102,7 +102,7 @@ exports[`preset throws when module was found but no "jest-preset.js" or "jest-pr
`;
exports[`preset throws when preset not found 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Preset <bold>doesnt-exist</> not found.</>
<red></>
Expand All @@ -112,7 +112,7 @@ exports[`preset throws when preset not found 1`] = `
`;
exports[`rootDir throws if the options is missing a rootDir property 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Configuration option <bold>rootDir</> must be specified.</>
<red></>
Expand All @@ -122,7 +122,7 @@ exports[`rootDir throws if the options is missing a rootDir property 1`] = `
`;
exports[`runner throw error when a runner is not found 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Jest Runner <bold>missing-runner</> cannot be found. Make sure the <bold>runner</> configuration option points to an existing node module.</>
<red></>
Expand All @@ -132,7 +132,7 @@ exports[`runner throw error when a runner is not found 1`] = `
`;
exports[`setupTestFrameworkScriptFile logs a deprecation warning when \`setupTestFrameworkScriptFile\` is used 1`] = `
"<yellow><bold><bold>●<bold> Deprecation Warning</>:</>
"<yellow><bold><bold>●</><bold> Deprecation Warning</>:</>
<yellow></>
<yellow> Option <bold>\\"setupTestFrameworkScriptFile\\"</> was replaced by configuration <bold>\\"setupFilesAfterEnv\\"</>, which supports multiple paths.</>
<yellow></>
Expand All @@ -144,7 +144,7 @@ exports[`setupTestFrameworkScriptFile logs a deprecation warning when \`setupTes
`;
exports[`setupTestFrameworkScriptFile logs an error when \`setupTestFrameworkScriptFile\` and \`setupFilesAfterEnv\` are used 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Options: <bold>setupTestFrameworkScriptFile</> and <bold>setupFilesAfterEnv</> cannot be used together.</>
<red> Please change your configuration to only use <bold>setupFilesAfterEnv</>.</>
Expand All @@ -155,7 +155,7 @@ exports[`setupTestFrameworkScriptFile logs an error when \`setupTestFrameworkScr
`;
exports[`testEnvironment throws on invalid environment names 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Test environment <bold>phantom</> cannot be found. Make sure the <bold>testEnvironment</> configuration option points to an existing node module.</>
<red></>
Expand All @@ -165,7 +165,7 @@ exports[`testEnvironment throws on invalid environment names 1`] = `
`;
exports[`testMatch throws if testRegex and testMatch are both specified 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Configuration options <bold>testMatch</> and <bold>testRegex</> cannot be used together.</>
<red></>
Expand All @@ -179,7 +179,7 @@ exports[`testPathPattern <regexForTestFiles> ignores invalid regular expressions
exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `"<red> Invalid testPattern a( supplied. Running all tests instead.</>"`;
exports[`testTimeout should throw an error if timeout is a negative number 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Option \\"<bold>testTimeout</>\\" must be a natural number.</>
<red></>
Expand All @@ -189,7 +189,7 @@ exports[`testTimeout should throw an error if timeout is a negative number 1`] =
`;
exports[`watchPlugins throw error when a watch plugin is not found 1`] = `
"<red><bold><bold>● <bold>Validation Error</>:</>
"<red><bold><bold>● </><bold>Validation Error</>:</>
<red></>
<red> Watch plugin <bold>missing-plugin</> cannot be found. Make sure the <bold>watchPlugins</> configuration option points to an existing node module.</>
<red></>
Expand Down
Expand Up @@ -27,7 +27,7 @@ jest
});

jest.doMock('chalk', () =>
Object.assign(new chalk.constructor({enabled: false}), {
Object.assign(new chalk.Instance({level: 0}), {
stripColor: str => str,
}),
);
Expand Down
Expand Up @@ -5,7 +5,7 @@ exports[`SnapshotInteractiveMode skip 1 test, then quit 1`] = `
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>1 snapshot remaining<bold></>
› <bold><dim>1 snapshot remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -19,7 +19,7 @@ exports[`SnapshotInteractiveMode skip 1 test, then quit 2`] = `
"[MOCK - clear]

<bold>Interactive Snapshot Result</>
› <bold><dim>1 snapshot reviewed<bold></>, <bold><yellow>1 snapshot skipped</></>
› <bold><dim>1 snapshot reviewed</></>, <bold><yellow>1 snapshot skipped</></>

<bold>Watch Usage</>
<dim> › Press </>r<dim> to restart Interactive Snapshot Mode.</>
Expand All @@ -32,7 +32,7 @@ exports[`SnapshotInteractiveMode skip 1 test, then restart 1`] = `
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>1 snapshot remaining<bold></>
› <bold><dim>1 snapshot remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -46,7 +46,7 @@ exports[`SnapshotInteractiveMode skip 1 test, then restart 2`] = `
"[MOCK - clear]

<bold>Interactive Snapshot Result</>
› <bold><dim>1 snapshot reviewed<bold></>, <bold><yellow>1 snapshot skipped</></>
› <bold><dim>1 snapshot reviewed</></>, <bold><yellow>1 snapshot skipped</></>

<bold>Watch Usage</>
<dim> › Press </>r<dim> to restart Interactive Snapshot Mode.</>
Expand All @@ -59,7 +59,7 @@ exports[`SnapshotInteractiveMode skip 1 test, then restart 3`] = `
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>1 snapshot remaining<bold></>
› <bold><dim>1 snapshot remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -74,7 +74,7 @@ exports[`SnapshotInteractiveMode skip 1 test, update 1 test, then finish and res
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>2 snapshots remaining<bold></>
› <bold><dim>2 snapshots remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -89,7 +89,7 @@ exports[`SnapshotInteractiveMode skip 1 test, update 1 test, then finish and res
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>1 snapshot remaining<bold></>, <bold><yellow>1 snapshot skipped</></>
› <bold><dim>1 snapshot remaining</></>, <bold><yellow>1 snapshot skipped</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -103,7 +103,7 @@ exports[`SnapshotInteractiveMode skip 1 test, update 1 test, then finish and res
"[MOCK - clear]

<bold>Interactive Snapshot Result</>
› <bold><dim>2 snapshots reviewed<bold></>, <bold><green>1 snapshot updated</></>, <bold><yellow>1 snapshot skipped</></>
› <bold><dim>2 snapshots reviewed</></>, <bold><green>1 snapshot updated</></>, <bold><yellow>1 snapshot skipped</></>

<bold>Watch Usage</>
<dim> › Press </>r<dim> to restart Interactive Snapshot Mode.</>
Expand All @@ -116,7 +116,7 @@ exports[`SnapshotInteractiveMode skip 1 test, update 1 test, then finish and res
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>1 snapshot remaining<bold></>
› <bold><dim>1 snapshot remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -131,7 +131,7 @@ exports[`SnapshotInteractiveMode skip 2 tests, then finish and restart 1`] = `
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>2 snapshots remaining<bold></>
› <bold><dim>2 snapshots remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -146,7 +146,7 @@ exports[`SnapshotInteractiveMode skip 2 tests, then finish and restart 2`] = `
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>1 snapshot remaining<bold></>, <bold><yellow>1 snapshot skipped</></>
› <bold><dim>1 snapshot remaining</></>, <bold><yellow>1 snapshot skipped</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -160,7 +160,7 @@ exports[`SnapshotInteractiveMode skip 2 tests, then finish and restart 3`] = `
"[MOCK - clear]

<bold>Interactive Snapshot Result</>
› <bold><dim>2 snapshots reviewed<bold></>, <bold><yellow>2 snapshots skipped</></>
› <bold><dim>2 snapshots reviewed</></>, <bold><yellow>2 snapshots skipped</></>

<bold>Watch Usage</>
<dim> › Press </>r<dim> to restart Interactive Snapshot Mode.</>
Expand All @@ -173,7 +173,7 @@ exports[`SnapshotInteractiveMode skip 2 tests, then finish and restart 4`] = `
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>2 snapshots remaining<bold></>
› <bold><dim>2 snapshots remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -188,7 +188,7 @@ exports[`SnapshotInteractiveMode update 1 test, skip 1 test, then finish and res
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>2 snapshots remaining<bold></>
› <bold><dim>2 snapshots remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -203,7 +203,7 @@ exports[`SnapshotInteractiveMode update 1 test, skip 1 test, then finish and res
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>1 snapshot remaining<bold></>, <bold><green>1 snapshot updated</></>
› <bold><dim>1 snapshot remaining</></>, <bold><green>1 snapshot updated</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -217,7 +217,7 @@ exports[`SnapshotInteractiveMode update 1 test, skip 1 test, then finish and res
"[MOCK - clear]

<bold>Interactive Snapshot Result</>
› <bold><dim>2 snapshots reviewed<bold></>, <bold><green>1 snapshot updated</></>, <bold><yellow>1 snapshot skipped</></>
› <bold><dim>2 snapshots reviewed</></>, <bold><green>1 snapshot updated</></>, <bold><yellow>1 snapshot skipped</></>

<bold>Watch Usage</>
<dim> › Press </>r<dim> to restart Interactive Snapshot Mode.</>
Expand All @@ -230,7 +230,7 @@ exports[`SnapshotInteractiveMode update 1 test, skip 1 test, then finish and res
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>1 snapshot remaining<bold></>
› <bold><dim>1 snapshot remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -245,7 +245,7 @@ exports[`SnapshotInteractiveMode update 1 test, then finish and return 1`] = `
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>1 snapshot remaining<bold></>
› <bold><dim>1 snapshot remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -259,7 +259,7 @@ exports[`SnapshotInteractiveMode update 1 test, then finish and return 2`] = `
"[MOCK - clear]

<bold>Interactive Snapshot Result</>
› <bold><dim>1 snapshot reviewed<bold></>, <bold><green>1 snapshot updated</></>
› <bold><dim>1 snapshot reviewed</></>, <bold><green>1 snapshot updated</></>

<bold>Watch Usage</>
<dim> › Press </>Enter<dim> to return to watch mode.</>
Expand All @@ -271,7 +271,7 @@ exports[`SnapshotInteractiveMode update 2 tests, then finish and return 1`] = `
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>2 snapshots remaining<bold></>
› <bold><dim>2 snapshots remaining</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -286,7 +286,7 @@ exports[`SnapshotInteractiveMode update 2 tests, then finish and return 2`] = `
[MOCK - eraseDown]

<bold>Interactive Snapshot Progress</>
› <bold><dim>1 snapshot remaining<bold></>, <bold><green>1 snapshot updated</></>
› <bold><dim>1 snapshot remaining</></>, <bold><green>1 snapshot updated</></>

<bold>Watch Usage</>
<dim> › Press </>u<dim> to update failing snapshots for this test.</>
Expand All @@ -300,7 +300,7 @@ exports[`SnapshotInteractiveMode update 2 tests, then finish and return 3`] = `
"[MOCK - clear]

<bold>Interactive Snapshot Result</>
› <bold><dim>2 snapshots reviewed<bold></>, <bold><green>2 snapshots updated</></>
› <bold><dim>2 snapshots reviewed</></>, <bold><green>2 snapshots updated</></>

<bold>Watch Usage</>
<dim> › Press </>Enter<dim> to return to watch mode.</>
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-core/src/__tests__/watch.test.js
Expand Up @@ -42,7 +42,7 @@ jest.mock(
},
);

jest.doMock('chalk', () => new chalk.constructor({enabled: false}));
jest.doMock('chalk', () => new chalk.Instance({level: 0}));
jest.doMock(
'../runJest',
() =>
Expand Down
Expand Up @@ -64,7 +64,7 @@ jest.mock(
},
);

jest.doMock('chalk', () => new chalk.constructor({enabled: false}));
jest.doMock('chalk', () => new chalk.Instance({level: 0}));

jest.doMock('strip-ansi');
require('strip-ansi').mockImplementation(str => str);
Expand Down
Expand Up @@ -40,7 +40,7 @@ jest.mock(
},
);

jest.doMock('chalk', () => new chalk.constructor({enabled: false}));
jest.doMock('chalk', () => new chalk.Instance({level: 0}));

jest.doMock('strip-ansi');
require('strip-ansi').mockImplementation(str => str);
Expand Down

0 comments on commit f889eaa

Please sign in to comment.