File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,18 @@ describe("logger", () => {
228
228
setGlobalOptions ( defaultOptions ) ;
229
229
} ) ;
230
230
231
+ afterEach ( ( ) => {
232
+ setGlobalOptions ( defaultOptions ) ;
233
+ } ) ;
234
+
235
+ it ( "default behavior is to include stacktrace in error logs" , ( ) => {
236
+ // If this test fails, it means there's a breaking change.
237
+ const message = "Test error with stacktrace" ;
238
+ logger . error ( message ) ;
239
+ const messageOutput = JSON . parse ( lastErr . trim ( ) ) . message ;
240
+ expect ( messageOutput ) . to . include ( `Error: ${ message } ` ) ;
241
+ } ) ;
242
+
231
243
it ( "when disableErrorLoggingStacktrace is set to false, should include stacktrace in error logs" , ( ) => {
232
244
const message = "Test error with stacktrace" ;
233
245
setGlobalOptions ( {
@@ -250,9 +262,5 @@ describe("logger", () => {
250
262
message : message ,
251
263
} ) ;
252
264
} ) ;
253
-
254
- afterEach ( ( ) => {
255
- setGlobalOptions ( defaultOptions ) ;
256
- } ) ;
257
265
} ) ;
258
266
} ) ;
You can’t perform that action at this time.
0 commit comments