mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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:
parent
70f168b883
commit
ee31c28298
5
test/fixtures/not-main-module.js
vendored
5
test/fixtures/not-main-module.js
vendored
@ -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');
|
|
||||||
|
@ -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');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user