summaryrefslogtreecommitdiff
path: root/cli/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp')
-rw-r--r--cli/lsp/testing/execution.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/cli/lsp/testing/execution.rs b/cli/lsp/testing/execution.rs
index bc780a475..b305b1650 100644
--- a/cli/lsp/testing/execution.rs
+++ b/cli/lsp/testing/execution.rs
@@ -8,6 +8,7 @@ use crate::checksum;
use crate::create_main_worker;
use crate::emit;
use crate::flags;
+use crate::fmt_errors::PrettyJsError;
use crate::located_script_name;
use crate::lsp::client::Client;
use crate::lsp::client::TestingNotification;
@@ -797,10 +798,14 @@ impl test::TestReporter for LspTestReporter {
test: desc.into(),
})
}
- test::TestResult::Failed(message) => {
+ test::TestResult::Failed(js_error) => {
+ let err_string = PrettyJsError::create(*js_error.clone())
+ .to_string()
+ .trim_start_matches("Uncaught ")
+ .to_string();
self.progress(lsp_custom::TestRunProgressMessage::Failed {
test: desc.into(),
- messages: as_test_messages(message, false),
+ messages: as_test_messages(err_string, false),
duration: Some(elapsed as u32),
})
}
@@ -839,9 +844,13 @@ impl test::TestReporter for LspTestReporter {
test: desc.into(),
})
}
- test::TestStepResult::Failed(message) => {
- let messages = if let Some(message) = message {
- as_test_messages(message, false)
+ test::TestStepResult::Failed(js_error) => {
+ let messages = if let Some(js_error) = js_error {
+ let err_string = PrettyJsError::create(*js_error.clone())
+ .to_string()
+ .trim_start_matches("Uncaught ")
+ .to_string();
+ as_test_messages(err_string, false)
} else {
vec![]
};