Skip to content

Commit

Permalink
test: fix webhook async leak
Browse files Browse the repository at this point in the history
  • Loading branch information
shevernitskiy committed Nov 19, 2023
1 parent 023e591 commit 679f29e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/webhook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ Deno.test("webhook should work properly", async () => {
);
});

const serve_close = new AbortController();

Deno.serve({
signal: serve_close.signal,
const server = Deno.serve({
port: 4545,
}, amo.webhookHandler());

Expand All @@ -72,8 +69,8 @@ Deno.test("webhook should work properly", async () => {
body: JSON.stringify(test_task),
});

await server.shutdown();

assertEquals(res.status, 200);
assertEquals(await res.text(), "OK");

serve_close.abort();
});

0 comments on commit 679f29e

Please sign in to comment.