1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-19 04:16:00 -05:00
denoland-deno/tests/unit/ref_unref_test.ts
2024-12-31 19:12:39 +00:00

12 lines
485 B
TypeScript

// Copyright 2018-2025 the Deno authors. MIT license.
import { assertNotEquals, execCode } from "./test_util.ts";
Deno.test("[unrefOpPromise] unref'ing invalid ops does not have effects", async () => {
const [statusCode, _] = await execCode(`
Deno[Deno.internal].core.unrefOpPromise(new Promise(r => null));
setTimeout(() => { throw new Error() }, 10)
`);
// Invalid unrefOpPromise call doesn't affect exit condition of event loop
assertNotEquals(statusCode, 0);
});