summaryrefslogtreecommitdiff
path: root/tests/unit/ref_unref_test.ts
blob: 6f5bcf0a7793bacc8f5b8db184d49e1794a33d6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Copyright 2018-2024 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);
});