Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-diagnostics-channel-object-channel-pub-sub.js')
-rw-r--r--test/parallel/test-diagnostics-channel-object-channel-pub-sub.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js b/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js
index cbc5b4d2e9a..9498419b806 100644
--- a/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js
+++ b/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js
@@ -35,9 +35,12 @@ assert.ok(channel instanceof Channel);
channel.publish(input);
// Should not publish after subscriber is unsubscribed
-channel.unsubscribe(subscriber);
+assert.ok(channel.unsubscribe(subscriber));
assert.ok(!channel.hasSubscribers);
+// unsubscribe() should return false when subscriber is not found
+assert.ok(!channel.unsubscribe(subscriber));
+
assert.throws(() => {
channel.subscribe(null);
}, { code: 'ERR_INVALID_ARG_TYPE' });