From 9ffc7edc23444be8bdcc1befd3709b309780e3d1 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Thu, 16 Dec 2021 10:45:41 +0000 Subject: refactor(cli): use GraphData for check and emit (#12960) --- cli/tests/testdata/compiler_api_test.ts | 2 +- cli/tests/testdata/error_027_bundle_with_bare_import.ts.out | 1 + cli/tests/testdata/error_type_definitions.ts.out | 1 + cli/tests/testdata/jsx/deno-jsx-error.jsonc | 6 ++++++ cli/tests/testdata/jsx_import_source_error.out | 2 ++ cli/tests/testdata/reference_types_error.js | 2 ++ cli/tests/testdata/reference_types_error.js.out | 2 ++ 7 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 cli/tests/testdata/jsx/deno-jsx-error.jsonc create mode 100644 cli/tests/testdata/jsx_import_source_error.out create mode 100644 cli/tests/testdata/reference_types_error.js create mode 100644 cli/tests/testdata/reference_types_error.js.out (limited to 'cli/tests/testdata') diff --git a/cli/tests/testdata/compiler_api_test.ts b/cli/tests/testdata/compiler_api_test.ts index b9755c29a..f51b5647c 100644 --- a/cli/tests/testdata/compiler_api_test.ts +++ b/cli/tests/testdata/compiler_api_test.ts @@ -307,7 +307,7 @@ Deno.test({ ); assertEquals(diagnostics.length, 0); assert(!ignoredOptions); - assertEquals(stats.length, 12); + assertEquals(stats.length, 0); assertEquals( Object.keys(files).sort(), ["deno:///bundle.js.map", "deno:///bundle.js"].sort(), diff --git a/cli/tests/testdata/error_027_bundle_with_bare_import.ts.out b/cli/tests/testdata/error_027_bundle_with_bare_import.ts.out index 12f38c1c5..e2edd118a 100644 --- a/cli/tests/testdata/error_027_bundle_with_bare_import.ts.out +++ b/cli/tests/testdata/error_027_bundle_with_bare_import.ts.out @@ -1 +1,2 @@ [WILDCARD]error: Relative import path "foo" not prefixed with / or ./ or ../ + at file:///[WILDCARD]/error_027_bundle_with_bare_import.ts:[WILDCARD] diff --git a/cli/tests/testdata/error_type_definitions.ts.out b/cli/tests/testdata/error_type_definitions.ts.out index a0a536f78..5e1d73ca4 100644 --- a/cli/tests/testdata/error_type_definitions.ts.out +++ b/cli/tests/testdata/error_type_definitions.ts.out @@ -1 +1,2 @@ [WILDCARD]error: Relative import path "baz" not prefixed with / or ./ or ../ + at [WILDCARD]/type_definitions/bar.d.ts:[WILDCARD] diff --git a/cli/tests/testdata/jsx/deno-jsx-error.jsonc b/cli/tests/testdata/jsx/deno-jsx-error.jsonc new file mode 100644 index 000000000..37cb4dd91 --- /dev/null +++ b/cli/tests/testdata/jsx/deno-jsx-error.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "./nonexistent" + } +} diff --git a/cli/tests/testdata/jsx_import_source_error.out b/cli/tests/testdata/jsx_import_source_error.out new file mode 100644 index 000000000..b9758a99e --- /dev/null +++ b/cli/tests/testdata/jsx_import_source_error.out @@ -0,0 +1,2 @@ +error: Cannot load module "file:///[WILDCARD]/nonexistent/jsx-runtime". + at file:///[WILDCARD]/deno-jsx-error.jsonc:1:1 diff --git a/cli/tests/testdata/reference_types_error.js b/cli/tests/testdata/reference_types_error.js new file mode 100644 index 000000000..68b6c2136 --- /dev/null +++ b/cli/tests/testdata/reference_types_error.js @@ -0,0 +1,2 @@ +/// +export const a = 1; diff --git a/cli/tests/testdata/reference_types_error.js.out b/cli/tests/testdata/reference_types_error.js.out new file mode 100644 index 000000000..89b450520 --- /dev/null +++ b/cli/tests/testdata/reference_types_error.js.out @@ -0,0 +1,2 @@ +error: Cannot load module "file:///[WILDCARD]/nonexistent.d.ts". + at file:///[WILDCARD]/reference_types_error.js:1:23 -- cgit v1.2.3