Skip to content

Commit f889eaa

Browse files
committed
update tests
1 parent 5410640 commit f889eaa

File tree

9 files changed

+80
-80
lines changed

9 files changed

+80
-80
lines changed

packages/jest-config/src/__tests__/__snapshots__/normalize.test.js.snap

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Upgrade help logs a warning when \`scriptPreprocessor\` and/or \`preprocessorIgnorePatterns\` are used 1`] = `
4-
"<yellow><bold><bold>●<bold> Deprecation Warning</>:</>
4+
"<yellow><bold><bold>●</><bold> Deprecation Warning</>:</>
55
<yellow></>
66
<yellow> Option <bold>\\"preprocessorIgnorePatterns\\"</> was replaced by <bold>\\"transformIgnorePatterns\\"</>, which support multiple preprocessors.</>
77
<yellow></>
@@ -28,7 +28,7 @@ exports[`displayName generates a default color for the runner jest-runner-tslint
2828
exports[`displayName generates a default color for the runner undefined 1`] = `"white"`;
2929
3030
exports[`displayName should throw an error when displayName is is an empty object 1`] = `
31-
"<red><bold><bold>● <bold>Validation Error</>:</>
31+
"<red><bold><bold>● </><bold>Validation Error</>:</>
3232
<red></>
3333
<red> Option \\"<bold>displayName</>\\" must be of type:</>
3434
<red></>
@@ -44,7 +44,7 @@ exports[`displayName should throw an error when displayName is is an empty objec
4444
`;
4545
4646
exports[`displayName should throw an error when displayName is missing color 1`] = `
47-
"<red><bold><bold>● <bold>Validation Error</>:</>
47+
"<red><bold><bold>● </><bold>Validation Error</>:</>
4848
<red></>
4949
<red> Option \\"<bold>displayName</>\\" must be of type:</>
5050
<red></>
@@ -60,7 +60,7 @@ exports[`displayName should throw an error when displayName is missing color 1`]
6060
`;
6161
6262
exports[`displayName should throw an error when displayName is missing name 1`] = `
63-
"<red><bold><bold>● <bold>Validation Error</>:</>
63+
"<red><bold><bold>● </><bold>Validation Error</>:</>
6464
<red></>
6565
<red> Option \\"<bold>displayName</>\\" must be of type:</>
6666
<red></>
@@ -76,7 +76,7 @@ exports[`displayName should throw an error when displayName is missing name 1`]
7676
`;
7777
7878
exports[`displayName should throw an error when displayName is using invalid values 1`] = `
79-
"<red><bold><bold>● <bold>Validation Error</>:</>
79+
"<red><bold><bold>● </><bold>Validation Error</>:</>
8080
<red></>
8181
<red> Option \\"<bold>displayName</>\\" must be of type:</>
8282
<red></>
@@ -92,7 +92,7 @@ exports[`displayName should throw an error when displayName is using invalid val
9292
`;
9393
9494
exports[`preset throws when module was found but no "jest-preset.js" or "jest-preset.json" files 1`] = `
95-
"<red><bold><bold>● <bold>Validation Error</>:</>
95+
"<red><bold><bold>● </><bold>Validation Error</>:</>
9696
<red></>
9797
<red> Module <bold>exist-but-no-jest-preset</> should have \\"jest-preset.js\\" or \\"jest-preset.json\\" file at the root.</>
9898
<red></>
@@ -102,7 +102,7 @@ exports[`preset throws when module was found but no "jest-preset.js" or "jest-pr
102102
`;
103103
104104
exports[`preset throws when preset not found 1`] = `
105-
"<red><bold><bold>● <bold>Validation Error</>:</>
105+
"<red><bold><bold>● </><bold>Validation Error</>:</>
106106
<red></>
107107
<red> Preset <bold>doesnt-exist</> not found.</>
108108
<red></>
@@ -112,7 +112,7 @@ exports[`preset throws when preset not found 1`] = `
112112
`;
113113
114114
exports[`rootDir throws if the options is missing a rootDir property 1`] = `
115-
"<red><bold><bold>● <bold>Validation Error</>:</>
115+
"<red><bold><bold>● </><bold>Validation Error</>:</>
116116
<red></>
117117
<red> Configuration option <bold>rootDir</> must be specified.</>
118118
<red></>
@@ -122,7 +122,7 @@ exports[`rootDir throws if the options is missing a rootDir property 1`] = `
122122
`;
123123
124124
exports[`runner throw error when a runner is not found 1`] = `
125-
"<red><bold><bold>● <bold>Validation Error</>:</>
125+
"<red><bold><bold>● </><bold>Validation Error</>:</>
126126
<red></>
127127
<red> Jest Runner <bold>missing-runner</> cannot be found. Make sure the <bold>runner</> configuration option points to an existing node module.</>
128128
<red></>
@@ -132,7 +132,7 @@ exports[`runner throw error when a runner is not found 1`] = `
132132
`;
133133
134134
exports[`setupTestFrameworkScriptFile logs a deprecation warning when \`setupTestFrameworkScriptFile\` is used 1`] = `
135-
"<yellow><bold><bold>●<bold> Deprecation Warning</>:</>
135+
"<yellow><bold><bold>●</><bold> Deprecation Warning</>:</>
136136
<yellow></>
137137
<yellow> Option <bold>\\"setupTestFrameworkScriptFile\\"</> was replaced by configuration <bold>\\"setupFilesAfterEnv\\"</>, which supports multiple paths.</>
138138
<yellow></>
@@ -144,7 +144,7 @@ exports[`setupTestFrameworkScriptFile logs a deprecation warning when \`setupTes
144144
`;
145145
146146
exports[`setupTestFrameworkScriptFile logs an error when \`setupTestFrameworkScriptFile\` and \`setupFilesAfterEnv\` are used 1`] = `
147-
"<red><bold><bold>● <bold>Validation Error</>:</>
147+
"<red><bold><bold>● </><bold>Validation Error</>:</>
148148
<red></>
149149
<red> Options: <bold>setupTestFrameworkScriptFile</> and <bold>setupFilesAfterEnv</> cannot be used together.</>
150150
<red> Please change your configuration to only use <bold>setupFilesAfterEnv</>.</>
@@ -155,7 +155,7 @@ exports[`setupTestFrameworkScriptFile logs an error when \`setupTestFrameworkScr
155155
`;
156156
157157
exports[`testEnvironment throws on invalid environment names 1`] = `
158-
"<red><bold><bold>● <bold>Validation Error</>:</>
158+
"<red><bold><bold>● </><bold>Validation Error</>:</>
159159
<red></>
160160
<red> Test environment <bold>phantom</> cannot be found. Make sure the <bold>testEnvironment</> configuration option points to an existing node module.</>
161161
<red></>
@@ -165,7 +165,7 @@ exports[`testEnvironment throws on invalid environment names 1`] = `
165165
`;
166166
167167
exports[`testMatch throws if testRegex and testMatch are both specified 1`] = `
168-
"<red><bold><bold>● <bold>Validation Error</>:</>
168+
"<red><bold><bold>● </><bold>Validation Error</>:</>
169169
<red></>
170170
<red> Configuration options <bold>testMatch</> and <bold>testRegex</> cannot be used together.</>
171171
<red></>
@@ -179,7 +179,7 @@ exports[`testPathPattern <regexForTestFiles> ignores invalid regular expressions
179179
exports[`testPathPattern --testPathPattern ignores invalid regular expressions and logs a warning 1`] = `"<red> Invalid testPattern a( supplied. Running all tests instead.</>"`;
180180
181181
exports[`testTimeout should throw an error if timeout is a negative number 1`] = `
182-
"<red><bold><bold>● <bold>Validation Error</>:</>
182+
"<red><bold><bold>● </><bold>Validation Error</>:</>
183183
<red></>
184184
<red> Option \\"<bold>testTimeout</>\\" must be a natural number.</>
185185
<red></>
@@ -189,7 +189,7 @@ exports[`testTimeout should throw an error if timeout is a negative number 1`] =
189189
`;
190190
191191
exports[`watchPlugins throw error when a watch plugin is not found 1`] = `
192-
"<red><bold><bold>● <bold>Validation Error</>:</>
192+
"<red><bold><bold>● </><bold>Validation Error</>:</>
193193
<red></>
194194
<red> Watch plugin <bold>missing-plugin</> cannot be found. Make sure the <bold>watchPlugins</> configuration option points to an existing node module.</>
195195
<red></>

packages/jest-core/src/__tests__/SnapshotInteractiveMode.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jest
2727
});
2828

2929
jest.doMock('chalk', () =>
30-
Object.assign(new chalk.constructor({enabled: false}), {
30+
Object.assign(new chalk.Instance({level: 0}), {
3131
stripColor: str => str,
3232
}),
3333
);

packages/jest-core/src/__tests__/__snapshots__/SnapshotInteractiveMode.test.js.snap

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`SnapshotInteractiveMode skip 1 test, then quit 1`] = `
55
[MOCK - eraseDown]
66

77
<bold>Interactive Snapshot Progress</>
8-
› <bold><dim>1 snapshot remaining<bold></>
8+
› <bold><dim>1 snapshot remaining</></>
99

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

2121
<bold>Interactive Snapshot Result</>
22-
› <bold><dim>1 snapshot reviewed<bold></>, <bold><yellow>1 snapshot skipped</></>
22+
› <bold><dim>1 snapshot reviewed</></>, <bold><yellow>1 snapshot skipped</></>
2323

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

3434
<bold>Interactive Snapshot Progress</>
35-
› <bold><dim>1 snapshot remaining<bold></>
35+
› <bold><dim>1 snapshot remaining</></>
3636

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

4848
<bold>Interactive Snapshot Result</>
49-
› <bold><dim>1 snapshot reviewed<bold></>, <bold><yellow>1 snapshot skipped</></>
49+
› <bold><dim>1 snapshot reviewed</></>, <bold><yellow>1 snapshot skipped</></>
5050

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

6161
<bold>Interactive Snapshot Progress</>
62-
› <bold><dim>1 snapshot remaining<bold></>
62+
› <bold><dim>1 snapshot remaining</></>
6363

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

7676
<bold>Interactive Snapshot Progress</>
77-
› <bold><dim>2 snapshots remaining<bold></>
77+
› <bold><dim>2 snapshots remaining</></>
7878

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

9191
<bold>Interactive Snapshot Progress</>
92-
› <bold><dim>1 snapshot remaining<bold></>, <bold><yellow>1 snapshot skipped</></>
92+
› <bold><dim>1 snapshot remaining</></>, <bold><yellow>1 snapshot skipped</></>
9393

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

105105
<bold>Interactive Snapshot Result</>
106-
› <bold><dim>2 snapshots reviewed<bold></>, <bold><green>1 snapshot updated</></>, <bold><yellow>1 snapshot skipped</></>
106+
› <bold><dim>2 snapshots reviewed</></>, <bold><green>1 snapshot updated</></>, <bold><yellow>1 snapshot skipped</></>
107107

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

118118
<bold>Interactive Snapshot Progress</>
119-
› <bold><dim>1 snapshot remaining<bold></>
119+
› <bold><dim>1 snapshot remaining</></>
120120

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

133133
<bold>Interactive Snapshot Progress</>
134-
› <bold><dim>2 snapshots remaining<bold></>
134+
› <bold><dim>2 snapshots remaining</></>
135135

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

148148
<bold>Interactive Snapshot Progress</>
149-
› <bold><dim>1 snapshot remaining<bold></>, <bold><yellow>1 snapshot skipped</></>
149+
› <bold><dim>1 snapshot remaining</></>, <bold><yellow>1 snapshot skipped</></>
150150

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

162162
<bold>Interactive Snapshot Result</>
163-
› <bold><dim>2 snapshots reviewed<bold></>, <bold><yellow>2 snapshots skipped</></>
163+
› <bold><dim>2 snapshots reviewed</></>, <bold><yellow>2 snapshots skipped</></>
164164

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

175175
<bold>Interactive Snapshot Progress</>
176-
› <bold><dim>2 snapshots remaining<bold></>
176+
› <bold><dim>2 snapshots remaining</></>
177177

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

190190
<bold>Interactive Snapshot Progress</>
191-
› <bold><dim>2 snapshots remaining<bold></>
191+
› <bold><dim>2 snapshots remaining</></>
192192

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

205205
<bold>Interactive Snapshot Progress</>
206-
› <bold><dim>1 snapshot remaining<bold></>, <bold><green>1 snapshot updated</></>
206+
› <bold><dim>1 snapshot remaining</></>, <bold><green>1 snapshot updated</></>
207207

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

219219
<bold>Interactive Snapshot Result</>
220-
› <bold><dim>2 snapshots reviewed<bold></>, <bold><green>1 snapshot updated</></>, <bold><yellow>1 snapshot skipped</></>
220+
› <bold><dim>2 snapshots reviewed</></>, <bold><green>1 snapshot updated</></>, <bold><yellow>1 snapshot skipped</></>
221221

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

232232
<bold>Interactive Snapshot Progress</>
233-
› <bold><dim>1 snapshot remaining<bold></>
233+
› <bold><dim>1 snapshot remaining</></>
234234

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

247247
<bold>Interactive Snapshot Progress</>
248-
› <bold><dim>1 snapshot remaining<bold></>
248+
› <bold><dim>1 snapshot remaining</></>
249249

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

261261
<bold>Interactive Snapshot Result</>
262-
› <bold><dim>1 snapshot reviewed<bold></>, <bold><green>1 snapshot updated</></>
262+
› <bold><dim>1 snapshot reviewed</></>, <bold><green>1 snapshot updated</></>
263263

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

273273
<bold>Interactive Snapshot Progress</>
274-
› <bold><dim>2 snapshots remaining<bold></>
274+
› <bold><dim>2 snapshots remaining</></>
275275

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

288288
<bold>Interactive Snapshot Progress</>
289-
› <bold><dim>1 snapshot remaining<bold></>, <bold><green>1 snapshot updated</></>
289+
› <bold><dim>1 snapshot remaining</></>, <bold><green>1 snapshot updated</></>
290290

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

302302
<bold>Interactive Snapshot Result</>
303-
› <bold><dim>2 snapshots reviewed<bold></>, <bold><green>2 snapshots updated</></>
303+
› <bold><dim>2 snapshots reviewed</></>, <bold><green>2 snapshots updated</></>
304304

305305
<bold>Watch Usage</>
306306
<dim> › Press </>Enter<dim> to return to watch mode.</>

packages/jest-core/src/__tests__/watch.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jest.mock(
4242
},
4343
);
4444

45-
jest.doMock('chalk', () => new chalk.constructor({enabled: false}));
45+
jest.doMock('chalk', () => new chalk.Instance({level: 0}));
4646
jest.doMock(
4747
'../runJest',
4848
() =>

packages/jest-core/src/__tests__/watch_filename_pattern_mode.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jest.mock(
6464
},
6565
);
6666

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

6969
jest.doMock('strip-ansi');
7070
require('strip-ansi').mockImplementation(str => str);

packages/jest-core/src/__tests__/watch_test_name_pattern_mode.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jest.mock(
4040
},
4141
);
4242

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

4545
jest.doMock('strip-ansi');
4646
require('strip-ansi').mockImplementation(str => str);

0 commit comments

Comments
 (0)