diff options
Diffstat (limited to 'cli/tests/compiler_api_test.ts')
-rw-r--r-- | cli/tests/compiler_api_test.ts | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/cli/tests/compiler_api_test.ts b/cli/tests/compiler_api_test.ts index 7ff9ebc2b..311dae8fd 100644 --- a/cli/tests/compiler_api_test.ts +++ b/cli/tests/compiler_api_test.ts @@ -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"); + } + }`, + }); + }); + }, +}); |