From fc162162a155faf088f2b1a3343597c66d59d98c Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Fri, 29 Jan 2021 10:33:58 +0900 Subject: fix(cli): fix panic in Deno.emit (#9302) --- cli/tests/compiler_api_test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cli/tests/compiler_api_test.ts') 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";`, + }, + }); + }); + }, +}); -- cgit v1.2.3