File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 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) {
2626 const relFile = path . relative ( process . cwd ( ) , testFile ) ;
2727 const normalizedFile = process . platform === 'win32' ? slash ( relFile ) : relFile ;
2828 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+ }
4038 }
4139
4240 return null ;
You can’t perform that action at this time.
0 commit comments