File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -51,14 +51,14 @@ Watch Usage
5151` ;
5252
5353exports [` 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
6464exports[`Watch mode flows shows prompts for WatchPlugins in alphabetical order 1`] = `
Original file line number Diff line number Diff 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 `
Original file line number Diff line number Diff 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 } ) } `,
You can’t perform that action at this time.
0 commit comments