summaryrefslogtreecommitdiff
path: root/cli/tests/compiler_api_test.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-07-28 21:08:13 +0200
committerGitHub <noreply@github.com>2020-07-28 15:08:13 -0400
commit315efbc0e86d9d848efa4b889aefbc665508598a (patch)
treeb9f4b941a8bed34bae1766d2dd3b3045eb523f68 /cli/tests/compiler_api_test.ts
parentb7942bf0f6f151e172db9b1e08cf4436e8365e8b (diff)
fix: downcast from SwcDiagnosticBuffer to OpError (#6909)
Diffstat (limited to 'cli/tests/compiler_api_test.ts')
-rw-r--r--cli/tests/compiler_api_test.ts28
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");
+ }
+ }`,
+ });
+ });
+ },
+});