@@ -90,7 +90,7 @@ function createTestTree(rootTestOptions, globalOptions) {
9090 return globalRoot ;
9191}
9292
93- function createProcessEventHandler ( eventName , rootTest , cwd ) {
93+ function createProcessEventHandler ( eventName , rootTest ) {
9494 return ( err ) => {
9595 if ( rootTest . harness . bootstrapPromise ) {
9696 // Something went wrong during the asynchronous portion of bootstrapping
@@ -116,7 +116,7 @@ function createProcessEventHandler(eventName, rootTest, cwd) {
116116 const name = test . hookType ? `Test hook "${ test . hookType } "` : `Test "${ test . name } "` ;
117117 let locInfo = '' ;
118118 if ( test . loc ) {
119- const relPath = relative ( cwd , test . loc . file ) ;
119+ const relPath = relative ( rootTest . config . cwd , test . loc . file ) ;
120120 locInfo = ` at ${ relPath } :${ test . loc . line } :${ test . loc . column } ` ;
121121 }
122122
@@ -208,9 +208,9 @@ function setupProcessState(root, globalOptions) {
208208 hook . enable ( ) ;
209209
210210 const exceptionHandler =
211- createProcessEventHandler ( 'uncaughtException' , root , globalOptions . cwd ) ;
211+ createProcessEventHandler ( 'uncaughtException' , root ) ;
212212 const rejectionHandler =
213- createProcessEventHandler ( 'unhandledRejection' , root , globalOptions . cwd ) ;
213+ createProcessEventHandler ( 'unhandledRejection' , root ) ;
214214 const coverage = configureCoverage ( root , globalOptions ) ;
215215 const exitHandler = async ( ) => {
216216 if ( root . subtests . length === 0 && ( root . hooks . before . length > 0 || root . hooks . after . length > 0 ) ) {
0 commit comments