Skip to content

Commit 833e614

Browse files
Lxxyxdanielleadams
authored andcommitted
test: increase coverage for diagnostics_channel
1. test subscribe with invalid args https://coverage.nodejs.org/coverage-21f2e8859dfbf09f/lib/diagnostics_channel.js.html#L27 2. test create channel with invalid args https://coverage.nodejs.org/coverage-21f2e8859dfbf09f/lib/diagnostics_channel.js.html#L98 PR-URL: #36602 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Pooja D P <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yash Ladha <[email protected]>
1 parent a53997e commit 833e614

2 files changed

+10
-0
lines changed

test/parallel/test-diagnostics-channel-object-channel-pub-sub.js

+4
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ channel.publish(input);
3737
// Should not publish after subscriber is unsubscribed
3838
channel.unsubscribe(subscriber);
3939
assert.ok(!channel.hasSubscribers);
40+
41+
assert.throws(() => {
42+
channel.subscribe(null);
43+
}, { code: 'ERR_INVALID_ARG_TYPE' });

test/parallel/test-diagnostics-channel-symbol-named.js

+6
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ channel.subscribe(common.mustCall((message, name) => {
2020
}));
2121

2222
channel.publish(input);
23+
24+
{
25+
assert.throws(() => {
26+
dc.channel(null);
27+
}, /ERR_INVALID_ARG_TYPE/);
28+
}

0 commit comments

Comments
 (0)