diff options
author | Mark Ladyshau <47859603+mrkldshv@users.noreply.github.com> | 2022-06-14 20:51:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-14 20:51:49 +0200 |
commit | d4f609d8e7b8a9dd3a3a9d289936a4eb706c037f (patch) | |
tree | ec7bd2c2cd0168dde2709ef86b3081f7d1965157 | |
parent | e1d488ab886ac19716e2b51c3ce1cebef163db8f (diff) |
feat(test): update test summary report (#14629)
53 files changed, 84 insertions, 69 deletions
diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs index c63ee6e5a..981923359 100644 --- a/cli/tests/integration/test_tests.rs +++ b/cli/tests/integration/test_tests.rs @@ -17,7 +17,7 @@ fn no_color() { assert!(out.contains("success ... ok")); assert!(out.contains("fail ... FAILED")); assert!(out.contains("ignored ... ignored")); - assert!(out.contains("test result: FAILED. 1 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out")); + assert!(out.contains("FAILED | 1 passed | 1 failed | 1 ignored")); } itest!(overloads { diff --git a/cli/tests/integration/watcher_tests.rs b/cli/tests/integration/watcher_tests.rs index cff0e8f44..046dcec07 100644 --- a/cli/tests/integration/watcher_tests.rs +++ b/cli/tests/integration/watcher_tests.rs @@ -815,10 +815,7 @@ fn test_watch() { let (mut stdout_lines, mut stderr_lines) = child_lines(&mut child); assert_eq!(stdout_lines.next().unwrap(), ""); - assert_contains!( - stdout_lines.next().unwrap(), - "0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out" - ); + assert_contains!(stdout_lines.next().unwrap(), "0 passed | 0 failed"); wait_contains("Test finished", &mut stderr_lines); let foo_file = t.path().join("foo.js"); @@ -912,7 +909,7 @@ fn test_watch() { assert_contains!(stderr_lines.next().unwrap(), "Restarting"); assert_contains!(stdout_lines.next().unwrap(), "running 1 test"); assert_contains!(stdout_lines.next().unwrap(), "FAILED"); - wait_contains("test result", &mut stdout_lines); + wait_for(|m| m.contains("FAILED"), &mut stdout_lines); stdout_lines.next(); wait_contains("Test finished", &mut stderr_lines); @@ -959,10 +956,7 @@ fn test_watch_doc() { let (mut stdout_lines, mut stderr_lines) = child_lines(&mut child); assert_eq!(stdout_lines.next().unwrap(), ""); - assert_contains!( - stdout_lines.next().unwrap(), - "0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out" - ); + assert_contains!(stdout_lines.next().unwrap(), "0 passed | 0 failed"); wait_contains("Test finished", &mut stderr_lines); let foo_file = t.path().join("foo.ts"); diff --git a/cli/tests/testdata/compat/test_runner/cjs.out b/cli/tests/testdata/compat/test_runner/cjs.out index 84f506642..2e1e29e61 100644 --- a/cli/tests/testdata/compat/test_runner/cjs.out +++ b/cli/tests/testdata/compat/test_runner/cjs.out @@ -22,6 +22,6 @@ error: AssertionError: Values are not strictly equal: Failed assertion => ./compat/test_runner/cjs.js:[WILDCARD] -test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 1 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/compat/test_runner/esm.out b/cli/tests/testdata/compat/test_runner/esm.out index 9184228b7..e69573da1 100644 --- a/cli/tests/testdata/compat/test_runner/esm.out +++ b/cli/tests/testdata/compat/test_runner/esm.out @@ -22,6 +22,6 @@ error: AssertionError: Values are not strictly equal: Failed assertion => ./compat/test_runner/esm.mjs:[WILDCARD] -test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 1 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/compat/test_runner/top_level_assertion_cjs.out b/cli/tests/testdata/compat/test_runner/top_level_assertion_cjs.out index 007d654ab..f74853cfd 100644 --- a/cli/tests/testdata/compat/test_runner/top_level_assertion_cjs.out +++ b/cli/tests/testdata/compat/test_runner/top_level_assertion_cjs.out @@ -1,4 +1,4 @@ running 0 tests from [WILDCARD] -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/compat/test_runner/top_level_assertion_esm.out b/cli/tests/testdata/compat/test_runner/top_level_assertion_esm.out index 007d654ab..f74853cfd 100644 --- a/cli/tests/testdata/compat/test_runner/top_level_assertion_esm.out +++ b/cli/tests/testdata/compat/test_runner/top_level_assertion_esm.out @@ -1,4 +1,4 @@ running 0 tests from [WILDCARD] -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out b/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out index be3c1b93b..e1777d98a 100644 --- a/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out +++ b/cli/tests/testdata/compat/test_runner/top_level_fail_cjs.out @@ -22,6 +22,6 @@ It most likely originated from a dangling promise, event/timeout handler or top- ./compat/test_runner/top_level_fail_cjs.js (uncaught error) -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out b/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out index b4b313208..d34de2c21 100644 --- a/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out +++ b/cli/tests/testdata/compat/test_runner/top_level_fail_esm.out @@ -22,6 +22,6 @@ It most likely originated from a dangling promise, event/timeout handler or top- ./compat/test_runner/top_level_fail_esm.mjs (uncaught error) -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/aggregate_error.out b/cli/tests/testdata/test/aggregate_error.out index c21416e01..e70bf5963 100644 --- a/cli/tests/testdata/test/aggregate_error.out +++ b/cli/tests/testdata/test/aggregate_error.out @@ -17,6 +17,6 @@ error: AggregateError aggregate => ./test/aggregate_error.ts:[WILDCARD] -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/allow_all.out b/cli/tests/testdata/test/allow_all.out index 42719ee62..8b783b823 100644 --- a/cli/tests/testdata/test/allow_all.out +++ b/cli/tests/testdata/test/allow_all.out @@ -15,4 +15,4 @@ ffi true ... ok [WILDCARD] hrtime false ... ok [WILDCARD] hrtime true ... ok [WILDCARD] -test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out [WILDCARD] +ok | 14 passed | 0 failed [WILDCARD] diff --git a/cli/tests/testdata/test/allow_none.out b/cli/tests/testdata/test/allow_none.out index f52eadb82..aaa467344 100644 --- a/cli/tests/testdata/test/allow_none.out +++ b/cli/tests/testdata/test/allow_none.out @@ -48,4 +48,4 @@ run => ./test/allow_none.ts:[WILDCARD] ffi => ./test/allow_none.ts:[WILDCARD] hrtime => ./test/allow_none.ts:[WILDCARD] -test result: FAILED. 0 passed; 7 failed; 0 ignored; 0 measured; 0 filtered out [WILDCARD] +FAILED | 0 passed | 7 failed [WILDCARD] diff --git a/cli/tests/testdata/test/check_local_by_default.out b/cli/tests/testdata/test/check_local_by_default.out index 29c1bbc42..4564f99b8 100644 --- a/cli/tests/testdata/test/check_local_by_default.out +++ b/cli/tests/testdata/test/check_local_by_default.out @@ -1,4 +1,4 @@ running 0 tests from ./test/check_local_by_default.ts -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/clear_timeout.out b/cli/tests/testdata/test/clear_timeout.out index c9aa1aaed..4d3ff8862 100644 --- a/cli/tests/testdata/test/clear_timeout.out +++ b/cli/tests/testdata/test/clear_timeout.out @@ -4,5 +4,5 @@ test 1 ... ok ([WILDCARD]) test 2 ... ok ([WILDCARD]) test 3 ... ok ([WILDCARD]) -test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 3 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/collect.out b/cli/tests/testdata/test/collect.out index 2c672e118..9f3495298 100644 --- a/cli/tests/testdata/test/collect.out +++ b/cli/tests/testdata/test/collect.out @@ -1,5 +1,5 @@ Check [WILDCARD]/test/collect/test.ts running 0 tests from ./test/collect/test.ts -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/doc_only.out b/cli/tests/testdata/test/doc_only.out index be38e4a63..a6cb89df0 100644 --- a/cli/tests/testdata/test/doc_only.out +++ b/cli/tests/testdata/test/doc_only.out @@ -1,5 +1,5 @@ Check [WILDCARD]/test/doc_only/mod.ts$2-5.ts running 0 tests from ./test/doc_only/mod.ts -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/exit_sanitizer.out b/cli/tests/testdata/test/exit_sanitizer.out index 9ed9a77f9..4910501fa 100644 --- a/cli/tests/testdata/test/exit_sanitizer.out +++ b/cli/tests/testdata/test/exit_sanitizer.out @@ -33,6 +33,6 @@ exit(0) => ./test/exit_sanitizer.ts:[WILDCARD] exit(1) => ./test/exit_sanitizer.ts:[WILDCARD] exit(2) => ./test/exit_sanitizer.ts:[WILDCARD] -test result: FAILED. 0 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 3 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/fail.out b/cli/tests/testdata/test/fail.out index 3b33506e9..3fcf6fd8f 100644 --- a/cli/tests/testdata/test/fail.out +++ b/cli/tests/testdata/test/fail.out @@ -86,6 +86,6 @@ test 7 => ./test/fail.ts:22:6 test 8 => ./test/fail.ts:25:6 test 9 => ./test/fail.ts:28:6 -test result: FAILED. 0 passed; 10 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 10 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/fail_fast.out b/cli/tests/testdata/test/fail_fast.out index cbfc6ee44..c0cf2df01 100644 --- a/cli/tests/testdata/test/fail_fast.out +++ b/cli/tests/testdata/test/fail_fast.out @@ -14,6 +14,6 @@ error: Error test 1 => ./test/fail_fast.ts:[WILDCARD] -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/fail_fast_with_val.out b/cli/tests/testdata/test/fail_fast_with_val.out index 62138830b..a844b05c1 100644 --- a/cli/tests/testdata/test/fail_fast_with_val.out +++ b/cli/tests/testdata/test/fail_fast_with_val.out @@ -20,4 +20,4 @@ error: Error test 1 => ./test/fail_fast_with_val.ts:[WILDCARD] test 2 => ./test/fail_fast_with_val.ts:[WILDCARD] -test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 2 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/file_protocol.out b/cli/tests/testdata/test/file_protocol.out index 252165950..3f9c73f7e 100644 --- a/cli/tests/testdata/test/file_protocol.out +++ b/cli/tests/testdata/test/file_protocol.out @@ -2,5 +2,5 @@ Check file://[WILDCARD]/test/file_protocol.ts running 1 test from ./test/file_protocol.ts test 0 ... ok ([WILDCARD]) -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 1 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/filter.out b/cli/tests/testdata/test/filter.out index 57788a051..bc1ff6e01 100644 --- a/cli/tests/testdata/test/filter.out +++ b/cli/tests/testdata/test/filter.out @@ -8,5 +8,5 @@ foo ... ok ([WILDCARD]) running 1 test from ./test/filter/c_test.ts foo ... ok ([WILDCARD]) -test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 6 filtered out ([WILDCARD]) +ok | 3 passed | 0 failed | 6 filtered out ([WILDCARD]) diff --git a/cli/tests/testdata/test/finally_timeout.out b/cli/tests/testdata/test/finally_timeout.out index 593b9059b..26153da06 100644 --- a/cli/tests/testdata/test/finally_timeout.out +++ b/cli/tests/testdata/test/finally_timeout.out @@ -15,6 +15,6 @@ error: Error: fail error => ./test/finally_timeout.ts:[WILDCARD] -test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 1 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/ignore.out b/cli/tests/testdata/test/ignore.out index c6ee1743d..e67406c63 100644 --- a/cli/tests/testdata/test/ignore.out +++ b/cli/tests/testdata/test/ignore.out @@ -11,5 +11,5 @@ test 7 ... ignored ([WILDCARD]) test 8 ... ignored ([WILDCARD]) test 9 ... ignored ([WILDCARD]) -test result: ok. 0 passed; 0 failed; 10 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed | 10 ignored ([WILDCARD]) diff --git a/cli/tests/testdata/test/ignore_permissions.out b/cli/tests/testdata/test/ignore_permissions.out index 7457cf65b..cc2574da9 100644 --- a/cli/tests/testdata/test/ignore_permissions.out +++ b/cli/tests/testdata/test/ignore_permissions.out @@ -2,5 +2,5 @@ Check [WILDCARD]/test/ignore_permissions.ts running 1 test from ./test/ignore_permissions.ts ignore ... ignored ([WILDCARD]) -test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed | 1 ignored ([WILDCARD]) diff --git a/cli/tests/testdata/test/interval.out b/cli/tests/testdata/test/interval.out index 92fd7d570..1d0bc15ac 100644 --- a/cli/tests/testdata/test/interval.out +++ b/cli/tests/testdata/test/interval.out @@ -1,5 +1,5 @@ Check [WILDCARD]/test/interval.ts running 0 tests from ./test/interval.ts -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/load_unload.out b/cli/tests/testdata/test/load_unload.out index ba9a1f5f9..aef7531af 100644 --- a/cli/tests/testdata/test/load_unload.out +++ b/cli/tests/testdata/test/load_unload.out @@ -2,5 +2,5 @@ Check [WILDCARD]/test/load_unload.ts running 1 test from ./test/load_unload.ts test ... ok ([WILDCARD]) -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 1 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/meta.out b/cli/tests/testdata/test/meta.out index 3fefa4265..c7cc95946 100644 --- a/cli/tests/testdata/test/meta.out +++ b/cli/tests/testdata/test/meta.out @@ -3,5 +3,5 @@ import.meta.main: false import.meta.url: [WILDCARD]/test/meta.ts running 0 tests from ./test/meta.ts -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/no_check.out b/cli/tests/testdata/test/no_check.out index 3e1c93535..adef03aee 100644 --- a/cli/tests/testdata/test/no_check.out +++ b/cli/tests/testdata/test/no_check.out @@ -14,6 +14,6 @@ It most likely originated from a dangling promise, event/timeout handler or top- ./test/no_check.ts (uncaught error) -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/no_prompt_by_default.out b/cli/tests/testdata/test/no_prompt_by_default.out index 4995a4269..eaab16ce8 100644 --- a/cli/tests/testdata/test/no_prompt_by_default.out +++ b/cli/tests/testdata/test/no_prompt_by_default.out @@ -11,6 +11,6 @@ error: PermissionDenied: Requires read access to "./some_file.txt", run again wi no prompt => ./test/no_prompt_by_default.ts:[WILDCARD] -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]ms) +FAILED | 0 passed | 1 failed ([WILDCARD]ms) error: Test failed diff --git a/cli/tests/testdata/test/no_prompt_with_denied_perms.out b/cli/tests/testdata/test/no_prompt_with_denied_perms.out index 93e4ae5e8..4d683b2d8 100644 --- a/cli/tests/testdata/test/no_prompt_with_denied_perms.out +++ b/cli/tests/testdata/test/no_prompt_with_denied_perms.out @@ -11,6 +11,6 @@ error: PermissionDenied: Requires read access to "./some_file.txt", run again wi no prompt => ./test/no_prompt_with_denied_perms.ts:[WILDCARD] -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]ms) +FAILED | 0 passed | 1 failed ([WILDCARD]ms) error: Test failed diff --git a/cli/tests/testdata/test/non_error_thrown.out b/cli/tests/testdata/test/non_error_thrown.out index 922129e29..6755f2905 100644 --- a/cli/tests/testdata/test/non_error_thrown.out +++ b/cli/tests/testdata/test/non_error_thrown.out @@ -35,6 +35,6 @@ qux => [WILDCARD]/non_error_thrown.ts:13:6 quux => [WILDCARD]/non_error_thrown.ts:17:6 quuz => [WILDCARD]/non_error_thrown.ts:21:6 -test result: FAILED. 0 passed; 6 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 6 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/only.out b/cli/tests/testdata/test/only.out index eaa71b2d0..bd5ca84e4 100644 --- a/cli/tests/testdata/test/only.out +++ b/cli/tests/testdata/test/only.out @@ -2,6 +2,6 @@ Check [WILDCARD]/test/only.ts running 1 test from ./test/only.ts only ... ok ([WILDCARD]) -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out ([WILDCARD]) +ok | 1 passed | 0 failed | 2 filtered out ([WILDCARD]) error: Test failed because the "only" option was used diff --git a/cli/tests/testdata/test/ops_sanitizer_missing_details.out b/cli/tests/testdata/test/ops_sanitizer_missing_details.out index 5d1eb55df..b277ba74f 100644 --- a/cli/tests/testdata/test/ops_sanitizer_missing_details.out +++ b/cli/tests/testdata/test/ops_sanitizer_missing_details.out @@ -16,6 +16,6 @@ To get more details where ops were leaked, run again with --trace-ops flag. test 1 => ./test/ops_sanitizer_missing_details.ts:[WILDCARD] -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out [WILDCARD] +FAILED | 0 passed | 1 failed [WILDCARD] error: Test failed diff --git a/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.out b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.out index ce30ea1a6..ded6708d1 100644 --- a/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.out +++ b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests.out @@ -46,6 +46,6 @@ error: AssertionError: Test case is leaking async ops. test 1 => ./test/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] test 2 => ./test/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] -test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 2 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests_no_trace.out b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests_no_trace.out index 305f92aba..3f40bb9d0 100644 --- a/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests_no_trace.out +++ b/cli/tests/testdata/test/ops_sanitizer_multiple_timeout_tests_no_trace.out @@ -26,6 +26,6 @@ To get more details where ops were leaked, run again with --trace-ops flag. test 1 => ./test/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] test 2 => ./test/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD] -test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 2 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/ops_sanitizer_nexttick.out b/cli/tests/testdata/test/ops_sanitizer_nexttick.out index 331e55306..a8f2b5779 100644 --- a/cli/tests/testdata/test/ops_sanitizer_nexttick.out +++ b/cli/tests/testdata/test/ops_sanitizer_nexttick.out @@ -3,5 +3,5 @@ running 2 tests from ./test/ops_sanitizer_nexttick.ts test 1 ... ok ([WILDCARD]) test 2 ... ok ([WILDCARD]) -test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 2 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/ops_sanitizer_timeout_failure.out b/cli/tests/testdata/test/ops_sanitizer_timeout_failure.out index a77290d18..a4fbf0008 100644 --- a/cli/tests/testdata/test/ops_sanitizer_timeout_failure.out +++ b/cli/tests/testdata/test/ops_sanitizer_timeout_failure.out @@ -2,5 +2,5 @@ Check [WILDCARD]/testdata/test/ops_sanitizer_timeout_failure.ts running 1 test from ./test/ops_sanitizer_timeout_failure.ts wait ... ok ([WILDCARD]) -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 1 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/ops_sanitizer_unstable.out b/cli/tests/testdata/test/ops_sanitizer_unstable.out index 47ca57865..98e0a26ff 100644 --- a/cli/tests/testdata/test/ops_sanitizer_unstable.out +++ b/cli/tests/testdata/test/ops_sanitizer_unstable.out @@ -20,6 +20,6 @@ error: AssertionError: Test case is leaking async ops. leak interval => ./test/ops_sanitizer_unstable.ts:[WILDCARD] -test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 1 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/overloads.out b/cli/tests/testdata/test/overloads.out index b2bf57fbd..87a3f07cb 100644 --- a/cli/tests/testdata/test/overloads.out +++ b/cli/tests/testdata/test/overloads.out @@ -7,5 +7,5 @@ test3 ... ok ([WILDCARD]) test4 ... ok ([WILDCARD]) test5 ... ignored ([WILDCARD]) -test result: ok. 5 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 5 passed | 0 failed | 1 ignored ([WILDCARD]) diff --git a/cli/tests/testdata/test/pass.out b/cli/tests/testdata/test/pass.out index 2329bd284..f9c4f1ba4 100644 --- a/cli/tests/testdata/test/pass.out +++ b/cli/tests/testdata/test/pass.out @@ -19,5 +19,5 @@ console.error ----- output end ----- test 9 ... ok ([WILDCARD]) -test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 10 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/quiet.out b/cli/tests/testdata/test/quiet.out index 3ef8f5251..83dbe6ba9 100644 --- a/cli/tests/testdata/test/quiet.out +++ b/cli/tests/testdata/test/quiet.out @@ -4,5 +4,5 @@ console.error ... ok ([WILDCARD]) console.info ... ok ([WILDCARD]) console.warn ... ok ([WILDCARD]) -test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 4 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/resource_sanitizer.out b/cli/tests/testdata/test/resource_sanitizer.out index f5d097783..695a45a4c 100644 --- a/cli/tests/testdata/test/resource_sanitizer.out +++ b/cli/tests/testdata/test/resource_sanitizer.out @@ -16,6 +16,6 @@ error: AssertionError: Test case is leaking 2 resources: leak => ./test/resource_sanitizer.ts:[WILDCARD] -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/shuffle.out b/cli/tests/testdata/test/shuffle.out index 81c5a46e5..28bd97d5c 100644 --- a/cli/tests/testdata/test/shuffle.out +++ b/cli/tests/testdata/test/shuffle.out @@ -35,5 +35,5 @@ test 4 ... ok ([WILDCARD]) test 1 ... ok ([WILDCARD]) test 0 ... ok ([WILDCARD]) -test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 30 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/steps/failing_steps.out b/cli/tests/testdata/test/steps/failing_steps.out index d42736977..7c1d62488 100644 --- a/cli/tests/testdata/test/steps/failing_steps.out +++ b/cli/tests/testdata/test/steps/failing_steps.out @@ -57,6 +57,6 @@ nested failure => ./test/steps/failing_steps.ts:[WILDCARD] multiple test step failures => ./test/steps/failing_steps.ts:[WILDCARD] failing step in failing test => ./test/steps/failing_steps.ts:[WILDCARD] -test result: FAILED. 0 passed (1 step); 3 failed (5 steps); 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed (1 step) | 3 failed (5 steps) ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/steps/ignored_steps.out b/cli/tests/testdata/test/steps/ignored_steps.out index b89f4451f..f80b6573f 100644 --- a/cli/tests/testdata/test/steps/ignored_steps.out +++ b/cli/tests/testdata/test/steps/ignored_steps.out @@ -5,4 +5,4 @@ ignored step ... step 2 ... ok ([WILDCARD]) ok ([WILDCARD]) -test result: ok. 1 passed (1 step); 0 failed; 0 ignored (1 step); 0 measured; 0 filtered out [WILDCARD] +ok | 1 passed (1 step) | 0 failed | 0 ignored (1 step) [WILDCARD] diff --git a/cli/tests/testdata/test/steps/invalid_usage.out b/cli/tests/testdata/test/steps/invalid_usage.out index c3e47c37e..395356e2d 100644 --- a/cli/tests/testdata/test/steps/invalid_usage.out +++ b/cli/tests/testdata/test/steps/invalid_usage.out @@ -109,6 +109,6 @@ parallel steps when first has sanitizer => ./test/steps/invalid_usage.ts:[WILDCA parallel steps when second has sanitizer => ./test/steps/invalid_usage.ts:[WILDCARD] parallel steps where only inner tests have sanitizers => ./test/steps/invalid_usage.ts:[WILDCARD] -test result: FAILED. 0 passed (4 steps); 7 failed (10 steps); 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed (4 steps) | 7 failed (10 steps) ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/steps/passing_steps.out b/cli/tests/testdata/test/steps/passing_steps.out index e4ecbba42..bb1611910 100644 --- a/cli/tests/testdata/test/steps/passing_steps.out +++ b/cli/tests/testdata/test/steps/passing_steps.out @@ -35,4 +35,4 @@ steps buffered then streaming reporting ... step 2 ... ok ([WILDCARD]) ok ([WILDCARD]) -test result: ok. 5 passed (18 steps); 0 failed; 0 ignored; 0 measured; 0 filtered out [WILDCARD] +ok | 5 passed (18 steps) | 0 failed [WILDCARD] diff --git a/cli/tests/testdata/test/text.out b/cli/tests/testdata/test/text.out index f4c3d29e0..354dc24b5 100644 --- a/cli/tests/testdata/test/text.out +++ b/cli/tests/testdata/test/text.out @@ -1,4 +1,4 @@ running 0 tests from ./test/text.md -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed ([WILDCARD]) diff --git a/cli/tests/testdata/test/uncaught_errors.out b/cli/tests/testdata/test/uncaught_errors.out index 1ff709d43..3c4dc2f9b 100644 --- a/cli/tests/testdata/test/uncaught_errors.out +++ b/cli/tests/testdata/test/uncaught_errors.out @@ -53,6 +53,6 @@ bar 2 => ./test/uncaught_errors_2.ts:3:6 bar 3 => ./test/uncaught_errors_2.ts:6:6 ./test/uncaught_errors_3.ts (uncaught error) -test result: FAILED. 2 passed; 5 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 2 passed | 5 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/unhandled_rejection.out b/cli/tests/testdata/test/unhandled_rejection.out index 50b0ad6ab..bc8387929 100644 --- a/cli/tests/testdata/test/unhandled_rejection.out +++ b/cli/tests/testdata/test/unhandled_rejection.out @@ -17,6 +17,6 @@ It most likely originated from a dangling promise, event/timeout handler or top- ./test/unhandled_rejection.ts (uncaught error) -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +FAILED | 0 passed | 1 failed ([WILDCARD]) error: Test failed diff --git a/cli/tests/testdata/test/unresolved_promise.out b/cli/tests/testdata/test/unresolved_promise.out index 60f9e3d24..92eb16bed 100644 --- a/cli/tests/testdata/test/unresolved_promise.out +++ b/cli/tests/testdata/test/unresolved_promise.out @@ -1,5 +1,5 @@ Check [WILDCARD]/test/unresolved_promise.ts -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | 0 passed | 0 failed ([WILDCARD]) error: Module evaluation is still pending but there are no pending ops or dynamic imports. This situation is often caused by unresolved promises. diff --git a/cli/tests/testdata/workers/test.ts.out b/cli/tests/testdata/workers/test.ts.out index f56dbda8a..62c132b60 100644 --- a/cli/tests/testdata/workers/test.ts.out +++ b/cli/tests/testdata/workers/test.ts.out @@ -1,3 +1,3 @@ [WILDCARD] -test result: ok. [WILDCARD] passed; 0 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]) +ok | [WILDCARD] passed | 0 failed ([WILDCARD]) diff --git a/cli/tools/test.rs b/cli/tools/test.rs index 7dcc23dd1..6d1530f3e 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -617,19 +617,40 @@ impl TestReporter for PrettyTestReporter { format!(" ({} steps)", count) } }; - println!( - "\ntest result: {}. {} passed{}; {} failed{}; {} ignored{}; {} measured; {} filtered out {}\n", - status, + + let mut summary_result = String::new(); + + summary_result.push_str(&format!( + "{} passed{} | {} failed{}", summary.passed, get_steps_text(summary.passed_steps), summary.failed, get_steps_text(summary.failed_steps + summary.pending_steps), - summary.ignored, - get_steps_text(summary.ignored_steps), - summary.measured, - summary.filtered_out, - colors::gray( - format!("({})", display::human_elapsed(elapsed.as_millis()))), + )); + + let ignored_steps = get_steps_text(summary.ignored_steps); + if summary.ignored > 0 || !ignored_steps.is_empty() { + summary_result + .push_str(&format!(" | {} ignored{}", summary.ignored, ignored_steps)) + }; + + if summary.measured > 0 { + summary_result.push_str(&format!(" | {} measured", summary.measured,)) + }; + + if summary.filtered_out > 0 { + summary_result + .push_str(&format!(" | {} filtered out", summary.filtered_out,)) + }; + + println!( + "\n{} | {} {}\n", + status, + summary_result, + colors::gray(format!( + "({})", + display::human_elapsed(elapsed.as_millis()) + )), ); self.in_new_line = true; } |