summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/unit_node/timers_test.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/cli/tests/unit_node/timers_test.ts b/cli/tests/unit_node/timers_test.ts
index 8676edb76..d110b44e4 100644
--- a/cli/tests/unit_node/timers_test.ts
+++ b/cli/tests/unit_node/timers_test.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { assert } from "../../../test_util/std/testing/asserts.ts";
+import { assert, fail } from "../../../test_util/std/testing/asserts.ts";
import * as timers from "node:timers";
import * as timersPromises from "node:timers/promises";
@@ -50,3 +50,13 @@ Deno.test("[node/timers/promises setTimeout]", () => {
assert(p instanceof Promise);
return p;
});
+
+// Regression test for https://github.com/denoland/deno/issues/17981
+Deno.test("[node/timers refresh cancelled timer]", () => {
+ const { setTimeout, clearTimeout } = timers;
+ const p = setTimeout(() => {
+ fail();
+ }, 1);
+ clearTimeout(p);
+ p.refresh();
+});