From 1c6fd40686dc9d3601c7ea9e67b621c7510519ef Mon Sep 17 00:00:00 2001 From: Mark McNelis Date: Mon, 6 Nov 2017 18:22:57 +0000 Subject: [PATCH 1/3] test: change assert message arg from literal to template literal --- test/parallel/test-global.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-global.js b/test/parallel/test-global.js index 2300fd1051dd0c..a2bd6241b9cf3c 100644 --- a/test/parallel/test-global.js +++ b/test/parallel/test-global.js @@ -34,17 +34,21 @@ baseFoo = 'foo'; // eslint-disable-line no-undef global.baseBar = 'bar'; assert.strictEqual(global.baseFoo, 'foo', - 'x -> global.x in base level not working'); + // eslint-disable-next-line no-undef + `${baseFoo} -> global.baseFoo in base level not + working`); assert.strictEqual(baseBar, // eslint-disable-line no-undef 'bar', - 'global.x -> x in base level not working'); + // eslint-disable-next-line no-undef + `${global.baseBar} -> baseBar in base level not + working`); const mod = require(fixtures.path('global', 'plain')); const fooBar = mod.fooBar; -assert.strictEqual(fooBar.foo, 'foo', 'x -> global.x in sub level not working'); +assert.strictEqual(fooBar.foo, 'foo'); -assert.strictEqual(fooBar.bar, 'bar', 'global.x -> x in sub level not working'); +assert.strictEqual(fooBar.bar, 'bar'); assert.strictEqual(Object.prototype.toString.call(global), '[object global]'); From fafd4a185fa87d44fcc455c73c354d6b510e3201 Mon Sep 17 00:00:00 2001 From: Mark McNelis Date: Mon, 6 Nov 2017 18:22:57 +0000 Subject: [PATCH 2/3] test: change assert message arg from literal to template literal --- test/parallel/test-global.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-global.js b/test/parallel/test-global.js index 2300fd1051dd0c..a2bd6241b9cf3c 100644 --- a/test/parallel/test-global.js +++ b/test/parallel/test-global.js @@ -34,17 +34,21 @@ baseFoo = 'foo'; // eslint-disable-line no-undef global.baseBar = 'bar'; assert.strictEqual(global.baseFoo, 'foo', - 'x -> global.x in base level not working'); + // eslint-disable-next-line no-undef + `${baseFoo} -> global.baseFoo in base level not + working`); assert.strictEqual(baseBar, // eslint-disable-line no-undef 'bar', - 'global.x -> x in base level not working'); + // eslint-disable-next-line no-undef + `${global.baseBar} -> baseBar in base level not + working`); const mod = require(fixtures.path('global', 'plain')); const fooBar = mod.fooBar; -assert.strictEqual(fooBar.foo, 'foo', 'x -> global.x in sub level not working'); +assert.strictEqual(fooBar.foo, 'foo'); -assert.strictEqual(fooBar.bar, 'bar', 'global.x -> x in sub level not working'); +assert.strictEqual(fooBar.bar, 'bar'); assert.strictEqual(Object.prototype.toString.call(global), '[object global]'); From 45f4e6f72ebe3310bbbbb3c9127679ce3e9d1d89 Mon Sep 17 00:00:00 2001 From: Mark McNelis Date: Mon, 6 Nov 2017 23:50:35 +0000 Subject: [PATCH 3/3] test: refactoring message based on feedback --- test/parallel/test-global.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-global.js b/test/parallel/test-global.js index a2bd6241b9cf3c..46db72eeceb586 100644 --- a/test/parallel/test-global.js +++ b/test/parallel/test-global.js @@ -34,15 +34,12 @@ baseFoo = 'foo'; // eslint-disable-line no-undef global.baseBar = 'bar'; assert.strictEqual(global.baseFoo, 'foo', - // eslint-disable-next-line no-undef - `${baseFoo} -> global.baseFoo in base level not - working`); + `x -> global.x failed: global.baseFoo = ${global.baseFoo}`); assert.strictEqual(baseBar, // eslint-disable-line no-undef 'bar', // eslint-disable-next-line no-undef - `${global.baseBar} -> baseBar in base level not - working`); + `global.x -> x failed: baseBar = ${baseBar}`); const mod = require(fixtures.path('global', 'plain')); const fooBar = mod.fooBar;