diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/mod.rs | 3 | ||||
-rw-r--r-- | cli/tests/integration/test_tests.rs | 6 | ||||
-rw-r--r-- | cli/tests/testdata/test/steps/output_within.out | 31 | ||||
-rw-r--r-- | cli/tests/testdata/test/steps/output_within.ts | 15 |
4 files changed, 55 insertions, 0 deletions
diff --git a/cli/tests/integration/mod.rs b/cli/tests/integration/mod.rs index 2578989c7..ffd7e3596 100644 --- a/cli/tests/integration/mod.rs +++ b/cli/tests/integration/mod.rs @@ -753,7 +753,10 @@ fn websocket_server_multi_field_connection_header() { assert!(child.wait().unwrap().success()); } +// TODO(bartlomieju): this should use `deno run`, not `deno test`; but the +// test hangs then. https://github.com/denoland/deno/issues/14283 #[test] +#[ignore] fn websocket_server_idletimeout() { let script = util::testdata_path().join("websocket_server_idletimeout.ts"); let root_ca = util::testdata_path().join("tls/RootCA.pem"); diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index 307f0f1fe..bf0ceb038 100644 --- a/cli/tests/integration/test_tests.rs +++ b/cli/tests/integration/test_tests.rs @@ -281,6 +281,12 @@ itest!(steps_invalid_usage { output: "test/steps/invalid_usage.out", }); +itest!(steps_output_within { + args: "test test/steps/output_within.ts", + exit_code: 0, + output: "test/steps/output_within.out", +}); + itest!(no_prompt_by_default { args: "test test/no_prompt_by_default.ts", exit_code: 1, diff --git a/cli/tests/testdata/test/steps/output_within.out b/cli/tests/testdata/test/steps/output_within.out new file mode 100644 index 000000000..b8610d903 --- /dev/null +++ b/cli/tests/testdata/test/steps/output_within.out @@ -0,0 +1,31 @@ +[WILDCARD] +running 1 test from test/steps/output_within.ts +description ... +------- output ------- +1 +----- output end ----- + step 1 ... +------- output ------- +2 +----- output end ----- + inner 1 ... +------- output ------- +3 +----- output end ----- + ok ([WILDCARD]ms) + inner 2 ... +------- output ------- +4 +----- output end ----- + ok ([WILDCARD]ms) + +------- output ------- +5 +----- output end ----- + ok ([WILDCARD]ms) + +------- output ------- +6 +----- output end ----- +ok ([WILDCARD]ms) +[WILDCARD] diff --git a/cli/tests/testdata/test/steps/output_within.ts b/cli/tests/testdata/test/steps/output_within.ts new file mode 100644 index 000000000..d3438a8ad --- /dev/null +++ b/cli/tests/testdata/test/steps/output_within.ts @@ -0,0 +1,15 @@ +Deno.test("description", async (t) => { + // the output is not great, but this is an extreme scenario + console.log(1); + await t.step("step 1", async (t) => { + console.log(2); + await t.step("inner 1", () => { + console.log(3); + }); + await t.step("inner 2", () => { + console.log(4); + }); + console.log(5); + }); + console.log(6); +}); |