Fix some net bugs

This commit is contained in:
Jon Staab
2026-05-28 11:30:54 -07:00
parent 4137f35cee
commit 3b2f2b14e4
10 changed files with 81 additions and 40 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ describe("Pool", () => {
describe("remove", () => {
it("should remove and cleanup existing socket", () => {
const mockSocket = {url: "wss://test.relay", cleanup: vi.fn()}
const mockSocket = {url: "wss://test.relay/", cleanup: vi.fn()}
pool._data.set(mockSocket.url, mockSocket as unknown as Socket)
pool.remove(mockSocket.url)
@@ -111,7 +111,7 @@ describe("Pool", () => {
describe("clear", () => {
it("should remove all sockets", () => {
const urls = ["wss://test1.relay", "wss://test2.relay"]
const urls = ["wss://test1.relay/", "wss://test2.relay/"]
const mockSockets = urls.map(url => ({url, cleanup: vi.fn()}))
for (const mockSocket of mockSockets) {