summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/059_fs_relative_path_perm.ts.out2
-rw-r--r--cli/tests/073_worker_error.ts.out2
-rw-r--r--cli/tests/074_worker_nested_error.ts.out2
-rw-r--r--cli/tests/fmt/expected_fmt_check_tests_dir.out2
-rw-r--r--cli/tests/inline_js_source_map.ts6
-rw-r--r--cli/tests/inline_js_source_map_2.js4
-rw-r--r--cli/tests/inline_js_source_map_2.js.out4
-rw-r--r--cli/tests/inline_js_source_map_2.ts6
-rw-r--r--cli/tests/inline_js_source_map_2_with_inline_contents.js4
-rw-r--r--cli/tests/inline_js_source_map_2_with_inline_contents.js.out4
-rw-r--r--cli/tests/inline_js_source_map_with_contents_from_graph.js4
-rw-r--r--cli/tests/inline_js_source_map_with_contents_from_graph.js.out4
-rw-r--r--cli/tests/integration_tests.rs35
13 files changed, 78 insertions, 1 deletions
diff --git a/cli/tests/059_fs_relative_path_perm.ts.out b/cli/tests/059_fs_relative_path_perm.ts.out
index 83df41903..92d6b5966 100644
--- a/cli/tests/059_fs_relative_path_perm.ts.out
+++ b/cli/tests/059_fs_relative_path_perm.ts.out
@@ -1,2 +1,4 @@
[WILDCARD]error: Uncaught PermissionDenied: read access to "non-existent", run again with the --allow-read flag
+ throw new ErrorClass(res.err.message);
+ ^
at [WILDCARD]
diff --git a/cli/tests/073_worker_error.ts.out b/cli/tests/073_worker_error.ts.out
index 244e56417..e46478979 100644
--- a/cli/tests/073_worker_error.ts.out
+++ b/cli/tests/073_worker_error.ts.out
@@ -2,4 +2,6 @@
at foo ([WILDCARD])
at [WILDCARD]
error: Uncaught (in promise) Error: Unhandled error event reached main worker.
+ throw new Error("Unhandled error event reached main worker.");
+ ^
at Worker.#poll ([WILDCARD])
diff --git a/cli/tests/074_worker_nested_error.ts.out b/cli/tests/074_worker_nested_error.ts.out
index 244e56417..e46478979 100644
--- a/cli/tests/074_worker_nested_error.ts.out
+++ b/cli/tests/074_worker_nested_error.ts.out
@@ -2,4 +2,6 @@
at foo ([WILDCARD])
at [WILDCARD]
error: Uncaught (in promise) Error: Unhandled error event reached main worker.
+ throw new Error("Unhandled error event reached main worker.");
+ ^
at Worker.#poll ([WILDCARD])
diff --git a/cli/tests/fmt/expected_fmt_check_tests_dir.out b/cli/tests/fmt/expected_fmt_check_tests_dir.out
index e78b42db3..00d7cb3fa 100644
--- a/cli/tests/fmt/expected_fmt_check_tests_dir.out
+++ b/cli/tests/fmt/expected_fmt_check_tests_dir.out
@@ -1,2 +1,2 @@
[WILDCARD]
-error: Found 2 not formatted files in [WILDCARD] files
+error: Found 5 not formatted files in [WILDCARD] files
diff --git a/cli/tests/inline_js_source_map.ts b/cli/tests/inline_js_source_map.ts
new file mode 100644
index 000000000..5ae7c226a
--- /dev/null
+++ b/cli/tests/inline_js_source_map.ts
@@ -0,0 +1,6 @@
+1 + 1;
+interface Test {
+ hello: string;
+}
+
+// throw new Error("Hello world!" as string);
diff --git a/cli/tests/inline_js_source_map_2.js b/cli/tests/inline_js_source_map_2.js
new file mode 100644
index 000000000..199ff7bb0
--- /dev/null
+++ b/cli/tests/inline_js_source_map_2.js
@@ -0,0 +1,4 @@
+"use strict";
+1 + 1;
+throw new Error("Hello world!");
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L2NsaS90ZXN0cy9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file
diff --git a/cli/tests/inline_js_source_map_2.js.out b/cli/tests/inline_js_source_map_2.js.out
new file mode 100644
index 000000000..008eb0657
--- /dev/null
+++ b/cli/tests/inline_js_source_map_2.js.out
@@ -0,0 +1,4 @@
+error: Uncaught Error: Hello world!
+throw new Error("Hello world!");
+ ^
+ at http://localhost:4545/cli/tests/inline_js_source_map_2.ts:6:7
diff --git a/cli/tests/inline_js_source_map_2.ts b/cli/tests/inline_js_source_map_2.ts
new file mode 100644
index 000000000..fa50586e6
--- /dev/null
+++ b/cli/tests/inline_js_source_map_2.ts
@@ -0,0 +1,6 @@
+1 + 1;
+interface Test {
+ hello: string;
+}
+
+throw new Error("Hello world!" as unknown as string);
diff --git a/cli/tests/inline_js_source_map_2_with_inline_contents.js b/cli/tests/inline_js_source_map_2_with_inline_contents.js
new file mode 100644
index 000000000..a225b3975
--- /dev/null
+++ b/cli/tests/inline_js_source_map_2_with_inline_contents.js
@@ -0,0 +1,4 @@
+"use strict";
+
+throw new Error("Hello world!");
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L2NsaS90ZXN0cy9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIjErMTtcbmludGVyZmFjZSBUZXN0IHtcbiAgaGVsbG86IHN0cmluZztcbn1cblxudGhyb3cgbmV3IEVycm9yKFwiSGVsbG8gd29ybGQhXCIgYXMgdW5rbm93biBhcyBzdHJpbmcpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file
diff --git a/cli/tests/inline_js_source_map_2_with_inline_contents.js.out b/cli/tests/inline_js_source_map_2_with_inline_contents.js.out
new file mode 100644
index 000000000..c123de41e
--- /dev/null
+++ b/cli/tests/inline_js_source_map_2_with_inline_contents.js.out
@@ -0,0 +1,4 @@
+error: Uncaught Error: Hello world!
+throw new Error("Hello world!" as unknown as string);
+ ^
+ at http://localhost:4545/cli/tests/inline_js_source_map_2.ts:6:7
diff --git a/cli/tests/inline_js_source_map_with_contents_from_graph.js b/cli/tests/inline_js_source_map_with_contents_from_graph.js
new file mode 100644
index 000000000..5324e0ed2
--- /dev/null
+++ b/cli/tests/inline_js_source_map_with_contents_from_graph.js
@@ -0,0 +1,4 @@
+"use strict";
+import "http://localhost:4545/cli/tests/inline_js_source_map.ts";
+throw new Error("Hello world!");
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L2NsaS90ZXN0cy9pbmxpbmVfanNfc291cmNlX21hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsQ0FBQyxHQUFDLENBQUMsQ0FBQztBQUtKLE1BQU0sSUFBSSxLQUFLLENBQUMsY0FBK0IsQ0FBQyxDQUFDIn0= \ No newline at end of file
diff --git a/cli/tests/inline_js_source_map_with_contents_from_graph.js.out b/cli/tests/inline_js_source_map_with_contents_from_graph.js.out
new file mode 100644
index 000000000..a0ba9fe98
--- /dev/null
+++ b/cli/tests/inline_js_source_map_with_contents_from_graph.js.out
@@ -0,0 +1,4 @@
+error: Uncaught Error: Hello world!
+// throw new Error("Hello world!" as string);
+ ^
+ at http://localhost:4545/cli/tests/inline_js_source_map.ts:6:7
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index ef5015301..f4081a7ea 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -3446,6 +3446,41 @@ itest!(local_sources_not_cached_in_memory {
output: "no_mem_cache.js.out",
});
+// This test checks that inline source map data is used. It uses a hand crafted
+// source map that maps to a file that exists, but is not loaded into the module
+// graph (inline_js_source_map_2.ts) (because there are no direct dependencies).
+// Source line is not remapped because no inline source contents are included in
+// the sourcemap and the file is not present in the dependency graph.
+itest!(inline_js_source_map_2 {
+ args: "run --quiet inline_js_source_map_2.js",
+ output: "inline_js_source_map_2.js.out",
+ exit_code: 1,
+});
+
+// This test checks that inline source map data is used. It uses a hand crafted
+// source map that maps to a file that exists, but is not loaded into the module
+// graph (inline_js_source_map_2.ts) (because there are no direct dependencies).
+// Source line remapped using th inline source contents that are included in the
+// inline source map.
+itest!(inline_js_source_map_2_with_inline_contents {
+ args: "run --quiet inline_js_source_map_2_with_inline_contents.js",
+ output: "inline_js_source_map_2_with_inline_contents.js.out",
+ exit_code: 1,
+});
+
+// This test checks that inline source map data is used. It uses a hand crafted
+// source map that maps to a file that exists, and is loaded into the module
+// graph because of a direct import statement (inline_js_source_map.ts). The
+// source map was generated from an earlier version of this file, where the throw
+// was not commented out. The source line is remapped using source contents that
+// from the module graph.
+itest!(inline_js_source_map_with_contents_from_graph {
+ args: "run --quiet inline_js_source_map_with_contents_from_graph.js",
+ output: "inline_js_source_map_with_contents_from_graph.js.out",
+ exit_code: 1,
+ http_server: true,
+});
+
#[test]
fn cafile_env_fetch() {
use deno_core::url::Url;