summaryrefslogtreecommitdiff
path: root/cli/tests/compiler_api_test.ts
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2021-02-01 17:02:02 +0900
committerGitHub <noreply@github.com>2021-02-01 17:02:02 +0900
commit23281be33a378ca548f0a407f642331f20b00a43 (patch)
tree9d4d96d79e496c9e270fa91b2ed525bcdc6cdb33 /cli/tests/compiler_api_test.ts
parent534531e4dd4133ff22f775b385ba488ec747cead (diff)
fix(cli): fix handling of non-normalized specifier (#9357)
Diffstat (limited to 'cli/tests/compiler_api_test.ts')
-rw-r--r--cli/tests/compiler_api_test.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/cli/tests/compiler_api_test.ts b/cli/tests/compiler_api_test.ts
index 99c7af961..4aac027cb 100644
--- a/cli/tests/compiler_api_test.ts
+++ b/cli/tests/compiler_api_test.ts
@@ -305,3 +305,17 @@ Deno.test({
});
},
});
+
+Deno.test({
+ name: "Deno.emit() - non-normalized specifier and source can compile",
+ async fn() {
+ const specifier = "https://example.com/foo//bar.ts";
+ const { files } = await Deno.emit(specifier, {
+ sources: {
+ [specifier]: `export let foo: string = "foo";`,
+ },
+ });
+ assertEquals(files[`${specifier}.js`], 'export let foo = "foo";\n');
+ assert(typeof files[`${specifier}.js.map`] === "string");
+ },
+});