diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-11-10 06:50:33 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 06:50:33 +1100 |
commit | b402b75c1de0497dd39a563cb7f5135d4ceb7fa7 (patch) | |
tree | 2ba59394cc292bd22726fd8927617a1bc9ea1617 /cli/tests | |
parent | 5375bf2e3f1251a911663e2c588a75b7203bc47a (diff) |
fix(cli): allow setting of importsNotUsedAsValues in Deno.compile() (#8306)
Fixes #6663
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/compiler_api_test.ts | 21 |
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")); + }, +}); |