diff --git a/test/fetch.test.ts b/test/fetch.test.ts index a919c43..c88a476 100644 --- a/test/fetch.test.ts +++ b/test/fetch.test.ts @@ -11,15 +11,19 @@ const sample = new Uint8Array([ Deno.test({ name: "Fetch: Get", async fn(){ + const ac = new AbortController(); + 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); - await server.shutdown(); + ac.abort(); + await server.finished; } }); \ No newline at end of file