Skip to content

Commit

Permalink
[test] Remove redundant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Aug 20, 2023
1 parent 8f5cc9d commit 5299b0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 34 deletions.
6 changes: 4 additions & 2 deletions test/websocket-server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,9 @@ describe('WebSocketServer', () => {

it("emits the 'headers' event", (done) => {
const wss = new WebSocket.Server({ port: 0 }, () => {
const ws = new WebSocket(`ws://localhost:${wss.address().port}`);
const ws = new WebSocket(
`ws://localhost:${wss.address().port}?foo=bar`
);

ws.on('open', ws.close);
});
Expand All @@ -1225,7 +1227,7 @@ describe('WebSocketServer', () => {
'Connection: Upgrade'
]);
assert.ok(request instanceof http.IncomingMessage);
assert.strictEqual(request.url, '/');
assert.strictEqual(request.url, '/?foo=bar');

wss.on('connection', () => wss.close(done));
});
Expand Down
32 changes: 0 additions & 32 deletions test/websocket.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1901,38 +1901,6 @@ describe('WebSocket', () => {
});
});

describe('Connection with query string', () => {
it('connects when pathname is not null', (done) => {
const wss = new WebSocket.Server({ port: 0 }, () => {
const port = wss.address().port;
const ws = new WebSocket(`ws://localhost:${port}/?token=qwerty`);

ws.on('open', () => {
wss.close(done);
});
});

wss.on('connection', (ws) => {
ws.close();
});
});

it('connects when pathname is null', (done) => {
const wss = new WebSocket.Server({ port: 0 }, () => {
const port = wss.address().port;
const ws = new WebSocket(`ws://localhost:${port}?token=qwerty`);

ws.on('open', () => {
wss.close(done);
});
});

wss.on('connection', (ws) => {
ws.close();
});
});
});

describe('#pause', () => {
it('does nothing if `readyState` is `CONNECTING` or `CLOSED`', (done) => {
const wss = new WebSocket.Server({ port: 0 }, () => {
Expand Down

0 comments on commit 5299b0e

Please sign in to comment.