summaryrefslogtreecommitdiff
path: root/cli/lsp/testing/execution.rs
diff options
context:
space:
mode:
authorHajime-san <41257923+Hajime-san@users.noreply.github.com>2024-08-20 10:27:36 +0900
committerGitHub <noreply@github.com>2024-08-20 01:27:36 +0000
commit19bcb40059f6ba730b6d05d8edf005c6b40f6ff8 (patch)
treee7c60d8957a8609199a3dad24455518cc36fac32 /cli/lsp/testing/execution.rs
parent4f49f703c10afcde7155baac2b494fa6670c0115 (diff)
feat(cli/tools): add a subcommand `--hide-stacktraces` for test (#24095)
Diffstat (limited to 'cli/lsp/testing/execution.rs')
-rw-r--r--cli/lsp/testing/execution.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/cli/lsp/testing/execution.rs b/cli/lsp/testing/execution.rs
index 96f22a9b0..14196baa3 100644
--- a/cli/lsp/testing/execution.rs
+++ b/cli/lsp/testing/execution.rs
@@ -15,6 +15,7 @@ use crate::lsp::logging::lsp_log;
use crate::tools::test;
use crate::tools::test::create_test_event_channel;
use crate::tools::test::FailFastTracker;
+use crate::tools::test::TestFailureFormatOptions;
use deno_core::anyhow::anyhow;
use deno_core::error::AnyError;
@@ -655,7 +656,10 @@ impl LspTestReporter {
let desc = self.tests.get(&desc.id).unwrap();
self.progress(lsp_custom::TestRunProgressMessage::Failed {
test: desc.as_test_identifier(&self.tests),
- messages: as_test_messages(failure.to_string(), false),
+ messages: as_test_messages(
+ failure.format(&TestFailureFormatOptions::default()),
+ false,
+ ),
duration: Some(elapsed as u32),
})
}
@@ -675,7 +679,7 @@ impl LspTestReporter {
let err_string = format!(
"Uncaught error from {}: {}\nThis error was not caught from a test and caused the test runner to fail on the referenced module.\nIt most likely originated from a dangling promise, event/timeout handler or top-level code.",
origin,
- test::fmt::format_test_error(js_error)
+ test::fmt::format_test_error(js_error, &TestFailureFormatOptions::default())
);
let messages = as_test_messages(err_string, false);
for desc in self.tests.values().filter(|d| d.origin() == origin) {
@@ -751,7 +755,10 @@ impl LspTestReporter {
test::TestStepResult::Failed(failure) => {
self.progress(lsp_custom::TestRunProgressMessage::Failed {
test: desc.as_test_identifier(&self.tests),
- messages: as_test_messages(failure.to_string(), false),
+ messages: as_test_messages(
+ failure.format(&TestFailureFormatOptions::default()),
+ false,
+ ),
duration: Some(elapsed as u32),
})
}