Skip to content

Commit

Permalink
test: upgrade to mock-socket with proper send() behaviour on `CLO…
Browse files Browse the repository at this point in the history
…SING` and `CLOSED`
  • Loading branch information
steveluscher committed Sep 8, 2023
1 parent 94b4d49 commit e09b513
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"pnpm": {
"overrides": {
"jsdom": "^22",
"mock-socket": "^9.3.0",
"shelljs": ">=0.8.5"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,15 @@ describe('RpcWebSocketConnection', () => {
connection.send({ some: 'message' });
await expect(ws).toReceiveMessage({ some: 'message' });
});
// See https://github.com/thoov/mock-socket/pull/382
it.failing('does not fatal when sending a message to a closing connection', async () => {
expect.assertions(1);
it('does not fatal when sending a message to a closing connection', async () => {
expect.assertions(2);
const client = getLatestClient();
abortController.abort();
expect(client).toHaveProperty('readyState', WebSocket.CLOSING);
await expect(connection.send({ some: 'message' })).resolves.toBeUndefined();
});
// See https://github.com/thoov/mock-socket/pull/382
it.failing('does not fatal when sending a message to a closed connection', async () => {
expect.assertions(1);
it('does not fatal when sending a message to a closed connection', async () => {
expect.assertions(2);
const client = getLatestClient();
abortController.abort();
await ws.closed;
Expand Down
15 changes: 8 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e09b513

Please sign in to comment.