mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
fix(cli): allow setting of importsNotUsedAsValues in Deno.compile() (#8306)
Fixes #6663
This commit is contained in:
parent
5375bf2e3f
commit
b402b75c1d
2 changed files with 35 additions and 0 deletions
|
@ -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"));
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue