Skip to content

Commit 5adf5d3

Browse files
committed
test: e2e
1 parent a6e65e9 commit 5adf5d3

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

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

+41
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,47 @@ for (const webSocketServerType of webSocketServerTypes) {
351351
});
352352
});
353353

354+
describe('should work with custom client.webSocketURL.port and webSocketServer.options.port both as string', () => {
355+
beforeAll((done) => {
356+
const options = {
357+
webSocketServer: {
358+
type: webSocketServerType,
359+
options: {
360+
host: '0.0.0.0',
361+
port: `${port2}`,
362+
},
363+
},
364+
port: port2,
365+
host: '0.0.0.0',
366+
client: {
367+
webSocketURL: {
368+
port: `${port3}`,
369+
},
370+
},
371+
};
372+
373+
testServer.startAwaitingCompilation(config, options, done);
374+
});
375+
376+
afterAll(testServer.close);
377+
378+
describe('browser client', () => {
379+
it('uses correct port and path', (done) => {
380+
runBrowser().then(({ page, browser }) => {
381+
waitForTest(browser, page, /ws/, (websocketUrl) => {
382+
expect(websocketUrl).toContain(
383+
`${websocketUrlProtocol}://localhost:${port3}/ws`
384+
);
385+
386+
done();
387+
});
388+
389+
page.goto(`http://localhost:${port2}/main`);
390+
});
391+
});
392+
});
393+
});
394+
354395
describe('should work with custom client host', () => {
355396
beforeAll((done) => {
356397
const options = {

0 commit comments

Comments
 (0)