Skip to content

Commit d3cbd73

Browse files
committed
test: e2e
1 parent 78b8a89 commit d3cbd73

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/e2e/web-socket-server-and-url.test.js

+35
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,41 @@ for (const webSocketServerType of webSocketServerTypes) {
316316
});
317317
});
318318

319+
describe('should work with custom client port as string', () => {
320+
beforeAll((done) => {
321+
const options = {
322+
webSocketServer: webSocketServerType,
323+
port: port2,
324+
host: '0.0.0.0',
325+
client: {
326+
webSocketURL: {
327+
port: `${port3}`,
328+
},
329+
},
330+
};
331+
332+
testServer.startAwaitingCompilation(config, options, done);
333+
});
334+
335+
afterAll(testServer.close);
336+
337+
describe('browser client', () => {
338+
it('uses correct port and path', (done) => {
339+
runBrowser().then(({ page, browser }) => {
340+
waitForTest(browser, page, /ws/, (websocketUrl) => {
341+
expect(websocketUrl).toContain(
342+
`${websocketUrlProtocol}://localhost:${port3}/ws`
343+
);
344+
345+
done();
346+
});
347+
348+
page.goto(`http://localhost:${port2}/main`);
349+
});
350+
});
351+
});
352+
});
353+
319354
describe('should work with custom client host', () => {
320355
beforeAll((done) => {
321356
const options = {

0 commit comments

Comments
 (0)