From e0b9c745c15720914f14996bf357d5b375e2dbd8 Mon Sep 17 00:00:00 2001 From: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:38:40 +0300 Subject: chore: deprecate test itests (#25512) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR is part of #22907 --------- Signed-off-by: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> Co-authored-by: Bartek IwaƄczuk --- tests/specs/test/test_replace_timers/__test__.jsonc | 5 +++++ tests/specs/test/test_replace_timers/main.js | 7 +++++++ tests/specs/test/test_replace_timers/main.out | 7 +++++++ 3 files changed, 19 insertions(+) create mode 100644 tests/specs/test/test_replace_timers/__test__.jsonc create mode 100644 tests/specs/test/test_replace_timers/main.js create mode 100644 tests/specs/test/test_replace_timers/main.out (limited to 'tests/specs/test/test_replace_timers') 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]) + -- cgit v1.2.3