Skip to content

Commit 60542cb

Browse files
sidthekidderMylesBorins
authored andcommitted
test: refactor test-domain.js
apply setTimeout duration, add const, remove unused var PR-URL: #10207 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]>
1 parent c0800d9 commit 60542cb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/parallel/test-domain.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// Simple tests of most basic domain functionality.
33

44
require('../common');
5-
var assert = require('assert');
6-
var domain = require('domain');
7-
var events = require('events');
8-
var fs = require('fs');
5+
const assert = require('assert');
6+
const domain = require('domain');
7+
const events = require('events');
8+
const fs = require('fs');
99
var caught = 0;
1010
var expectCaught = 0;
1111

@@ -137,8 +137,8 @@ d.run(function() {
137137
// pretty common error.
138138
console.log(stat.isDirectory());
139139
});
140-
});
141-
});
140+
}, 1);
141+
}, 1);
142142
});
143143
});
144144
expectCaught++;
@@ -148,7 +148,7 @@ expectCaught++;
148148
d.run(function() {
149149
setTimeout(function() {
150150
throw new Error('implicit timer');
151-
});
151+
}, 1);
152152
});
153153
expectCaught++;
154154

@@ -162,7 +162,7 @@ expectCaught++;
162162
// get rid of the `if (er) return cb(er)` malarky, by intercepting
163163
// the cb functions to the domain, and using the intercepted function
164164
// as a callback instead.
165-
function fn(er) {
165+
function fn() {
166166
throw new Error('This function should never be called!');
167167
}
168168

0 commit comments

Comments
 (0)