Skip to content

Commit 450eb11

Browse files
committed
CI
1 parent 0c169ab commit 450eb11

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ Watch Usage
5151
`;
5252

5353
exports[`Watch mode flows makes watch plugin initialization errors look nice 1`] = `
54-
[Error: Failed to initialize watch plugin "packages/jest-core/src/__tests__/__fixtures__/watch_plugin_throws":
54+
"Error: Failed to initialize watch plugin \\"packages/jest-core/src/__tests__/__fixtures__/watch_plugin_throws\\":
5555
5656
● Test suite failed to run
5757
5858
initialization error
5959
6060
at Object.<anonymous> (__fixtures__/watch_plugin_throws.js:3:7)
61-
]
61+
"
6262
`;
6363
6464
exports[`Watch mode flows shows prompts for WatchPlugins in alphabetical order 1`] = `

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,9 @@ describe('Watch mode flows', () => {
579579
it('makes watch plugin initialization errors look nice', async () => {
580580
const pluginPath = `${__dirname}/__fixtures__/watch_plugin_throws`;
581581

582-
await expect(
583-
watch(
582+
expect.assertions(1);
583+
try {
584+
await watch(
584585
{
585586
...globalConfig,
586587
rootDir: __dirname,
@@ -590,8 +591,10 @@ describe('Watch mode flows', () => {
590591
pipe,
591592
hasteMapInstances,
592593
stdin,
593-
),
594-
).rejects.toMatchSnapshot();
594+
);
595+
} catch (error) {
596+
expect(error.toString().replace(/\\/, '/')).toMatchSnapshot();
597+
}
595598
});
596599

597600
it.each`

packages/jest-core/src/watch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export default function watch(
183183
} catch (error) {
184184
const errorWithContext = new Error(
185185
`Failed to initialize watch plugin "${chalk.bold(
186-
path.posix.relative(process.cwd(), pluginWithConfig.path),
186+
path.relative(process.cwd(), pluginWithConfig.path),
187187
)}":\n\n${formatExecError(error, contexts[0].config, {
188188
noStackTrace: false,
189189
})}`,

0 commit comments

Comments
 (0)