Skip to content

Commit ff212f4

Browse files
Lxxyxtargos
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 <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yash Ladha <yash@yashladha.in>
1 parent dcba374 commit ff212f4

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)