summaryrefslogtreecommitdiff
path: root/cli/tests/unit/ref_unref_test.ts
blob: 7ce72a1708a49a7e2eb31352d686bfb221a78305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assertNotEquals, execCode } from "./test_util.ts";

Deno.test("[unrefOp] unref'ing invalid ops does not have effects", async () => {
  const [statusCode, _] = await execCode(`
    Deno.core.unrefOp(-1);
    setTimeout(() => { throw new Error() }, 10)
  `);
  // Invalid unrefOp call doesn't affect exit condition of event loop
  assertNotEquals(statusCode, 0);
});