summaryrefslogtreecommitdiff
path: root/cli/tests/integration/compile_tests.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2022-04-27 00:06:10 +0100
committerGitHub <noreply@github.com>2022-04-27 01:06:10 +0200
commit9853c96cc4686a6cd1ffa1e9081c012b8df72ff7 (patch)
treec631ebfc363c06c468367be7ecd5b98110dde3a0 /cli/tests/integration/compile_tests.rs
parent58eab0e2b37fd8c3c83445196d4bde419740373d (diff)
refactor: Remove PrettyJsError and js_error_create_fn (#14378)
This commit: - removes "fmt_errors::PrettyJsError" in favor of "format_js_error" fn - removes "deno_core::JsError::create" and "deno_core::RuntimeOptions::js_error_create_fn" - adds new option to "deno_runtime::ops::worker_host::init"
Diffstat (limited to 'cli/tests/integration/compile_tests.rs')
-rw-r--r--cli/tests/integration/compile_tests.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/cli/tests/integration/compile_tests.rs b/cli/tests/integration/compile_tests.rs
index 3d2a17ecc..4e45adc07 100644
--- a/cli/tests/integration/compile_tests.rs
+++ b/cli/tests/integration/compile_tests.rs
@@ -105,9 +105,12 @@ fn standalone_error() {
assert!(!output.status.success());
assert_eq!(output.stdout, b"");
let stderr = String::from_utf8(output.stderr).unwrap();
+ let stderr = util::strip_ansi_codes(&stderr).to_string();
// On Windows, we cannot assert the file path (because '\').
// Instead we just check for relevant output.
- assert!(stderr.contains("error: Error: boom!\n at boom (file://"));
+ assert!(stderr.contains("error: Uncaught Error: boom!"));
+ assert!(stderr.contains("throw new Error(\"boom!\");"));
+ assert!(stderr.contains("\n at boom (file://"));
assert!(stderr.contains("standalone_error.ts:2:11"));
assert!(stderr.contains("at foo (file://"));
assert!(stderr.contains("standalone_error.ts:5:5"));
@@ -148,9 +151,12 @@ fn standalone_error_module_with_imports() {
println!("{:#?}", &output);
assert_eq!(output.stdout, b"hello\n");
let stderr = String::from_utf8(output.stderr).unwrap();
+ let stderr = util::strip_ansi_codes(&stderr).to_string();
// On Windows, we cannot assert the file path (because '\').
// Instead we just check for relevant output.
- assert!(stderr.contains("error: Error: boom!\n at file://"));
+ assert!(stderr.contains("error: Uncaught Error: boom!"));
+ assert!(stderr.contains("throw new Error(\"boom!\");"));
+ assert!(stderr.contains("\n at file://"));
assert!(stderr.contains("standalone_error_module_with_imports_2.ts:2:7"));
}