diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-07-15 01:47:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-14 19:47:47 +0200 |
commit | 844910e44fc9433e5ac4ba03ade72292a32326e8 (patch) | |
tree | b8fcba4598b5bb789e3d896db7cd16574d4da197 | |
parent | 5b771e7e83b32402f06873e684efb2381971e0f6 (diff) |
test(cli): ensure clear timeout doesn't trigger sanitizers (#11396)
-rw-r--r-- | cli/tests/integration/test_tests.rs | 6 | ||||
-rw-r--r-- | cli/tests/test/clear_timeout.out | 8 | ||||
-rw-r--r-- | cli/tests/test/clear_timeout.ts | 5 |
3 files changed, 19 insertions, 0 deletions
diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index c029b154d..64ad29e22 100644 --- a/cli/tests/integration/test_tests.rs +++ b/cli/tests/integration/test_tests.rs @@ -97,6 +97,12 @@ itest!(exit_sanitizer { exit_code: 1, }); +itest!(clear_timeout { + args: "test test/clear_timeout.ts", + exit_code: 0, + output: "test/clear_timeout.out", +}); + itest!(finally_timeout { args: "test test/finally_timeout.ts", exit_code: 1, diff --git a/cli/tests/test/clear_timeout.out b/cli/tests/test/clear_timeout.out new file mode 100644 index 000000000..c9f459dbe --- /dev/null +++ b/cli/tests/test/clear_timeout.out @@ -0,0 +1,8 @@ +Check [WILDCARD]/test/clear_timeout.ts +running 3 tests from [WILDCARD]/test/clear_timeout.ts +test test 1 ... ok ([WILDCARD]) +test test 2 ... ok ([WILDCARD]) +test test 3 ... ok ([WILDCARD]) + +test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) + diff --git a/cli/tests/test/clear_timeout.ts b/cli/tests/test/clear_timeout.ts new file mode 100644 index 000000000..00056e853 --- /dev/null +++ b/cli/tests/test/clear_timeout.ts @@ -0,0 +1,5 @@ +clearTimeout(setTimeout(() => {}, 1000)); + +Deno.test("test 1", () => {}); +Deno.test("test 2", () => {}); +Deno.test("test 3", () => {}); |