Skip to content

Commit

Permalink
test: improve assert messages in test-global
Browse files Browse the repository at this point in the history
PR-URL: #16843
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
markmcnelis authored and evanlucas committed Nov 13, 2017
1 parent 5f5ef42 commit adcaddf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/parallel/test-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,18 @@ baseFoo = 'foo'; // eslint-disable-line no-undef
global.baseBar = 'bar';

assert.strictEqual(global.baseFoo, 'foo',
'x -> global.x in base level not working');
`x -> global.x failed: global.baseFoo = ${global.baseFoo}`);

assert.strictEqual(baseBar, // eslint-disable-line no-undef
'bar',
'global.x -> x in base level not working');
// eslint-disable-next-line no-undef
`global.x -> x failed: baseBar = ${baseBar}`);

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]');

0 comments on commit adcaddf

Please sign in to comment.