From fdf80976f025968b2da5b248ef3c27da876ad653 Mon Sep 17 00:00:00 2001 From: Grant Gasparyan Date: Mon, 6 Nov 2017 17:37:28 +0100 Subject: [PATCH 1/3] test: add value to assertion message --- test/parallel/test-cluster-fork-env.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-cluster-fork-env.js b/test/parallel/test-cluster-fork-env.js index 1591977d2172b9..2451bb73218463 100644 --- a/test/parallel/test-cluster-fork-env.js +++ b/test/parallel/test-cluster-fork-env.js @@ -56,10 +56,12 @@ if (cluster.isWorker) { }); process.once('exit', function() { - assert.ok(checks.using, 'The worker did not receive the correct env.'); + assert.ok(checks.using, 'The worker did not receive the correct env.' + + `${checks.using}`); assert.ok( checks.overwrite, - 'The custom environment did not overwrite the existing environment.'); + 'The custom environment did not overwrite the existing environment.' + + `${checks.overwrite}`); }); } From e3a4af5b94e10811d09ddd02e04ff5a670a702c2 Mon Sep 17 00:00:00 2001 From: Grant Gasparyan Date: Tue, 7 Nov 2017 18:27:26 +0100 Subject: [PATCH 2/3] test: fix to assert message --- test/parallel/test-cluster-fork-env.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-cluster-fork-env.js b/test/parallel/test-cluster-fork-env.js index 2451bb73218463..e006a86d5379a3 100644 --- a/test/parallel/test-cluster-fork-env.js +++ b/test/parallel/test-cluster-fork-env.js @@ -56,12 +56,13 @@ if (cluster.isWorker) { }); process.once('exit', function() { - assert.ok(checks.using, 'The worker did not receive the correct env.' + - `${checks.using}`); + assert.ok( + checks.using, + `The worker did not receive the correct env. ${checks.using}`); assert.ok( checks.overwrite, - 'The custom environment did not overwrite the existing environment.' + - `${checks.overwrite}`); + `The custom environment did not overwrite the existing environment. ${ + checks.overwrite}`); }); } From 4ef455a5a14f4ce8b2b2fadcca3b1105fa228284 Mon Sep 17 00:00:00 2001 From: Grant Gasparyan Date: Wed, 8 Nov 2017 20:11:59 +0100 Subject: [PATCH 3/3] test: add test description --- test/parallel/test-cluster-fork-env.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-cluster-fork-env.js b/test/parallel/test-cluster-fork-env.js index e006a86d5379a3..5dd28163084a21 100644 --- a/test/parallel/test-cluster-fork-env.js +++ b/test/parallel/test-cluster-fork-env.js @@ -21,6 +21,11 @@ 'use strict'; require('../common'); + +// This test checks that arguments provided to cluster.fork() will create +// new environment variables and override existing environment variables +// in the created worker process. + const assert = require('assert'); const cluster = require('cluster'); @@ -56,13 +61,10 @@ if (cluster.isWorker) { }); process.once('exit', function() { - assert.ok( - checks.using, - `The worker did not receive the correct env. ${checks.using}`); + assert.ok(checks.using, 'The worker did not receive the correct env.'); assert.ok( checks.overwrite, - `The custom environment did not overwrite the existing environment. ${ - checks.overwrite}`); + 'The custom environment did not overwrite the existing environment.'); }); }