test: remove string literals for strictEquals/notStrictEquals

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: https://github.com/nodejs/node/pull/22849
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
MaleDong 2018-09-17 13:50:09 +08:00 committed by Anna Henningsen
parent 70f168b883
commit ee31c28298
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9
2 changed files with 8 additions and 9 deletions

View File

@ -20,6 +20,5 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE. // USE OR OTHER DEALINGS IN THE SOFTWARE.
const assert = require('assert'); const assert = require('assert');
assert.notStrictEqual(module, require.main, 'require.main should not == module'); assert.notStrictEqual(module, require.main);
assert.notStrictEqual(module, process.mainModule, assert.notStrictEqual(module, process.mainModule);
'process.mainModule should not === module');

View File

@ -11,18 +11,18 @@ let triggerAsyncId1;
process.nextTick(() => { process.nextTick(() => {
process.nextTick(() => { process.nextTick(() => {
triggerAsyncId1 = triggerAsyncId(); triggerAsyncId1 = triggerAsyncId();
// Async resources having different causal ancestry
// should have different triggerAsyncIds
assert.notStrictEqual( assert.notStrictEqual(
triggerAsyncId0, triggerAsyncId0,
triggerAsyncId1, triggerAsyncId1);
'Async resources having different causal ancestry ' +
'should have different triggerAsyncIds');
}); });
process.nextTick(() => { process.nextTick(() => {
const triggerAsyncId2 = triggerAsyncId(); const triggerAsyncId2 = triggerAsyncId();
// Async resources having the same causal ancestry
// should have the same triggerAsyncId
assert.strictEqual( assert.strictEqual(
triggerAsyncId1, triggerAsyncId1,
triggerAsyncId2, triggerAsyncId2);
'Async resources having the same causal ancestry ' +
'should have the same triggerAsyncId');
}); });
}); });