mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
fix: downcast from SwcDiagnosticBuffer to OpError (#6909)
This commit is contained in:
parent
b7942bf0f6
commit
315efbc0e8
5 changed files with 50 additions and 5 deletions
|
@ -1,5 +1,9 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
import { assert, assertEquals } from "../../std/testing/asserts.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
assertThrowsAsync,
|
||||
} from "../../std/testing/asserts.ts";
|
||||
|
||||
Deno.test({
|
||||
name: "Deno.compile() - sources provided",
|
||||
|
@ -33,7 +37,7 @@ Deno.test({
|
|||
});
|
||||
|
||||
Deno.test({
|
||||
name: "Deno.compile() - compiler options effects imit",
|
||||
name: "Deno.compile() - compiler options effects emit",
|
||||
async fn() {
|
||||
const [diagnostics, actual] = await Deno.compile(
|
||||
"/foo.ts",
|
||||
|
@ -199,3 +203,23 @@ Deno.test({
|
|||
assert(diagnostics.length === 1);
|
||||
},
|
||||
});
|
||||
|
||||
// See https://github.com/denoland/deno/issues/6908
|
||||
Deno.test({
|
||||
name: "Deno.compile() - SWC diagnostics",
|
||||
async fn() {
|
||||
await assertThrowsAsync(async () => {
|
||||
await Deno.compile("main.js", {
|
||||
"main.js": `
|
||||
export class Foo {
|
||||
constructor() {
|
||||
console.log("foo");
|
||||
}
|
||||
export get() {
|
||||
console.log("bar");
|
||||
}
|
||||
}`,
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue