File tree 2 files changed +32
-1
lines changed
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,11 @@ module.exports = config => {
143
143
pattern : 'test/browser-specific/fixtures/esm.fixture.mjs' ,
144
144
type : 'module'
145
145
} ,
146
- { pattern : 'test/browser-specific/esm.spec.mjs' , type : 'module' }
146
+ { pattern : 'test/browser-specific/esm.spec.mjs' , type : 'module' } ,
147
+ {
148
+ pattern : 'test/browser-specific/uncaught-exception.spec.mjs' ,
149
+ type : 'module'
150
+ }
147
151
] ;
148
152
break ;
149
153
default :
Original file line number Diff line number Diff line change
1
+ import '/base/mocha.js' ;
2
+
3
+ var Mocha = window . Mocha ;
4
+ var Suite = Mocha . Suite ;
5
+ var Runner = Mocha . Runner ;
6
+
7
+ mocha . allowUncaught ( )
8
+
9
+ it ( 'should include the stack of uncaught exceptions' , function ( done ) {
10
+ var suite = new Suite ( 'Suite' , 'root' ) ;
11
+ var runner = new Runner ( suite ) ;
12
+ runner . allowUncaught = true ;
13
+ var err ;
14
+ runner . fail = function ( e ) {
15
+ err = e ;
16
+ } ;
17
+
18
+ setTimeout ( function throwTestError ( ) {
19
+ throw new Error ( 'test error' ) ;
20
+ } , 1 ) ;
21
+
22
+ setTimeout ( function ( ) {
23
+ expect ( err , 'to be an' , Error ) ;
24
+ expect ( err . stack , 'to contain' , 'at throwTestError' )
25
+ done ( ) ;
26
+ } , 2 ) ;
27
+ } ) ;
You can’t perform that action at this time.
0 commit comments