fix(cli): fix panic in Deno.emit (#9302)

This commit is contained in:
Yoshiya Hinosawa 2021-01-29 10:33:58 +09:00 committed by GitHub
parent 6ecc86cf2a
commit fc162162a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 3 deletions

View file

@ -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";`,
},
});
});
},
});