summaryrefslogtreecommitdiff
path: root/cli/tests/compiler_api_test.ts
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2021-01-29 10:33:58 +0900
committerGitHub <noreply@github.com>2021-01-29 10:33:58 +0900
commitfc162162a155faf088f2b1a3343597c66d59d98c (patch)
treebe6831e9c52152753147fb4376815ab42325720f /cli/tests/compiler_api_test.ts
parent6ecc86cf2ae4bb0aac6f3d0e954382a69176b387 (diff)
fix(cli): fix panic in Deno.emit (#9302)
Diffstat (limited to 'cli/tests/compiler_api_test.ts')
-rw-r--r--cli/tests/compiler_api_test.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/tests/compiler_api_test.ts b/cli/tests/compiler_api_test.ts
index 17c02b0e5..99c7af961 100644
--- a/cli/tests/compiler_api_test.ts
+++ b/cli/tests/compiler_api_test.ts
@@ -292,3 +292,16 @@ Deno.test({
assert(diagnostics[0].messageText.includes("This import is never used"));
},
});
+
+Deno.test({
+ name: "Deno.emit() - Unknown media type does not panic",
+ async fn() {
+ await assertThrowsAsync(async () => {
+ await Deno.emit("https://example.com/foo", {
+ sources: {
+ "https://example.com/foo": `let foo: string = "foo";`,
+ },
+ });
+ });
+ },
+});