Skip to content

Commit

Permalink
fix leaking resource.
Browse files Browse the repository at this point in the history
  • Loading branch information
dojyorin committed Nov 22, 2023
1 parent 0aa44a9 commit 06c3de4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test/fetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ const sample = new Uint8Array([
Deno.test({
name: "Fetch: Get",
async fn(){
const ac = new AbortController();

Deno.serve({
const server = Deno.serve({
hostname: "127.0.0.1",
port: 62000,
signal: ac.signal
}, () => new Response(sample));

const result = await fetchExtend("http://127.0.0.1:62000", "byte");

assertEquals(result, sample);

ac.abort();
await server.shutdown();
}
});

0 comments on commit 06c3de4

Please sign in to comment.