File tree 1 file changed +9
-11
lines changed
1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -26,17 +26,15 @@ function extractSource(stack, testFile) {
26
26
const relFile = path . relative ( process . cwd ( ) , testFile ) ;
27
27
const normalizedFile = process . platform === 'win32' ? slash ( relFile ) : relFile ;
28
28
for ( const line of stack . split ( '\n' ) ) {
29
- try {
30
- const callSite = stackUtils . parseLine ( line ) ;
31
- if ( callSite . file === normalizedFile ) {
32
- return {
33
- isDependency : false ,
34
- isWithinProject : true ,
35
- file : path . resolve ( process . cwd ( ) , callSite . file ) ,
36
- line : callSite . line
37
- } ;
38
- }
39
- } catch { }
29
+ const callSite = stackUtils . parseLine ( line ) ;
30
+ if ( callSite && callSite . file === normalizedFile ) {
31
+ return {
32
+ isDependency : false ,
33
+ isWithinProject : true ,
34
+ file : path . resolve ( process . cwd ( ) , callSite . file ) ,
35
+ line : callSite . line
36
+ } ;
37
+ }
40
38
}
41
39
42
40
return null ;
You can’t perform that action at this time.
0 commit comments