Skip to content

Commit db8d173

Browse files
committed
test: refactor
1 parent 0074ab4 commit db8d173

File tree

1 file changed

+2
-47
lines changed

1 file changed

+2
-47
lines changed

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

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,6 @@ for (const webSocketServerType of webSocketServerTypes) {
460460
webSocketServer: webSocketServerType,
461461
port: 'auto',
462462
host: '0.0.0.0',
463-
client: {
464-
webSocketURL: {
465-
port: port2,
466-
},
467-
},
468463
};
469464
testServer.startAwaitingCompilation(config, options, done);
470465
});
@@ -476,7 +471,7 @@ for (const webSocketServerType of webSocketServerTypes) {
476471
runBrowser().then(({ page, browser }) => {
477472
waitForTest(browser, page, /ws/, (websocketUrl) => {
478473
expect(websocketUrl).toContain(
479-
`${websocketUrlProtocol}://localhost:${port2}/ws`
474+
`${websocketUrlProtocol}://localhost:8080/ws`
480475
);
481476

482477
done();
@@ -488,52 +483,12 @@ for (const webSocketServerType of webSocketServerTypes) {
488483
});
489484
});
490485

491-
describe('should work with the "port" option is 80', () => {
492-
beforeAll((done) => {
493-
const options = {
494-
webSocketServer: webSocketServerType,
495-
port: 80,
496-
host: '0.0.0.0',
497-
client: {
498-
webSocketURL: {
499-
port: port2,
500-
},
501-
},
502-
};
503-
504-
testServer.startAwaitingCompilation(config, options, done);
505-
});
506-
507-
afterAll(testServer.close);
508-
509-
describe('browser client', () => {
510-
it('should work', (done) => {
511-
runBrowser().then(({ page, browser }) => {
512-
waitForTest(browser, page, /ws/, (websocketUrl) => {
513-
expect(websocketUrl).toContain(
514-
`${websocketUrlProtocol}://localhost:${port2}/ws`
515-
);
516-
517-
done();
518-
});
519-
520-
page.goto(`http://localhost:80/main`);
521-
});
522-
});
523-
});
524-
});
525-
526486
describe('should work when "host" option is IPv4', () => {
527487
beforeAll((done) => {
528488
const options = {
529489
webSocketServer: webSocketServerType,
530490
port: port3,
531491
host: internalIp.v4.sync(),
532-
client: {
533-
webSocketURL: {
534-
port: port2,
535-
},
536-
},
537492
};
538493
testServer.startAwaitingCompilation(config, options, done);
539494
});
@@ -545,7 +500,7 @@ for (const webSocketServerType of webSocketServerTypes) {
545500
runBrowser().then(({ page, browser }) => {
546501
waitForTest(browser, page, /ws/, (websocketUrl) => {
547502
expect(websocketUrl).toContain(
548-
`${websocketUrlProtocol}://${internalIp.v4.sync()}:${port2}/ws`
503+
`${websocketUrlProtocol}://${internalIp.v4.sync()}:${port3}/ws`
549504
);
550505

551506
done();

0 commit comments

Comments
 (0)