fix(cli): fix handling of non-normalized specifier (#9357)

This commit is contained in:
Yoshiya Hinosawa 2021-02-01 17:02:02 +09:00 committed by GitHub
parent 534531e4dd
commit 23281be33a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 7 deletions

View file

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