Skip to content

Commit 4e7d629

Browse files
authored
[web-pubsub][test] verify just the prefix of ERR_INVALID_URL message (Azure#15339)
as in the latest version of node the input url has been removed from the message: nodejs/node@417c31b
1 parent dc2d3ad commit 4e7d629

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sdk/web-pubsub/web-pubsub-express/test/ctor.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ describe("Can creat event handler", function() {
1818
});
1919

2020
it("Throw with invalid endpoints", function() {
21-
assert.throws(() => new WebPubSubEventHandler("hub", ["b.com"]), "Invalid URL: b.com");
21+
try {
22+
new WebPubSubEventHandler("hub", ["b.com"]);
23+
assert.fail("Should have thrown ERROR_INVALID_URL");
24+
} catch (err) {
25+
assert.isTrue((err as any).message.startsWith("Invalid URL"));
26+
}
2227
});
2328
});

0 commit comments

Comments
 (0)