1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-15 03:48:02 -05:00
denoland-deno/cli/tests/unit/ref_unref_test.ts

13 lines
506 B
TypeScript
Raw Normal View History

// Copyright 2018-2023 the Deno authors. All rights reserved. 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);
});