summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/compiler_api_test.ts
diff options
context:
space:
mode:
authorSimon Lecoq <22963968+lowlighter@users.noreply.github.com>2022-02-25 01:26:13 +0100
committerGitHub <noreply@github.com>2022-02-25 11:26:13 +1100
commitc59152e4000393ad122855c26198c1d942497c00 (patch)
tree87ca62ef6ace4e950107e0da9a8deae38f53cd93 /cli/tests/testdata/compiler_api_test.ts
parentcd04b6852faae594980598a9cf93ef1ac187f244 (diff)
feat(cli): support data url (#13667)
Closes #11141
Diffstat (limited to 'cli/tests/testdata/compiler_api_test.ts')
-rw-r--r--cli/tests/testdata/compiler_api_test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/cli/tests/testdata/compiler_api_test.ts b/cli/tests/testdata/compiler_api_test.ts
index 168d70ce6..81f049ac1 100644
--- a/cli/tests/testdata/compiler_api_test.ts
+++ b/cli/tests/testdata/compiler_api_test.ts
@@ -46,6 +46,22 @@ Deno.test({
});
Deno.test({
+ name: "Deno.emit() - data url",
+ async fn() {
+ const data =
+ "data:application/javascript;base64,Y29uc29sZS5sb2coImhlbGxvIHdvcmxkIik7";
+ const { diagnostics, files, ignoredOptions, stats } = await Deno.emit(data);
+ assertEquals(diagnostics.length, 0);
+ assert(!ignoredOptions);
+ assertEquals(stats.length, 0);
+ const keys = Object.keys(files);
+ assertEquals(keys.length, 1);
+ assertEquals(keys[0], data);
+ assertStringIncludes(files[keys[0]], 'console.log("hello world");');
+ },
+});
+
+Deno.test({
name: "Deno.emit() - compiler options effects emit",
async fn() {
const { diagnostics, files, ignoredOptions, stats } = await Deno.emit(