@@ -366,7 +366,7 @@ function createSuiteCollector(
366
366
367
367
if ( runner . config . includeTaskLocation ) {
368
368
const error = stackTraceError . stack !
369
- const stack = findTestFileStackTrace ( error , task . each ?? false )
369
+ const stack = findTestFileStackTrace ( error )
370
370
if ( stack ) {
371
371
task . location = stack
372
372
}
@@ -460,7 +460,7 @@ function createSuiteCollector(
460
460
Error . stackTraceLimit = 15
461
461
const error = new Error ( 'stacktrace' ) . stack !
462
462
Error . stackTraceLimit = limit
463
- const stack = findTestFileStackTrace ( error , suite . each ?? false )
463
+ const stack = findTestFileStackTrace ( error )
464
464
if ( stack ) {
465
465
suite . location = stack
466
466
}
@@ -890,21 +890,16 @@ function formatTemplateString(cases: any[], args: any[]): any[] {
890
890
return res
891
891
}
892
892
893
- function findTestFileStackTrace ( error : string , each : boolean ) {
893
+ function findTestFileStackTrace ( error : string ) {
894
+ const testFilePath = getTestFilepath ( )
894
895
// first line is the error message
895
896
const lines = error . split ( '\n' ) . slice ( 1 )
896
897
for ( const line of lines ) {
897
898
const stack = parseSingleStack ( line )
898
- if ( stack && stack . file === getTestFilepath ( ) ) {
899
+ if ( stack && stack . file === testFilePath ) {
899
900
return {
900
901
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 ,
908
903
}
909
904
}
910
905
}
0 commit comments