From 4e82f744f7f43bf6cd480e5756114f169eb88fd4 Mon Sep 17 00:00:00 2001 From: Daniel Sims Date: Thu, 1 Dec 2016 10:02:15 -0600 Subject: [PATCH 1/2] test: edited assertion and timeout for test In this change, the setTimeout needed a second argument, so I set that value to 0. In addition, I changed the assertion to be a strictEquals instead of equals. --- test/parallel/test-domain-from-timer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-domain-from-timer.js b/test/parallel/test-domain-from-timer.js index f0115018ec1879..324ac5a6a6a7fb 100644 --- a/test/parallel/test-domain-from-timer.js +++ b/test/parallel/test-domain-from-timer.js @@ -12,7 +12,7 @@ setTimeout(function() { d.run(function() { process.nextTick(function() { console.trace('in nexttick', process.domain === d); - assert.equal(process.domain, d); + assert.strictEqual(process.domain, d); }); }); -}); +}, 0); From 193f396cc3f1cdcdb4a954d76b53e9adfb8dee5f Mon Sep 17 00:00:00 2001 From: Daniel Sims Date: Tue, 6 Dec 2016 15:01:25 -0500 Subject: [PATCH 2/2] test: Changing var declaration to const I changed the var declarations to const in this unit test --- test/parallel/test-domain-from-timer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-domain-from-timer.js b/test/parallel/test-domain-from-timer.js index 324ac5a6a6a7fb..7549b98de19429 100644 --- a/test/parallel/test-domain-from-timer.js +++ b/test/parallel/test-domain-from-timer.js @@ -2,13 +2,13 @@ // Simple tests of most basic domain functionality. require('../common'); -var assert = require('assert'); +const assert = require('assert'); // timeouts call the callback directly from cc, so need to make sure the // domain will be used regardless setTimeout(function() { - var domain = require('domain'); - var d = domain.create(); + const domain = require('domain'); + const d = domain.create(); d.run(function() { process.nextTick(function() { console.trace('in nexttick', process.domain === d);