From f52031ecdf4520e6d404553691da193356e58691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 18 Apr 2022 15:22:23 +0200 Subject: 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 --- cli/lsp/testing/execution.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'cli/lsp') 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![] -- cgit v1.2.3