deno
3a76e62a - feat(test): add timeout option to Deno.test() (#33815)

Commit
158 days ago
feat(test): add timeout option to Deno.test() (#33815) Closes #11133. Closes #13146. ## Summary Adds a per-test `timeout` option to `Deno.test()` that fails a test if it runs longer than the configured deadline. Both asynchronous hangs and synchronous hot loops are caught: ```ts Deno.test({ name: "fetches within deadline", timeout: 5000, async fn() { await fetch("https://example.test"); }, }); ``` If `timeout` is unset or `0`, the test runs without a deadline.
Author
Parents
Loading