diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/test_tests.rs | 5 | ||||
-rw-r--r-- | cli/tests/testdata/test/replace_timers.js | 7 | ||||
-rw-r--r-- | cli/tests/testdata/test/replace_timers.js.out | 7 |
3 files changed, 19 insertions, 0 deletions
diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index 57acb723e..bcf050adf 100644 --- a/cli/tests/integration/test_tests.rs +++ b/cli/tests/integration/test_tests.rs @@ -529,6 +529,11 @@ itest!(test_no_lock { output: "lockfile/basic/test.nolock.out", }); +itest!(test_replace_timers { + args: "test test/replace_timers.js", + output: "test/replace_timers.js.out", +}); + #[test] fn test_with_glob_config() { let context = TestContextBuilder::new().cwd("test").build(); diff --git a/cli/tests/testdata/test/replace_timers.js b/cli/tests/testdata/test/replace_timers.js new file mode 100644 index 000000000..692f1d671 --- /dev/null +++ b/cli/tests/testdata/test/replace_timers.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/cli/tests/testdata/test/replace_timers.js.out b/cli/tests/testdata/test/replace_timers.js.out new file mode 100644 index 000000000..81beb5ebe --- /dev/null +++ b/cli/tests/testdata/test/replace_timers.js.out @@ -0,0 +1,7 @@ +running 1 test from ./test/replace_timers.js +foo ... + bar ... ok ([WILDCARD]) +foo ... ok ([WILDCARD]) + +ok | 1 passed (1 step) | 0 failed ([WILDCARD]) + |