@@ -366,7 +366,7 @@ function createSuiteCollector(
366366
367367 if ( runner . config . includeTaskLocation ) {
368368 const error = stackTraceError . stack !
369- const stack = findTestFileStackTrace ( error , task . each ?? false )
369+ const stack = findTestFileStackTrace ( error )
370370 if ( stack ) {
371371 task . location = stack
372372 }
@@ -460,7 +460,7 @@ function createSuiteCollector(
460460 Error . stackTraceLimit = 15
461461 const error = new Error ( 'stacktrace' ) . stack !
462462 Error . stackTraceLimit = limit
463- const stack = findTestFileStackTrace ( error , suite . each ?? false )
463+ const stack = findTestFileStackTrace ( error )
464464 if ( stack ) {
465465 suite . location = stack
466466 }
@@ -890,21 +890,16 @@ function formatTemplateString(cases: any[], args: any[]): any[] {
890890 return res
891891}
892892
893- function findTestFileStackTrace ( error : string , each : boolean ) {
893+ function findTestFileStackTrace ( error : string ) {
894+ const testFilePath = getTestFilepath ( )
894895 // first line is the error message
895896 const lines = error . split ( '\n' ) . slice ( 1 )
896897 for ( const line of lines ) {
897898 const stack = parseSingleStack ( line )
898- if ( stack && stack . file === getTestFilepath ( ) ) {
899+ if ( stack && stack . file === testFilePath ) {
899900 return {
900901 line : stack . line ,
901- /**
902- * test.each([1, 2])('name')
903- * ^ leads here, but should
904- * ^ lead here
905- * in source maps it's the same boundary, so it just points to the start of it
906- */
907- column : each ? stack . column + 1 : stack . column ,
902+ column : stack . column ,
908903 }
909904 }
910905 }
0 commit comments