You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importkyfrom"https://esm.sh/[email protected]";Deno.test("throws HTTPError : no memory leak",async()=>{// this test throws the expected error and does not leak memory// HTTPError: Request failed with status code 404 Not Found: GET https://github.com/not_foundawaitky.get("https://github.com/not_found").text();});Deno.test("memory leak when catching error",async()=>{// this test report a memory leak when catching the error// the memory leak is fixed if we rethrow something// the test fails with :// Leaks detected:// - A fetch response body was created during the test, but not consumed during the test. Consume or close the response body `ReadableStream`, e.g `await resp.text()` or `await resp.body.cancel()`.try{awaitky.get("https://github.com/not_found").text();}catch(error){console.error("I handle the error here");// fix the leak : rethrow the error// throw error;}});
Reproduction with deno :
ky.deno.test.ts
:deno test --allow-net ky.deno.test.ts
Same issue with bun : denoland/deno#25546 (comment)
The text was updated successfully, but these errors were encountered: