Skip to content

Commit

Permalink
test: refactor test-domain.js
Browse files Browse the repository at this point in the history
apply setTimeout duration, add const, remove unused var

PR-URL: #10207
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
  • Loading branch information
sidthekidder authored and MylesBorins committed Jan 31, 2017
1 parent 40c7ec6 commit 4b5587c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/parallel/test-domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Simple tests of most basic domain functionality.

require('../common');
var assert = require('assert');
var domain = require('domain');
var events = require('events');
var fs = require('fs');
const assert = require('assert');
const domain = require('domain');
const events = require('events');
const fs = require('fs');
var caught = 0;
var expectCaught = 0;

Expand Down Expand Up @@ -137,8 +137,8 @@ d.run(function() {
// pretty common error.
console.log(stat.isDirectory());
});
});
});
}, 1);
}, 1);
});
});
expectCaught++;
Expand All @@ -148,7 +148,7 @@ expectCaught++;
d.run(function() {
setTimeout(function() {
throw new Error('implicit timer');
});
}, 1);
});
expectCaught++;

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

Expand Down

0 comments on commit 4b5587c

Please sign in to comment.