mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 16:23:12 +09:00
Fixed failing tests for unsubscribe
This commit is contained in:
1 file changed
+3
-3
@@ -484,7 +484,7 @@ describe("lib/subscriptions", function() {
|
|||||||
});
|
});
|
||||||
it("should throw an error if the handler was not subscribed", function() {
|
it("should throw an error if the handler was not subscribed", function() {
|
||||||
function callback(value) { calledWith = value; }
|
function callback(value) { calledWith = value; }
|
||||||
assert.throws(
|
assert.rejects(
|
||||||
() => registeredEvent.unsubscribe(callback),
|
() => registeredEvent.unsubscribe(callback),
|
||||||
new Error("handler is not registered")
|
new Error("handler is not registered")
|
||||||
);
|
);
|
||||||
@@ -524,7 +524,7 @@ describe("lib/subscriptions", function() {
|
|||||||
});
|
});
|
||||||
it("should throw an error if the handler was not subscribed", function() {
|
it("should throw an error if the handler was not subscribed", function() {
|
||||||
function callback() {}
|
function callback() {}
|
||||||
assert.throws(
|
assert.rejects(
|
||||||
() => channelEvent.unsubscribeFromChannel("channelOne", callback),
|
() => channelEvent.unsubscribeFromChannel("channelOne", callback),
|
||||||
new Error("handler is not registered")
|
new Error("handler is not registered")
|
||||||
);
|
);
|
||||||
@@ -532,7 +532,7 @@ describe("lib/subscriptions", function() {
|
|||||||
let calledWith = null;
|
let calledWith = null;
|
||||||
function callbackTwo(value) { calledWith = value; }
|
function callbackTwo(value) { calledWith = value; }
|
||||||
channelEvent.subscribeToChannel("channelOne", callbackTwo);
|
channelEvent.subscribeToChannel("channelOne", callbackTwo);
|
||||||
assert.throws(
|
assert.rejects(
|
||||||
() => channelEvent.unsubscribeFromChannel("channelOne", callback),
|
() => channelEvent.unsubscribeFromChannel("channelOne", callback),
|
||||||
new Error("handler is not registered")
|
new Error("handler is not registered")
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user