Skip to content

Commit

Permalink
test: e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed May 28, 2021
1 parent a6e65e9 commit 5adf5d3
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions test/e2e/web-socket-server-and-url.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,47 @@ for (const webSocketServerType of webSocketServerTypes) {
});
});

describe('should work with custom client.webSocketURL.port and webSocketServer.options.port both as string', () => {
beforeAll((done) => {
const options = {
webSocketServer: {
type: webSocketServerType,
options: {
host: '0.0.0.0',
port: `${port2}`,
},
},
port: port2,
host: '0.0.0.0',
client: {
webSocketURL: {
port: `${port3}`,
},
},
};

testServer.startAwaitingCompilation(config, options, done);
});

afterAll(testServer.close);

describe('browser client', () => {
it('uses correct port and path', (done) => {
runBrowser().then(({ page, browser }) => {
waitForTest(browser, page, /ws/, (websocketUrl) => {
expect(websocketUrl).toContain(
`${websocketUrlProtocol}://localhost:${port3}/ws`
);

done();
});

page.goto(`http://localhost:${port2}/main`);
});
});
});
});

describe('should work with custom client host', () => {
beforeAll((done) => {
const options = {
Expand Down

0 comments on commit 5adf5d3

Please sign in to comment.