File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
require ( '../common' ) ;
3
+ var common = require ( '../common' ) ;
3
4
var assert = require ( 'assert' ) ;
4
5
var domain = require ( 'domain' ) ;
5
- var disposalFailed = false ;
6
6
7
7
// no matter what happens, we should increment a 10 times.
8
8
var a = 0 ;
@@ -22,11 +22,7 @@ function err() {
22
22
function err2 ( ) {
23
23
// this timeout should never be called, since the domain gets
24
24
// disposed when the error happens.
25
- setTimeout ( function ( ) {
26
- console . error ( 'This should not happen.' ) ;
27
- disposalFailed = true ;
28
- process . exit ( 1 ) ;
29
- } ) ;
25
+ setTimeout ( common . mustCall ( ( ) => { } , 0 ) , 1 ) ;
30
26
31
27
// this function doesn't exist, and throws an error as a result.
32
28
err3 ( ) ; // eslint-disable-line no-undef
@@ -41,7 +37,6 @@ function err() {
41
37
}
42
38
43
39
process . on ( 'exit' , function ( ) {
44
- assert . equal ( a , 10 ) ;
45
- assert . equal ( disposalFailed , false ) ;
40
+ assert . strictEqual ( a , 10 ) ;
46
41
console . log ( 'ok' ) ;
47
42
} ) ;
You can’t perform that action at this time.
0 commit comments