summaryrefslogtreecommitdiff
path: root/cli/tests/compiler_api_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/compiler_api_test.ts')
-rw-r--r--cli/tests/compiler_api_test.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/tests/compiler_api_test.ts b/cli/tests/compiler_api_test.ts
index a236a3f3f..4535ad6ed 100644
--- a/cli/tests/compiler_api_test.ts
+++ b/cli/tests/compiler_api_test.ts
@@ -199,3 +199,24 @@ Deno.test({
});
},
});
+
+Deno.test({
+ name: `Deno.compile() - Allows setting of "importsNotUsedAsValues"`,
+ async fn() {
+ const [diagnostics] = await Deno.compile("/a.ts", {
+ "/a.ts": `import { B } from "./b.ts";
+ const b: B = { b: "b" };
+ `,
+ "/b.ts": `export interface B {
+ b: string;
+ };
+ `,
+ }, {
+ importsNotUsedAsValues: "error",
+ });
+ assert(diagnostics);
+ assertEquals(diagnostics.length, 1);
+ assert(diagnostics[0].messageText);
+ assert(diagnostics[0].messageText.includes("This import is never used"));
+ },
+});