Skip to content

Commit 8465ddc

Browse files
add tests
1 parent 404f817 commit 8465ddc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

packages/engine.io-client/test/transport.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,32 @@ describe("Transport", () => {
116116
expect(polling.uri()).to.contain("https://localhost/engine.io?sid=test");
117117
});
118118

119+
it("should generate an https uri w/o a port (string)", () => {
120+
const polling = new eio.transports.polling({
121+
path: "/engine.io",
122+
hostname: "localhost",
123+
secure: true,
124+
query: { sid: "test" },
125+
port: "443",
126+
timestampRequests: false,
127+
});
128+
expect(polling.uri()).to.contain("https://localhost/engine.io?sid=test");
129+
});
130+
131+
it("should generate an https uri with a port", () => {
132+
const polling = new eio.transports.polling({
133+
path: "/engine.io",
134+
hostname: "localhost",
135+
secure: true,
136+
query: { sid: "test" },
137+
port: 8443,
138+
timestampRequests: false,
139+
});
140+
expect(polling.uri()).to.contain(
141+
"https://localhost:8443/engine.io?sid=test",
142+
);
143+
});
144+
119145
it("should generate a timestamped uri", () => {
120146
const polling = new eio.transports.polling({
121147
path: "/engine.io",

0 commit comments

Comments
 (0)