File tree 3 files changed +16
-11
lines changed 3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,6 @@ MiniReporter.prototype.finish = function (runStatus) {
180
180
}
181
181
182
182
var title = test . error ? test . title : 'Unhandled Error' ;
183
- var description = extractStack ( test . error . stack ) ;
184
183
var beforeSpacing = index === 0 ? '\n\n' : '\n\n\n\n' ;
185
184
186
185
status += beforeSpacing + ' ' + colors . title ( title ) + '\n' ;
@@ -195,7 +194,10 @@ MiniReporter.prototype.finish = function (runStatus) {
195
194
}
196
195
197
196
status += '\n' + indentString ( test . error . message , 2 ) + '\n' ;
198
- status += '\n' + indentString ( colors . errorStack ( description ) , 2 ) ;
197
+
198
+ if ( test . error . stack ) {
199
+ status += '\n' + indentString ( colors . errorStack ( extractStack ( test . error . stack ) ) , 2 ) ;
200
+ }
199
201
} , this ) ;
200
202
}
201
203
Original file line number Diff line number Diff line change @@ -110,7 +110,6 @@ VerboseReporter.prototype.finish = function (runStatus) {
110
110
return ;
111
111
}
112
112
113
- var stack = extractStack ( test . error . stack ) ;
114
113
var beforeSpacing = index === 0 ? '\n\n' : '\n\n\n\n' ;
115
114
output += beforeSpacing + ' ' + colors . title ( test . title ) + '\n' ;
116
115
if ( test . error . source ) {
@@ -124,7 +123,9 @@ VerboseReporter.prototype.finish = function (runStatus) {
124
123
}
125
124
126
125
output += '\n' + indentString ( test . error . message , 2 ) + '\n' ;
127
- output += '\n' + indentString ( colors . errorStack ( stack ) , 2 ) ;
126
+ if ( test . error . stack ) {
127
+ output += '\n' + indentString ( colors . errorStack ( extractStack ( test . error . stack ) ) , 2 ) ;
128
+ }
128
129
} , this ) ;
129
130
}
130
131
Original file line number Diff line number Diff line change @@ -55,13 +55,15 @@ const stackUtils = new StackUtils();
55
55
module . exports = error => {
56
56
const err = cleanYamlObject ( error , filter ) ;
57
57
58
- const firstStackLine = extractStack ( err . stack ) . split ( '\n' ) [ 0 ] ;
59
- const source = stackUtils . parseLine ( firstStackLine ) ;
60
- if ( source ) {
61
- err . source = {
62
- file : source . file . trim ( ) ,
63
- line : source . line
64
- } ;
58
+ if ( err . stack ) {
59
+ const firstStackLine = extractStack ( err . stack ) . split ( '\n' ) [ 0 ] ;
60
+ const source = stackUtils . parseLine ( firstStackLine ) ;
61
+ if ( source ) {
62
+ err . source = {
63
+ file : source . file . trim ( ) ,
64
+ line : source . line
65
+ } ;
66
+ }
65
67
}
66
68
67
69
return err ;
You can’t perform that action at this time.
0 commit comments