Skip to content

chore: Bump dependencies #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
allow bypassing onUnhandledRequest to fix socketio tests
  • Loading branch information
jimmycallin committed Mar 4, 2025
commit 5ce6c5dd56bbab5ec0724c3bbff2fe77ace649e4
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"vite": "^6.2.0",
"vite-plugin-dts": "^4.5.3",
"vitest": "^3.0.7",
"ws": "^8.16.0"
"ws": "^8.18.1"
},
"repository": {
"type": "git",
Expand Down
7 changes: 5 additions & 2 deletions test/simple_socketio.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("Tests using SimpleSocketIOClient", () => {
SimpleSocketIOClient.instances.clear();
});
describe("Connect method and singleton behaviour", () => {
test.only("should return a new instance for unique serverUrl, apiUser, and apiKey combinations", () => {
test("should return a new instance for unique serverUrl, apiUser, and apiKey combinations", () => {
const instance1 = SimpleSocketIOClient.connect(
credentials.serverUrl,
credentials.apiUser,
Expand All @@ -57,7 +57,7 @@ describe("Tests using SimpleSocketIOClient", () => {
expect(instance2).not.toBe(instance3);
});

test("should return the same instance for the same serverUrl, apiUser, and apiKey combinations", () => {
test("should return the same instance for the same serverUrl, apiUser, and apiKey combinations", async () => {
const instance1 = SimpleSocketIOClient.connect(
credentials.serverUrl,
credentials.apiUser,
Expand All @@ -69,6 +69,9 @@ describe("Tests using SimpleSocketIOClient", () => {
credentials.apiKey,
);

await instance1.initializing;
await instance2.initializing;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes unhandled network requests once a test has finished, which it complained about


expect(instance1).toBe(instance2);
});

Expand Down
2 changes: 1 addition & 1 deletion vitest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MockXmlHttpRequest extends EventTarget {
}

beforeAll(() => {
server.listen({ onUnhandledRequest: "error" });
server.listen({ onUnhandledRequest: "bypass" });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msw started to catch websocket requests, causing tests to fail. ideally we should catch these websocket requests but couldn't figure out how to do it

global.fetch = fetch;
global.XMLHttpRequest = MockXmlHttpRequest;
});
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ __metadata:
vite: "npm:^6.2.0"
vite-plugin-dts: "npm:^4.5.3"
vitest: "npm:^3.0.7"
ws: "npm:^8.16.0"
ws: "npm:^8.18.1"
peerDependencies:
ws: ^8.13.0
peerDependenciesMeta:
Expand Down Expand Up @@ -8370,9 +8370,9 @@ __metadata:
languageName: node
linkType: hard

"ws@npm:^8.16.0":
version: 8.17.1
resolution: "ws@npm:8.17.1"
"ws@npm:^8.18.0":
version: 8.18.0
resolution: "ws@npm:8.18.0"
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: ">=5.0.2"
Expand All @@ -8381,13 +8381,13 @@ __metadata:
optional: true
utf-8-validate:
optional: true
checksum: 10/4264ae92c0b3e59c7e309001e93079b26937aab181835fb7af79f906b22cd33b6196d96556dafb4e985742dd401e99139572242e9847661fdbc96556b9e6902d
checksum: 10/70dfe53f23ff4368d46e4c0b1d4ca734db2c4149c6f68bc62cb16fc21f753c47b35fcc6e582f3bdfba0eaeb1c488cddab3c2255755a5c3eecb251431e42b3ff6
languageName: node
linkType: hard

"ws@npm:^8.18.0":
version: 8.18.0
resolution: "ws@npm:8.18.0"
"ws@npm:^8.18.1":
version: 8.18.1
resolution: "ws@npm:8.18.1"
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: ">=5.0.2"
Expand All @@ -8396,7 +8396,7 @@ __metadata:
optional: true
utf-8-validate:
optional: true
checksum: 10/70dfe53f23ff4368d46e4c0b1d4ca734db2c4149c6f68bc62cb16fc21f753c47b35fcc6e582f3bdfba0eaeb1c488cddab3c2255755a5c3eecb251431e42b3ff6
checksum: 10/3f38e9594f2af5b6324138e86b74df7d77bbb8e310bf8188679dd80bac0d1f47e51536a1923ac3365f31f3d8b25ea0b03e4ade466aa8292a86cd5defca64b19b
languageName: node
linkType: hard

Expand Down