Skip to content

Commit

Permalink
test: remove string literals for strictEquals/notStrictEquals
Browse files Browse the repository at this point in the history
In short: Some unit tests are using string literals to simply tell you a
conclusion what's right/wrong BUT not tell you what actually values are.
So it's necessary to print them out in the console.

Refs: #22849
PR-URL: #22891
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
MaleDong authored and targos committed Sep 23, 2018
1 parent 4db9e36 commit 9de6b26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions test/fixtures/not-main-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

const assert = require('assert');
assert.notStrictEqual(module, require.main, 'require.main should not == module');
assert.notStrictEqual(module, process.mainModule,
'process.mainModule should not === module');
assert.notStrictEqual(module, require.main);
assert.notStrictEqual(module, process.mainModule);
12 changes: 6 additions & 6 deletions test/parallel/test-async-wrap-trigger-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ let triggerAsyncId1;
process.nextTick(() => {
process.nextTick(() => {
triggerAsyncId1 = triggerAsyncId();
// Async resources having different causal ancestry
// should have different triggerAsyncIds
assert.notStrictEqual(
triggerAsyncId0,
triggerAsyncId1,
'Async resources having different causal ancestry ' +
'should have different triggerAsyncIds');
triggerAsyncId1);
});
process.nextTick(() => {
const triggerAsyncId2 = triggerAsyncId();
// Async resources having the same causal ancestry
// should have the same triggerAsyncId
assert.strictEqual(
triggerAsyncId1,
triggerAsyncId2,
'Async resources having the same causal ancestry ' +
'should have the same triggerAsyncId');
triggerAsyncId2);
});
});

0 comments on commit 9de6b26

Please sign in to comment.