import { test, expect, describe } from "bun:test"; import { join } from "node:path"; import { bunEnv, bunExe } from "harness"; describe("fetch doesn't leak", () => { test("fixture #1", async () => { const body = new Blob(["some body in here!".repeat(100)]); var count = 0; const server = Bun.serve({ port: 0, fetch(req) { count++; return new Response(body); }, }); const proc = Bun.spawn({ env: { ...bunEnv, SERVER: `http://${server.hostname}:${server.port}`, COUNT: "200", }, stderr: "inherit", stdout: "inherit", cmd: [bunExe(), "--smol", join(import.meta.dir, "fetch-leak-test-fixture.js")], }); const exitCode = await proc.exited; server.stop(true); expect(exitCode).toBe(0); expect(count).toBe(200); }); test("fixture #2", async () => { const body = new Blob(["some body in here!".repeat(100)]); const server = Bun.serve({ port: 0, fetch(req) { return new Response(body); }, }); const proc = Bun.spawn({ env: { ...bunEnv, SERVER: `http://${server.hostname}:${server.port}`, }, stderr: "inherit", stdout: "inherit", cmd: [bunExe(), "--smol", join(import.meta.dir, "fetch-leak-test-fixture-2.js")], }); const exitCode = await proc.exited; server.stop(true); expect(exitCode).toBe(0); }); }); -tests Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/websocket/upgrade.md (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2023-10-17Add JSC.WeakGravatar Jarred Sumner 2-0/+293
2023-10-15more microtasksGravatar Jarred Sumner 1-11/+5
2023-10-15It's starting to workGravatar Jarred Sumner 6-49/+89
2023-10-15Things can happenGravatar Jarred Sumner 9-53/+150
2023-10-15FurtherGravatar Jarred Sumner 1-20/+30
2023-10-15The startup message sends successfullyGravatar Jarred Sumner 4-96/+130
2023-10-15it compiledGravatar Jarred Sumner 2-158/+238
2023-10-15okay we are starting to try itGravatar Jarred Sumner 4-9/+43
2023-10-15Okay most of the code is writtenGravatar Jarred Sumner 3-29/+398
2023-10-14MoreGravatar Jarred Sumner 7-66/+504
2023-10-14wipGravatar Jarred Sumner 8-16/+1194
2023-10-14More progressGravatar Jarred Sumner 4-36/+405
2023-10-13wipGravatar Jarred Sumner 8-48/+308