From 23281be33a378ca548f0a407f642331f20b00a43 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Mon, 1 Feb 2021 17:02:02 +0900 Subject: fix(cli): fix handling of non-normalized specifier (#9357) --- cli/tests/compiler_api_test.ts | 14 ++++++++++++++ 1 file changed, 14 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 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"); + }, +}); -- cgit v1.2.3