diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-04-18 15:22:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-18 15:22:23 +0200 |
commit | f52031ecdf4520e6d404553691da193356e58691 (patch) | |
tree | bdb928a550a77abc9a40180f985e8b0bbb0869cf /cli/lsp/testing | |
parent | 7919dc902d3664bb8600be884ec775f44fd37389 (diff) |
feat(test): skip internal stack frames for errors (#14302)
This commit changes "deno test" to filter out stack frames if it is beneficial to the user.
This is the case when there are stack frames coming from "internal" code
below frames coming from user code.
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
Diffstat (limited to 'cli/lsp/testing')
-rw-r--r-- | cli/lsp/testing/execution.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/cli/lsp/testing/execution.rs b/cli/lsp/testing/execution.rs index b305b1650..93f3d9ba3 100644 --- a/cli/lsp/testing/execution.rs +++ b/cli/lsp/testing/execution.rs @@ -8,7 +8,6 @@ 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; @@ -799,10 +798,7 @@ impl test::TestReporter for LspTestReporter { }) } test::TestResult::Failed(js_error) => { - let err_string = PrettyJsError::create(*js_error.clone()) - .to_string() - .trim_start_matches("Uncaught ") - .to_string(); + let err_string = test::format_test_error(js_error); self.progress(lsp_custom::TestRunProgressMessage::Failed { test: desc.into(), messages: as_test_messages(err_string, false), @@ -846,10 +842,7 @@ impl test::TestReporter for LspTestReporter { } 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(); + let err_string = test::format_test_error(js_error); as_test_messages(err_string, false) } else { vec![] |