Skip to content

Commit 9de6b26

Browse files
MaleDongtargos
MaleDong
authored andcommitted
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: #22849 PR-URL: #22891 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4db9e36 commit 9de6b26

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

test/fixtures/not-main-module.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
const assert = require('assert');
23-
assert.notStrictEqual(module, require.main, 'require.main should not == module');
24-
assert.notStrictEqual(module, process.mainModule,
25-
'process.mainModule should not === module');
23+
assert.notStrictEqual(module, require.main);
24+
assert.notStrictEqual(module, process.mainModule);

test/parallel/test-async-wrap-trigger-id.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ let triggerAsyncId1;
1111
process.nextTick(() => {
1212
process.nextTick(() => {
1313
triggerAsyncId1 = triggerAsyncId();
14+
// Async resources having different causal ancestry
15+
// should have different triggerAsyncIds
1416
assert.notStrictEqual(
1517
triggerAsyncId0,
16-
triggerAsyncId1,
17-
'Async resources having different causal ancestry ' +
18-
'should have different triggerAsyncIds');
18+
triggerAsyncId1);
1919
});
2020
process.nextTick(() => {
2121
const triggerAsyncId2 = triggerAsyncId();
22+
// Async resources having the same causal ancestry
23+
// should have the same triggerAsyncId
2224
assert.strictEqual(
2325
triggerAsyncId1,
24-
triggerAsyncId2,
25-
'Async resources having the same causal ancestry ' +
26-
'should have the same triggerAsyncId');
26+
triggerAsyncId2);
2727
});
2828
});

0 commit comments

Comments
 (0)