Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jeysal committed May 6, 2019
1 parent 22b48bc commit 61dea2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ Watch Usage
`;

exports[`Watch mode flows makes watch plugin initialization errors look nice 1`] = `
[Error: Failed to initialize watch plugin "packages/jest-core/src/__tests__/__fixtures__/watch_plugin_throws":
"Error: Failed to initialize watch plugin \\"packages/jest-core/src/__tests__/__fixtures__/watch_plugin_throws\\":
● Test suite failed to run
initialization error
at Object.<anonymous> (__fixtures__/watch_plugin_throws.js:3:7)
]
"
`;
exports[`Watch mode flows shows prompts for WatchPlugins in alphabetical order 1`] = `
Expand Down
11 changes: 7 additions & 4 deletions packages/jest-core/src/__tests__/watch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,9 @@ describe('Watch mode flows', () => {
it('makes watch plugin initialization errors look nice', async () => {
const pluginPath = `${__dirname}/__fixtures__/watch_plugin_throws`;

await expect(
watch(
expect.assertions(1);
try {
await watch(
{
...globalConfig,
rootDir: __dirname,
Expand All @@ -590,8 +591,10 @@ describe('Watch mode flows', () => {
pipe,
hasteMapInstances,
stdin,
),
).rejects.toMatchSnapshot();
);
} catch (error) {
expect(error.toString().replace(/\\/, '/')).toMatchSnapshot();
}
});

it.each`
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-core/src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default function watch(
} catch (error) {
const errorWithContext = new Error(
`Failed to initialize watch plugin "${chalk.bold(
path.posix.relative(process.cwd(), pluginWithConfig.path),
path.relative(process.cwd(), pluginWithConfig.path),
)}":\n\n${formatExecError(error, contexts[0].config, {
noStackTrace: false,
})}`,
Expand Down

0 comments on commit 61dea2c

Please sign in to comment.