diff --git a/tests/integration/check_tests.rs b/tests/integration/check_tests.rs index f30828a6651544..178ac6493f0cb5 100644 --- a/tests/integration/check_tests.rs +++ b/tests/integration/check_tests.rs @@ -4,7 +4,6 @@ use deno_lockfile::NewLockfileOptions; use deno_semver::jsr::JsrDepPackageReq; use test_util as util; use test_util::itest; -use util::env_vars_for_npm_tests; use util::TestContext; use util::TestContextBuilder; @@ -21,104 +20,6 @@ itest!(check_all_local { http_server: true, }); -itest!(module_detection_force { - args: "check --quiet check/module_detection_force/main.ts", - output_str: Some(""), -}); - -// Regression test for https://github.com/denoland/deno/issues/14937. -itest!(declaration_header_file_with_no_exports { - args: "check --quiet check/declaration_header_file_with_no_exports.ts", - output_str: Some(""), -}); - -itest!(check_jsximportsource_importmap_config { - args: "check --quiet --config check/jsximportsource_importmap_config/deno.json check/jsximportsource_importmap_config/main.tsx", - output_str: Some(""), -}); - -itest!(jsx_not_checked { - args: "check check/jsx_not_checked/main.jsx", - output: "check/jsx_not_checked/main.out", - envs: env_vars_for_npm_tests(), - http_server: true, - exit_code: 1, -}); - -itest!(check_npm_install_diagnostics { - args: "check --quiet check/npm_install_diagnostics/main.ts", - output: "check/npm_install_diagnostics/main.out", - envs: vec![("NO_COLOR".to_string(), "1".to_string())], - exit_code: 1, -}); - -itest!(check_static_response_json { - args: "check --quiet check/response_json.ts", - exit_code: 0, -}); - -itest!(check_node_builtin_modules_ts { - args: "check --quiet check/node_builtin_modules/mod.ts", - output: "check/node_builtin_modules/mod.ts.out", - envs: env_vars_for_npm_tests(), - exit_code: 1, - http_server: true, -}); - -itest!(check_node_builtin_modules_js { - args: "check --quiet check/node_builtin_modules/mod.js", - output: "check/node_builtin_modules/mod.js.out", - envs: env_vars_for_npm_tests(), - exit_code: 1, - http_server: true, -}); - -itest!(check_no_error_truncation { - args: "check --quiet check/no_error_truncation/main.ts --config check/no_error_truncation/deno.json", - output: "check/no_error_truncation/main.out", - envs: vec![("NO_COLOR".to_string(), "1".to_string())], - exit_code: 1, -}); - -itest!(check_broadcast_channel { - args: "check --quiet check/broadcast_channel.ts", - exit_code: 0, -}); - -itest!(check_deno_not_found { - args: "check --quiet check/deno_not_found/main.ts", - output: "check/deno_not_found/main.out", - exit_code: 1, -}); - -itest!(check_with_exclude_option_by_dir { - args: - "check --quiet --config check/exclude_option/deno.exclude_dir.json check/exclude_option/ignored/index.ts", - output_str: Some(""), - exit_code: 0, -}); - -itest!(check_with_exclude_option_by_glob { - args: - "check --quiet --config check/exclude_option/deno.exclude_glob.json check/exclude_option/ignored/index.ts", - output_str: Some(""), - exit_code: 0, -}); - -itest!(check_without_exclude_option { - args: - "check --quiet --config check/exclude_option/deno.json check/exclude_option/ignored/index.ts", - output: "check/exclude_option/exclude_option.ts.error.out", - exit_code: 1, -}); - -itest!(check_imported_files_listed_in_exclude_option { - args: - "check --quiet --config check/exclude_option/deno.exclude_dir.json check/exclude_option/index.ts", - output: "check/exclude_option/exclude_option.ts.error.out", - exit_code: 1, -}); - #[test] fn cache_switching_config_then_no_config() { let context = TestContext::default(); @@ -241,12 +142,6 @@ fn ts_no_recheck_on_redirect() { output.assert_matches_text("Hello\n"); } -itest!(check_dts { - args: "check --quiet check/dts/check_dts.d.ts", - output: "check/dts/check_dts.out", - exit_code: 1, -}); - #[test] fn check_error_in_dep_then_fix() { let test_context = TestContextBuilder::new().use_temp_cwd().build(); diff --git a/tests/specs/check/check_broadcast_channel/__test__.jsonc b/tests/specs/check/check_broadcast_channel/__test__.jsonc new file mode 100644 index 00000000000000..6190781a5ce76b --- /dev/null +++ b/tests/specs/check/check_broadcast_channel/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet broadcast_channel.ts", + "output": "", + "exitCode": 0 +} diff --git a/tests/testdata/check/broadcast_channel.ts b/tests/specs/check/check_broadcast_channel/broadcast_channel.ts similarity index 100% rename from tests/testdata/check/broadcast_channel.ts rename to tests/specs/check/check_broadcast_channel/broadcast_channel.ts diff --git a/tests/specs/check/check_deno_not_found/__test__.jsonc b/tests/specs/check/check_deno_not_found/__test__.jsonc new file mode 100644 index 00000000000000..cbc6552b35832f --- /dev/null +++ b/tests/specs/check/check_deno_not_found/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet deno_not_found/main.ts", + "output": "deno_not_found/main.out", + "exitCode": 1 +} diff --git a/tests/testdata/check/deno_not_found/main.out b/tests/specs/check/check_deno_not_found/deno_not_found/main.out similarity index 82% rename from tests/testdata/check/deno_not_found/main.out rename to tests/specs/check/check_deno_not_found/deno_not_found/main.out index dc4a682c75f45a..2b6f44d1e283da 100644 --- a/tests/testdata/check/deno_not_found/main.out +++ b/tests/specs/check/check_deno_not_found/deno_not_found/main.out @@ -1,4 +1,4 @@ error: TS2304 [ERROR]: Cannot find name 'Deno'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'deno.ns' or add a triple-slash directive to the top of your entrypoint (main file): /// Deno; ~~~~ - at file:///[WILDCARD]/check/deno_not_found/main.ts:4:1 + at file:///[WILDCARD]/deno_not_found/main.ts:4:1 diff --git a/tests/testdata/check/deno_not_found/main.ts b/tests/specs/check/check_deno_not_found/deno_not_found/main.ts similarity index 100% rename from tests/testdata/check/deno_not_found/main.ts rename to tests/specs/check/check_deno_not_found/deno_not_found/main.ts diff --git a/tests/specs/check/check_dts/__test__.jsonc b/tests/specs/check/check_dts/__test__.jsonc new file mode 100644 index 00000000000000..d684e20634fd92 --- /dev/null +++ b/tests/specs/check/check_dts/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet dts/check_dts.d.ts", + "output": "dts/check_dts.out", + "exitCode": 1 +} diff --git a/tests/testdata/check/dts/check_dts.d.ts b/tests/specs/check/check_dts/dts/check_dts.d.ts similarity index 100% rename from tests/testdata/check/dts/check_dts.d.ts rename to tests/specs/check/check_dts/dts/check_dts.d.ts diff --git a/tests/testdata/check/dts/check_dts.out b/tests/specs/check/check_dts/dts/check_dts.out similarity index 100% rename from tests/testdata/check/dts/check_dts.out rename to tests/specs/check/check_dts/dts/check_dts.out diff --git a/tests/specs/check/check_imported_files_listed_in_exclude_option/__test__.jsonc b/tests/specs/check/check_imported_files_listed_in_exclude_option/__test__.jsonc new file mode 100644 index 00000000000000..1fd2d87602c093 --- /dev/null +++ b/tests/specs/check/check_imported_files_listed_in_exclude_option/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet --config exclude_option/deno.exclude_dir.json exclude_option/index.ts", + "output": "exclude_option/exclude_option.ts.error.out", + "exitCode": 1 +} diff --git a/tests/testdata/check/exclude_option/deno.exclude_dir.json b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_dir.json similarity index 100% rename from tests/testdata/check/exclude_option/deno.exclude_dir.json rename to tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_dir.json diff --git a/tests/testdata/check/exclude_option/deno.exclude_glob.json b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_glob.json similarity index 100% rename from tests/testdata/check/exclude_option/deno.exclude_glob.json rename to tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_glob.json diff --git a/tests/testdata/check/exclude_option/deno.json b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.json similarity index 100% rename from tests/testdata/check/exclude_option/deno.json rename to tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.json diff --git a/tests/testdata/check/exclude_option/exclude_option.ts.error.out b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/exclude_option.ts.error.out similarity index 100% rename from tests/testdata/check/exclude_option/exclude_option.ts.error.out rename to tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/exclude_option.ts.error.out diff --git a/tests/testdata/check/exclude_option/ignored/index.ts b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/ignored/index.ts similarity index 100% rename from tests/testdata/check/exclude_option/ignored/index.ts rename to tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/ignored/index.ts diff --git a/tests/testdata/check/exclude_option/index.ts b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/index.ts similarity index 100% rename from tests/testdata/check/exclude_option/index.ts rename to tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/index.ts diff --git a/tests/specs/check/check_jsximportsource_importmap_config/__test__.jsonc b/tests/specs/check/check_jsximportsource_importmap_config/__test__.jsonc new file mode 100644 index 00000000000000..bbe32ca9e71b34 --- /dev/null +++ b/tests/specs/check/check_jsximportsource_importmap_config/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "check --quiet --config jsximportsource_importmap_config/deno.json jsximportsource_importmap_config/main.tsx", + "output": "" +} diff --git a/tests/testdata/check/jsximportsource_importmap_config/deno.json b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/deno.json similarity index 100% rename from tests/testdata/check/jsximportsource_importmap_config/deno.json rename to tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/deno.json diff --git a/tests/testdata/check/jsximportsource_importmap_config/import_map.json b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/import_map.json similarity index 100% rename from tests/testdata/check/jsximportsource_importmap_config/import_map.json rename to tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/import_map.json diff --git a/tests/testdata/check/jsximportsource_importmap_config/jsx_runtime.ts b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/jsx_runtime.ts similarity index 100% rename from tests/testdata/check/jsximportsource_importmap_config/jsx_runtime.ts rename to tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/jsx_runtime.ts diff --git a/tests/testdata/check/jsximportsource_importmap_config/main.tsx b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/main.tsx similarity index 100% rename from tests/testdata/check/jsximportsource_importmap_config/main.tsx rename to tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/main.tsx diff --git a/tests/specs/check/check_no_error_truncation/__test__.jsonc b/tests/specs/check/check_no_error_truncation/__test__.jsonc new file mode 100644 index 00000000000000..15884059c6753c --- /dev/null +++ b/tests/specs/check/check_no_error_truncation/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet no_error_truncation/main.ts --config no_error_truncation/deno.json", + "output": "no_error_truncation/main.out", + "exitCode": 1 +} diff --git a/tests/testdata/check/no_error_truncation/deno.json b/tests/specs/check/check_no_error_truncation/no_error_truncation/deno.json similarity index 100% rename from tests/testdata/check/no_error_truncation/deno.json rename to tests/specs/check/check_no_error_truncation/no_error_truncation/deno.json diff --git a/tests/testdata/check/no_error_truncation/main.out b/tests/specs/check/check_no_error_truncation/no_error_truncation/main.out similarity index 100% rename from tests/testdata/check/no_error_truncation/main.out rename to tests/specs/check/check_no_error_truncation/no_error_truncation/main.out diff --git a/tests/testdata/check/no_error_truncation/main.ts b/tests/specs/check/check_no_error_truncation/no_error_truncation/main.ts similarity index 100% rename from tests/testdata/check/no_error_truncation/main.ts rename to tests/specs/check/check_no_error_truncation/no_error_truncation/main.ts diff --git a/tests/specs/check/check_node_builtin_modules_js/__test__.jsonc b/tests/specs/check/check_node_builtin_modules_js/__test__.jsonc new file mode 100644 index 00000000000000..8f7a2a65a601d0 --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules_js/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet node_builtin_modules/mod.js", + "output": "node_builtin_modules/mod.js.out", + "exitCode": 1 +} diff --git a/tests/testdata/check/node_builtin_modules/mod.js b/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js similarity index 100% rename from tests/testdata/check/node_builtin_modules/mod.js rename to tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js diff --git a/tests/testdata/check/node_builtin_modules/mod.js.out b/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js.out similarity index 100% rename from tests/testdata/check/node_builtin_modules/mod.js.out rename to tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js.out diff --git a/tests/testdata/check/node_builtin_modules/mod.ts b/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts similarity index 100% rename from tests/testdata/check/node_builtin_modules/mod.ts rename to tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts diff --git a/tests/testdata/check/node_builtin_modules/mod.ts.out b/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts.out similarity index 100% rename from tests/testdata/check/node_builtin_modules/mod.ts.out rename to tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts.out diff --git a/tests/specs/check/check_node_builtin_modules_ts/__test__.jsonc b/tests/specs/check/check_node_builtin_modules_ts/__test__.jsonc new file mode 100644 index 00000000000000..736885f2ec7d12 --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules_ts/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet node_builtin_modules/mod.ts", + "output": "node_builtin_modules/mod.ts.out", + "exitCode": 1 +} diff --git a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js new file mode 100644 index 00000000000000..196fb9be98c008 --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js @@ -0,0 +1,3 @@ +// @ts-check +import fs from "node:fs"; +const _data = fs.readFileSync("./node_builtin.js", 123); diff --git a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js.out b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js.out new file mode 100644 index 00000000000000..97786ebaeb2980 --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js.out @@ -0,0 +1,5 @@ +error: TS2769 [ERROR]: No overload matches this call. + [WILDCARD] +const _data = fs.readFileSync("./node_builtin.js", 123); + ~~~ + at file:///[WILDCARD]/node_builtin_modules/mod.js:3:52 diff --git a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts new file mode 100644 index 00000000000000..0e62353fec5237 --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts @@ -0,0 +1,9 @@ +import fs from "node:fs"; +const _data = fs.readFileSync("./node_builtin.js", 123); + +// check node:module specifically because for deno check it should +// resolve to the @types/node package, but at runtime it uses a different +// builtin object than deno_std +import { builtinModules } from "node:module"; +// should error about being string[] +const _testString: number[] = builtinModules; diff --git a/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts.out b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts.out new file mode 100644 index 00000000000000..49b762cff88a4d --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts.out @@ -0,0 +1,13 @@ +error: TS2769 [ERROR]: No overload matches this call. + [WILDCARD] +const _data = fs.readFileSync("./node_builtin.js", 123); + ~~~ + at file:///[WILDCARD]/node_builtin_modules/mod.ts:2:52 + +TS2322 [ERROR]: Type 'string[]' is not assignable to type 'number[]'. + Type 'string' is not assignable to type 'number'. +const _testString: number[] = builtinModules; + ~~~~~~~~~~~ + at file:///[WILDCARD]/node_builtin_modules/mod.ts:9:7 + +Found 2 errors. diff --git a/tests/specs/check/check_npm_install_diagnostics/__test__.jsonc b/tests/specs/check/check_npm_install_diagnostics/__test__.jsonc new file mode 100644 index 00000000000000..18260d362f74bf --- /dev/null +++ b/tests/specs/check/check_npm_install_diagnostics/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet npm_install_diagnostics/main.ts", + "output": "npm_install_diagnostics/main.out", + "exitCode": 1 +} diff --git a/tests/testdata/check/npm_install_diagnostics/main.out b/tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.out similarity index 100% rename from tests/testdata/check/npm_install_diagnostics/main.out rename to tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.out diff --git a/tests/testdata/check/npm_install_diagnostics/main.ts b/tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.ts similarity index 100% rename from tests/testdata/check/npm_install_diagnostics/main.ts rename to tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.ts diff --git a/tests/specs/check/check_static_response_json/__test__.jsonc b/tests/specs/check/check_static_response_json/__test__.jsonc new file mode 100644 index 00000000000000..d286d3aa80582b --- /dev/null +++ b/tests/specs/check/check_static_response_json/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet response_json.ts", + "output": "", + "exitCode": 0 +} diff --git a/tests/testdata/check/response_json.ts b/tests/specs/check/check_static_response_json/response_json.ts similarity index 100% rename from tests/testdata/check/response_json.ts rename to tests/specs/check/check_static_response_json/response_json.ts diff --git a/tests/specs/check/check_with_exclude_option_by_dir/__test__.jsonc b/tests/specs/check/check_with_exclude_option_by_dir/__test__.jsonc new file mode 100644 index 00000000000000..c7fe285da8730d --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_dir/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet --config exclude_option/deno.exclude_dir.json exclude_option/ignored/index.ts", + "output": "", + "exitCode": 0 +} diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_dir.json b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_dir.json new file mode 100644 index 00000000000000..2019f8953d3d50 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_dir.json @@ -0,0 +1,5 @@ +{ + "exclude": [ + "ignored" + ] +} diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_glob.json b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_glob.json new file mode 100644 index 00000000000000..1d203ba089348e --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_glob.json @@ -0,0 +1,5 @@ +{ + "exclude": [ + "ignored/**/*" + ] +} diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.json b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.json new file mode 100644 index 00000000000000..a9eca74ca448a2 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.json @@ -0,0 +1,3 @@ +{ + "exclude": [] +} diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/exclude_option.ts.error.out b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/exclude_option.ts.error.out new file mode 100644 index 00000000000000..abd1c125861e33 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/exclude_option.ts.error.out @@ -0,0 +1,4 @@ +error: TS2304 [ERROR]: Cannot find name 'nothing'. +export { nothing }; + ~~~~~~~ + at [WILDCARD] diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/ignored/index.ts b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/ignored/index.ts new file mode 100644 index 00000000000000..0419cf073c4b29 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/ignored/index.ts @@ -0,0 +1 @@ +export { nothing }; diff --git a/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/index.ts b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/index.ts new file mode 100644 index 00000000000000..8335ca3a2e25a6 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_dir/exclude_option/index.ts @@ -0,0 +1,5 @@ +import { nothing } from "./ignored/index.ts"; + +const foo = 1; + +export { foo, nothing }; diff --git a/tests/specs/check/check_with_exclude_option_by_glob/__test__.jsonc b/tests/specs/check/check_with_exclude_option_by_glob/__test__.jsonc new file mode 100644 index 00000000000000..54700ca3d82bf9 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_glob/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet --config exclude_option/deno.exclude_glob.json exclude_option/ignored/index.ts", + "output": "", + "exitCode": 0 +} diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_dir.json b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_dir.json new file mode 100644 index 00000000000000..2019f8953d3d50 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_dir.json @@ -0,0 +1,5 @@ +{ + "exclude": [ + "ignored" + ] +} diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_glob.json b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_glob.json new file mode 100644 index 00000000000000..1d203ba089348e --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_glob.json @@ -0,0 +1,5 @@ +{ + "exclude": [ + "ignored/**/*" + ] +} diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.json b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.json new file mode 100644 index 00000000000000..a9eca74ca448a2 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.json @@ -0,0 +1,3 @@ +{ + "exclude": [] +} diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/exclude_option.ts.error.out b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/exclude_option.ts.error.out new file mode 100644 index 00000000000000..abd1c125861e33 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/exclude_option.ts.error.out @@ -0,0 +1,4 @@ +error: TS2304 [ERROR]: Cannot find name 'nothing'. +export { nothing }; + ~~~~~~~ + at [WILDCARD] diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/ignored/index.ts b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/ignored/index.ts new file mode 100644 index 00000000000000..0419cf073c4b29 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/ignored/index.ts @@ -0,0 +1 @@ +export { nothing }; diff --git a/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/index.ts b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/index.ts new file mode 100644 index 00000000000000..8335ca3a2e25a6 --- /dev/null +++ b/tests/specs/check/check_with_exclude_option_by_glob/exclude_option/index.ts @@ -0,0 +1,5 @@ +import { nothing } from "./ignored/index.ts"; + +const foo = 1; + +export { foo, nothing }; diff --git a/tests/specs/check/check_without_exclude_option/__test__.jsonc b/tests/specs/check/check_without_exclude_option/__test__.jsonc new file mode 100644 index 00000000000000..801786fa3d24f6 --- /dev/null +++ b/tests/specs/check/check_without_exclude_option/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check --quiet --config exclude_option/deno.json exclude_option/ignored/index.ts", + "output": "exclude_option/exclude_option.ts.error.out", + "exitCode": 1 +} diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_dir.json b/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_dir.json new file mode 100644 index 00000000000000..2019f8953d3d50 --- /dev/null +++ b/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_dir.json @@ -0,0 +1,5 @@ +{ + "exclude": [ + "ignored" + ] +} diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_glob.json b/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_glob.json new file mode 100644 index 00000000000000..1d203ba089348e --- /dev/null +++ b/tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_glob.json @@ -0,0 +1,5 @@ +{ + "exclude": [ + "ignored/**/*" + ] +} diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/deno.json b/tests/specs/check/check_without_exclude_option/exclude_option/deno.json new file mode 100644 index 00000000000000..a9eca74ca448a2 --- /dev/null +++ b/tests/specs/check/check_without_exclude_option/exclude_option/deno.json @@ -0,0 +1,3 @@ +{ + "exclude": [] +} diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/exclude_option.ts.error.out b/tests/specs/check/check_without_exclude_option/exclude_option/exclude_option.ts.error.out new file mode 100644 index 00000000000000..abd1c125861e33 --- /dev/null +++ b/tests/specs/check/check_without_exclude_option/exclude_option/exclude_option.ts.error.out @@ -0,0 +1,4 @@ +error: TS2304 [ERROR]: Cannot find name 'nothing'. +export { nothing }; + ~~~~~~~ + at [WILDCARD] diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/ignored/index.ts b/tests/specs/check/check_without_exclude_option/exclude_option/ignored/index.ts new file mode 100644 index 00000000000000..0419cf073c4b29 --- /dev/null +++ b/tests/specs/check/check_without_exclude_option/exclude_option/ignored/index.ts @@ -0,0 +1 @@ +export { nothing }; diff --git a/tests/specs/check/check_without_exclude_option/exclude_option/index.ts b/tests/specs/check/check_without_exclude_option/exclude_option/index.ts new file mode 100644 index 00000000000000..8335ca3a2e25a6 --- /dev/null +++ b/tests/specs/check/check_without_exclude_option/exclude_option/index.ts @@ -0,0 +1,5 @@ +import { nothing } from "./ignored/index.ts"; + +const foo = 1; + +export { foo, nothing }; diff --git a/tests/specs/check/declaration_header_file_with_no_exports/__test__.jsonc b/tests/specs/check/declaration_header_file_with_no_exports/__test__.jsonc new file mode 100644 index 00000000000000..08fc0a2d6ec748 --- /dev/null +++ b/tests/specs/check/declaration_header_file_with_no_exports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "check --quiet declaration_header_file_with_no_exports.ts", + "output": "" +} diff --git a/tests/testdata/check/declaration_header_file_with_no_exports.ts b/tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports.ts similarity index 100% rename from tests/testdata/check/declaration_header_file_with_no_exports.ts rename to tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports.ts diff --git a/tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports_js.d.ts b/tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports_js.d.ts new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/tests/testdata/check/declaration_header_file_with_no_exports_js.js b/tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports_js.js similarity index 100% rename from tests/testdata/check/declaration_header_file_with_no_exports_js.js rename to tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports_js.js diff --git a/tests/specs/check/jsx_not_checked/__test__.jsonc b/tests/specs/check/jsx_not_checked/__test__.jsonc new file mode 100644 index 00000000000000..dbaa9b2eaf52af --- /dev/null +++ b/tests/specs/check/jsx_not_checked/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "check jsx_not_checked/main.jsx", + "output": "jsx_not_checked/main.out", + "exitCode": 1 +} diff --git a/tests/testdata/check/jsx_not_checked/main.jsx b/tests/specs/check/jsx_not_checked/jsx_not_checked/main.jsx similarity index 100% rename from tests/testdata/check/jsx_not_checked/main.jsx rename to tests/specs/check/jsx_not_checked/jsx_not_checked/main.jsx diff --git a/tests/testdata/check/jsx_not_checked/main.out b/tests/specs/check/jsx_not_checked/jsx_not_checked/main.out similarity index 100% rename from tests/testdata/check/jsx_not_checked/main.out rename to tests/specs/check/jsx_not_checked/jsx_not_checked/main.out diff --git a/tests/testdata/check/jsx_not_checked/other.ts b/tests/specs/check/jsx_not_checked/jsx_not_checked/other.ts similarity index 100% rename from tests/testdata/check/jsx_not_checked/other.ts rename to tests/specs/check/jsx_not_checked/jsx_not_checked/other.ts diff --git a/tests/specs/check/module_detection_force/__test__.jsonc b/tests/specs/check/module_detection_force/__test__.jsonc new file mode 100644 index 00000000000000..9c892bd723c795 --- /dev/null +++ b/tests/specs/check/module_detection_force/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "check --quiet module_detection_force/main.ts", + "output": "" +} diff --git a/tests/testdata/check/module_detection_force/import.ts b/tests/specs/check/module_detection_force/module_detection_force/import.ts similarity index 100% rename from tests/testdata/check/module_detection_force/import.ts rename to tests/specs/check/module_detection_force/module_detection_force/import.ts diff --git a/tests/testdata/check/module_detection_force/main.ts b/tests/specs/check/module_detection_force/module_detection_force/main.ts similarity index 100% rename from tests/testdata/check/module_detection_force/main.ts rename to tests/specs/check/module_detection_force/module_detection_force/main.ts diff --git a/tools/lint.js b/tools/lint.js index 04e72c4c9080df..a4302b3788ed4a 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -198,7 +198,7 @@ async function ensureNoNewITests() { "bench_tests.rs": 0, "cache_tests.rs": 0, "cert_tests.rs": 0, - "check_tests.rs": 18, + "check_tests.rs": 2, "compile_tests.rs": 0, "coverage_tests.rs": 0, "eval_tests.rs": 0,