mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +00:00
Fixes #10761
This commit is contained in:
parent
281c4cd8fc
commit
a5eb2dfc93
4 changed files with 88 additions and 7 deletions
|
|
@ -456,3 +456,49 @@ Deno.test({
|
|||
assert(files["deno:///bundle.js.map"]);
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: `Deno.emit() - graph errors as diagnostics`,
|
||||
ignore: Deno.build.os === "windows",
|
||||
async fn() {
|
||||
const { diagnostics } = await Deno.emit("/a.ts", {
|
||||
sources: {
|
||||
"/a.ts": `import { b } from "./b.ts";
|
||||
console.log(b);`,
|
||||
},
|
||||
});
|
||||
assert(diagnostics);
|
||||
assertEquals(diagnostics, [
|
||||
{
|
||||
category: 1,
|
||||
code: 2305,
|
||||
start: { line: 0, character: 9 },
|
||||
end: { line: 0, character: 10 },
|
||||
messageText:
|
||||
`Module '"deno:///missing_dependency.d.ts"' has no exported member 'b'.`,
|
||||
messageChain: null,
|
||||
source: null,
|
||||
sourceLine: 'import { b } from "./b.ts";',
|
||||
fileName: "file:///a.ts",
|
||||
relatedInformation: null,
|
||||
},
|
||||
{
|
||||
category: 1,
|
||||
code: 900001,
|
||||
start: null,
|
||||
end: null,
|
||||
messageText: "Unable to find specifier in sources: file:///b.ts",
|
||||
messageChain: null,
|
||||
source: null,
|
||||
sourceLine: null,
|
||||
fileName: "file:///b.ts",
|
||||
relatedInformation: null,
|
||||
},
|
||||
]);
|
||||
assert(
|
||||
Deno.formatDiagnostics(diagnostics).includes(
|
||||
"Unable to find specifier in sources: file:///b.ts",
|
||||
),
|
||||
);
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue