From 928291c652eb07ce8b3e4b2df0c2ca54fc483cbe Mon Sep 17 00:00:00 2001 From: Siddhartha Sahai Date: Sat, 10 Dec 2016 02:05:10 +0530 Subject: [PATCH] test: refactor test-domain.js apply setTimeout duration, add const, remove unused var PR-URL: https://github.com/nodejs/node/pull/10207 Reviewed-By: Rich Trott Reviewed-By: Santiago Gimeno --- test/parallel/test-domain.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-domain.js b/test/parallel/test-domain.js index 69521108f6e47b..73ab3b96168930 100644 --- a/test/parallel/test-domain.js +++ b/test/parallel/test-domain.js @@ -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; @@ -137,8 +137,8 @@ d.run(function() { // pretty common error. console.log(stat.isDirectory()); }); - }); - }); + }, 1); + }, 1); }); }); expectCaught++; @@ -148,7 +148,7 @@ expectCaught++; d.run(function() { setTimeout(function() { throw new Error('implicit timer'); - }); + }, 1); }); expectCaught++; @@ -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!'); }