summaryrefslogtreecommitdiff
path: root/cli/tests/unit/ref_unref_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/ref_unref_test.ts')
-rw-r--r--cli/tests/unit/ref_unref_test.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/unit/ref_unref_test.ts b/cli/tests/unit/ref_unref_test.ts
new file mode 100644
index 000000000..da6e95efc
--- /dev/null
+++ b/cli/tests/unit/ref_unref_test.ts
@@ -0,0 +1,10 @@
+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);
+});