diff options
Diffstat (limited to 'tests/specs/test/test_replace_timers')
| -rw-r--r-- | tests/specs/test/test_replace_timers/__test__.jsonc | 5 | ||||
| -rw-r--r-- | tests/specs/test/test_replace_timers/main.js | 7 | ||||
| -rw-r--r-- | tests/specs/test/test_replace_timers/main.out | 7 |
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/specs/test/test_replace_timers/__test__.jsonc b/tests/specs/test/test_replace_timers/__test__.jsonc new file mode 100644 index 000000000..bc9124318 --- /dev/null +++ b/tests/specs/test/test_replace_timers/__test__.jsonc @@ -0,0 +1,5 @@ +// Regression test for https://github.com/denoland/deno/issues/23041 +{ + "args": "test main.js", + "output": "main.out" +} diff --git a/tests/specs/test/test_replace_timers/main.js b/tests/specs/test/test_replace_timers/main.js new file mode 100644 index 000000000..692f1d671 --- /dev/null +++ b/tests/specs/test/test_replace_timers/main.js @@ -0,0 +1,7 @@ +Deno.test("foo", async (t) => { + globalThis.setTimeout = () => {}; + globalThis.clearTimeout = () => {}; + globalThis.setInterval = () => {}; + globalThis.clearInterval = () => {}; + await t.step("bar", () => {}); +}); diff --git a/tests/specs/test/test_replace_timers/main.out b/tests/specs/test/test_replace_timers/main.out new file mode 100644 index 000000000..cfac49943 --- /dev/null +++ b/tests/specs/test/test_replace_timers/main.out @@ -0,0 +1,7 @@ +running 1 test from [WILDCARD]/main.js +foo ... + bar ... ok ([WILDCARD]) +foo ... ok ([WILDCARD]) + +ok | 1 passed (1 step) | 0 failed ([WILDCARD]) + |
