From 3c193aef98bea6b3e0c9592cfdb43268e7a7e4af Mon Sep 17 00:00:00 2001 From: Mohammad Sulaiman Date: Wed, 2 Oct 2024 12:22:35 +0300 Subject: chore: deprecate check itests (#25963) --- tests/integration/check_tests.rs | 105 --------------------- .../check/check_broadcast_channel/__test__.jsonc | 5 + .../check_broadcast_channel/broadcast_channel.ts | 1 + .../check/check_deno_not_found/__test__.jsonc | 5 + .../check_deno_not_found/deno_not_found/main.out | 4 + .../check_deno_not_found/deno_not_found/main.ts | 4 + tests/specs/check/check_dts/__test__.jsonc | 5 + tests/specs/check/check_dts/dts/check_dts.d.ts | 2 + tests/specs/check/check_dts/dts/check_dts.out | 4 + .../__test__.jsonc | 5 + .../exclude_option/deno.exclude_dir.json | 5 + .../exclude_option/deno.exclude_glob.json | 5 + .../exclude_option/deno.json | 3 + .../exclude_option/exclude_option.ts.error.out | 4 + .../exclude_option/ignored/index.ts | 1 + .../exclude_option/index.ts | 5 + .../__test__.jsonc | 4 + .../jsximportsource_importmap_config/deno.json | 7 ++ .../import_map.json | 5 + .../jsx_runtime.ts | 4 + .../jsximportsource_importmap_config/main.tsx | 1 + .../check/check_no_error_truncation/__test__.jsonc | 5 + .../no_error_truncation/deno.json | 5 + .../no_error_truncation/main.out | 11 +++ .../no_error_truncation/main.ts | 12 +++ .../check_node_builtin_modules_js/__test__.jsonc | 5 + .../node_builtin_modules/mod.js | 3 + .../node_builtin_modules/mod.js.out | 5 + .../node_builtin_modules/mod.ts | 9 ++ .../node_builtin_modules/mod.ts.out | 13 +++ .../check_node_builtin_modules_ts/__test__.jsonc | 5 + .../node_builtin_modules/mod.js | 3 + .../node_builtin_modules/mod.js.out | 5 + .../node_builtin_modules/mod.ts | 9 ++ .../node_builtin_modules/mod.ts.out | 13 +++ .../check_npm_install_diagnostics/__test__.jsonc | 5 + .../npm_install_diagnostics/main.out | 11 +++ .../npm_install_diagnostics/main.ts | 2 + .../check_static_response_json/__test__.jsonc | 5 + .../check_static_response_json/response_json.ts | 5 + .../__test__.jsonc | 5 + .../exclude_option/deno.exclude_dir.json | 5 + .../exclude_option/deno.exclude_glob.json | 5 + .../exclude_option/deno.json | 3 + .../exclude_option/exclude_option.ts.error.out | 4 + .../exclude_option/ignored/index.ts | 1 + .../exclude_option/index.ts | 5 + .../__test__.jsonc | 5 + .../exclude_option/deno.exclude_dir.json | 5 + .../exclude_option/deno.exclude_glob.json | 5 + .../exclude_option/deno.json | 3 + .../exclude_option/exclude_option.ts.error.out | 4 + .../exclude_option/ignored/index.ts | 1 + .../exclude_option/index.ts | 5 + .../check_without_exclude_option/__test__.jsonc | 5 + .../exclude_option/deno.exclude_dir.json | 5 + .../exclude_option/deno.exclude_glob.json | 5 + .../exclude_option/deno.json | 3 + .../exclude_option/exclude_option.ts.error.out | 4 + .../exclude_option/ignored/index.ts | 1 + .../exclude_option/index.ts | 5 + .../__test__.jsonc | 4 + .../declaration_header_file_with_no_exports.ts | 2 + ...declaration_header_file_with_no_exports_js.d.ts | 0 .../declaration_header_file_with_no_exports_js.js | 1 + tests/specs/check/jsx_not_checked/__test__.jsonc | 5 + .../check/jsx_not_checked/jsx_not_checked/main.jsx | 21 +++++ .../check/jsx_not_checked/jsx_not_checked/main.out | 13 +++ .../check/jsx_not_checked/jsx_not_checked/other.ts | 5 + .../check/module_detection_force/__test__.jsonc | 4 + .../module_detection_force/import.ts | 2 + .../module_detection_force/main.ts | 3 + tests/testdata/check/broadcast_channel.ts | 1 - .../declaration_header_file_with_no_exports.ts | 2 - .../declaration_header_file_with_no_exports_js.js | 1 - tests/testdata/check/deno_not_found/main.out | 4 - tests/testdata/check/deno_not_found/main.ts | 4 - tests/testdata/check/dts/check_dts.d.ts | 2 - tests/testdata/check/dts/check_dts.out | 4 - .../check/exclude_option/deno.exclude_dir.json | 5 - .../check/exclude_option/deno.exclude_glob.json | 5 - tests/testdata/check/exclude_option/deno.json | 3 - .../exclude_option/exclude_option.ts.error.out | 4 - .../testdata/check/exclude_option/ignored/index.ts | 1 - tests/testdata/check/exclude_option/index.ts | 5 - tests/testdata/check/jsx_not_checked/main.jsx | 21 ----- tests/testdata/check/jsx_not_checked/main.out | 13 --- tests/testdata/check/jsx_not_checked/other.ts | 5 - .../jsximportsource_importmap_config/deno.json | 7 -- .../import_map.json | 5 - .../jsx_runtime.ts | 4 - .../jsximportsource_importmap_config/main.tsx | 1 - .../check/module_detection_force/import.ts | 2 - .../testdata/check/module_detection_force/main.ts | 3 - tests/testdata/check/no_error_truncation/deno.json | 5 - tests/testdata/check/no_error_truncation/main.out | 11 --- tests/testdata/check/no_error_truncation/main.ts | 12 --- tests/testdata/check/node_builtin_modules/mod.js | 3 - .../testdata/check/node_builtin_modules/mod.js.out | 5 - tests/testdata/check/node_builtin_modules/mod.ts | 9 -- .../testdata/check/node_builtin_modules/mod.ts.out | 13 --- .../check/npm_install_diagnostics/main.out | 11 --- .../testdata/check/npm_install_diagnostics/main.ts | 2 - tests/testdata/check/response_json.ts | 5 - 104 files changed, 354 insertions(+), 283 deletions(-) create mode 100644 tests/specs/check/check_broadcast_channel/__test__.jsonc create mode 100644 tests/specs/check/check_broadcast_channel/broadcast_channel.ts create mode 100644 tests/specs/check/check_deno_not_found/__test__.jsonc create mode 100644 tests/specs/check/check_deno_not_found/deno_not_found/main.out create mode 100644 tests/specs/check/check_deno_not_found/deno_not_found/main.ts create mode 100644 tests/specs/check/check_dts/__test__.jsonc create mode 100644 tests/specs/check/check_dts/dts/check_dts.d.ts create mode 100644 tests/specs/check/check_dts/dts/check_dts.out create mode 100644 tests/specs/check/check_imported_files_listed_in_exclude_option/__test__.jsonc create mode 100644 tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_dir.json create mode 100644 tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_glob.json create mode 100644 tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.json create mode 100644 tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/exclude_option.ts.error.out create mode 100644 tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/ignored/index.ts create mode 100644 tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/index.ts create mode 100644 tests/specs/check/check_jsximportsource_importmap_config/__test__.jsonc create mode 100644 tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/deno.json create mode 100644 tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/import_map.json create mode 100644 tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/jsx_runtime.ts create mode 100644 tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/main.tsx create mode 100644 tests/specs/check/check_no_error_truncation/__test__.jsonc create mode 100644 tests/specs/check/check_no_error_truncation/no_error_truncation/deno.json create mode 100644 tests/specs/check/check_no_error_truncation/no_error_truncation/main.out create mode 100644 tests/specs/check/check_no_error_truncation/no_error_truncation/main.ts create mode 100644 tests/specs/check/check_node_builtin_modules_js/__test__.jsonc create mode 100644 tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js create mode 100644 tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js.out create mode 100644 tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts create mode 100644 tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts.out create mode 100644 tests/specs/check/check_node_builtin_modules_ts/__test__.jsonc create mode 100644 tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js create mode 100644 tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.js.out create mode 100644 tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts create mode 100644 tests/specs/check/check_node_builtin_modules_ts/node_builtin_modules/mod.ts.out create mode 100644 tests/specs/check/check_npm_install_diagnostics/__test__.jsonc create mode 100644 tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.out create mode 100644 tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.ts create mode 100644 tests/specs/check/check_static_response_json/__test__.jsonc create mode 100644 tests/specs/check/check_static_response_json/response_json.ts create mode 100644 tests/specs/check/check_with_exclude_option_by_dir/__test__.jsonc create mode 100644 tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_dir.json create mode 100644 tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.exclude_glob.json create mode 100644 tests/specs/check/check_with_exclude_option_by_dir/exclude_option/deno.json create mode 100644 tests/specs/check/check_with_exclude_option_by_dir/exclude_option/exclude_option.ts.error.out create mode 100644 tests/specs/check/check_with_exclude_option_by_dir/exclude_option/ignored/index.ts create mode 100644 tests/specs/check/check_with_exclude_option_by_dir/exclude_option/index.ts create mode 100644 tests/specs/check/check_with_exclude_option_by_glob/__test__.jsonc create mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_dir.json create mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.exclude_glob.json create mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/deno.json create mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/exclude_option.ts.error.out create mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/ignored/index.ts create mode 100644 tests/specs/check/check_with_exclude_option_by_glob/exclude_option/index.ts create mode 100644 tests/specs/check/check_without_exclude_option/__test__.jsonc create mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_dir.json create mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/deno.exclude_glob.json create mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/deno.json create mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/exclude_option.ts.error.out create mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/ignored/index.ts create mode 100644 tests/specs/check/check_without_exclude_option/exclude_option/index.ts create mode 100644 tests/specs/check/declaration_header_file_with_no_exports/__test__.jsonc create mode 100644 tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports.ts create mode 100644 tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports_js.d.ts create mode 100644 tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports_js.js create mode 100644 tests/specs/check/jsx_not_checked/__test__.jsonc create mode 100644 tests/specs/check/jsx_not_checked/jsx_not_checked/main.jsx create mode 100644 tests/specs/check/jsx_not_checked/jsx_not_checked/main.out create mode 100644 tests/specs/check/jsx_not_checked/jsx_not_checked/other.ts create mode 100644 tests/specs/check/module_detection_force/__test__.jsonc create mode 100644 tests/specs/check/module_detection_force/module_detection_force/import.ts create mode 100644 tests/specs/check/module_detection_force/module_detection_force/main.ts delete mode 100644 tests/testdata/check/broadcast_channel.ts delete mode 100644 tests/testdata/check/declaration_header_file_with_no_exports.ts delete mode 100644 tests/testdata/check/declaration_header_file_with_no_exports_js.js delete mode 100644 tests/testdata/check/deno_not_found/main.out delete mode 100644 tests/testdata/check/deno_not_found/main.ts delete mode 100644 tests/testdata/check/dts/check_dts.d.ts delete mode 100644 tests/testdata/check/dts/check_dts.out delete mode 100644 tests/testdata/check/exclude_option/deno.exclude_dir.json delete mode 100644 tests/testdata/check/exclude_option/deno.exclude_glob.json delete mode 100644 tests/testdata/check/exclude_option/deno.json delete mode 100644 tests/testdata/check/exclude_option/exclude_option.ts.error.out delete mode 100644 tests/testdata/check/exclude_option/ignored/index.ts delete mode 100644 tests/testdata/check/exclude_option/index.ts delete mode 100644 tests/testdata/check/jsx_not_checked/main.jsx delete mode 100644 tests/testdata/check/jsx_not_checked/main.out delete mode 100644 tests/testdata/check/jsx_not_checked/other.ts delete mode 100644 tests/testdata/check/jsximportsource_importmap_config/deno.json delete mode 100644 tests/testdata/check/jsximportsource_importmap_config/import_map.json delete mode 100644 tests/testdata/check/jsximportsource_importmap_config/jsx_runtime.ts delete mode 100644 tests/testdata/check/jsximportsource_importmap_config/main.tsx delete mode 100644 tests/testdata/check/module_detection_force/import.ts delete mode 100644 tests/testdata/check/module_detection_force/main.ts delete mode 100644 tests/testdata/check/no_error_truncation/deno.json delete mode 100644 tests/testdata/check/no_error_truncation/main.out delete mode 100644 tests/testdata/check/no_error_truncation/main.ts delete mode 100644 tests/testdata/check/node_builtin_modules/mod.js delete mode 100644 tests/testdata/check/node_builtin_modules/mod.js.out delete mode 100644 tests/testdata/check/node_builtin_modules/mod.ts delete mode 100644 tests/testdata/check/node_builtin_modules/mod.ts.out delete mode 100644 tests/testdata/check/npm_install_diagnostics/main.out delete mode 100644 tests/testdata/check/npm_install_diagnostics/main.ts delete mode 100644 tests/testdata/check/response_json.ts (limited to 'tests') diff --git a/tests/integration/check_tests.rs b/tests/integration/check_tests.rs index f30828a66..178ac6493 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 000000000..6190781a5 --- /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/specs/check/check_broadcast_channel/broadcast_channel.ts b/tests/specs/check/check_broadcast_channel/broadcast_channel.ts new file mode 100644 index 000000000..6c75b4a8e --- /dev/null +++ b/tests/specs/check/check_broadcast_channel/broadcast_channel.ts @@ -0,0 +1 @@ +const _channel = new BroadcastChannel("foo"); 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 000000000..cbc6552b3 --- /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/specs/check/check_deno_not_found/deno_not_found/main.out b/tests/specs/check/check_deno_not_found/deno_not_found/main.out new file mode 100644 index 000000000..2b6f44d1e --- /dev/null +++ b/tests/specs/check/check_deno_not_found/deno_not_found/main.out @@ -0,0 +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]/deno_not_found/main.ts:4:1 diff --git a/tests/specs/check/check_deno_not_found/deno_not_found/main.ts b/tests/specs/check/check_deno_not_found/deno_not_found/main.ts new file mode 100644 index 000000000..3269f047a --- /dev/null +++ b/tests/specs/check/check_deno_not_found/deno_not_found/main.ts @@ -0,0 +1,4 @@ +/// +/// + +Deno; diff --git a/tests/specs/check/check_dts/__test__.jsonc b/tests/specs/check/check_dts/__test__.jsonc new file mode 100644 index 000000000..d684e2063 --- /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/specs/check/check_dts/dts/check_dts.d.ts b/tests/specs/check/check_dts/dts/check_dts.d.ts new file mode 100644 index 000000000..9cf60f063 --- /dev/null +++ b/tests/specs/check/check_dts/dts/check_dts.d.ts @@ -0,0 +1,2 @@ +// TS1039 [ERROR]: Initializers are not allowed in ambient contexts. +export const a: string = Deno.version.deno; diff --git a/tests/specs/check/check_dts/dts/check_dts.out b/tests/specs/check/check_dts/dts/check_dts.out new file mode 100644 index 000000000..e7ff9a009 --- /dev/null +++ b/tests/specs/check/check_dts/dts/check_dts.out @@ -0,0 +1,4 @@ +error: TS1039 [ERROR]: Initializers are not allowed in ambient contexts. +export const a: string = Deno.version.deno; + ~~~~~~~~~~~~~~~~~ + at file:///[WILDCARD]/check_dts.d.ts:2:26 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 000000000..1fd2d8760 --- /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/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_dir.json b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_dir.json new file mode 100644 index 000000000..2019f8953 --- /dev/null +++ b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_dir.json @@ -0,0 +1,5 @@ +{ + "exclude": [ + "ignored" + ] +} diff --git a/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_glob.json b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_glob.json new file mode 100644 index 000000000..1d203ba08 --- /dev/null +++ b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.exclude_glob.json @@ -0,0 +1,5 @@ +{ + "exclude": [ + "ignored/**/*" + ] +} diff --git a/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.json b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.json new file mode 100644 index 000000000..a9eca74ca --- /dev/null +++ b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/deno.json @@ -0,0 +1,3 @@ +{ + "exclude": [] +} diff --git a/tests/specs/check/check_imported_files_listed_in_exclude_option/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 new file mode 100644 index 000000000..abd1c1258 --- /dev/null +++ b/tests/specs/check/check_imported_files_listed_in_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_imported_files_listed_in_exclude_option/exclude_option/ignored/index.ts b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/ignored/index.ts new file mode 100644 index 000000000..0419cf073 --- /dev/null +++ b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/ignored/index.ts @@ -0,0 +1 @@ +export { nothing }; diff --git a/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/index.ts b/tests/specs/check/check_imported_files_listed_in_exclude_option/exclude_option/index.ts new file mode 100644 index 000000000..8335ca3a2 --- /dev/null +++ b/tests/specs/check/check_imported_files_listed_in_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/check_jsximportsource_importmap_config/__test__.jsonc b/tests/specs/check/check_jsximportsource_importmap_config/__test__.jsonc new file mode 100644 index 000000000..bbe32ca9e --- /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/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/deno.json b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/deno.json new file mode 100644 index 000000000..6d837af7c --- /dev/null +++ b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/deno.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "jsx" + }, + "importMap": "./import_map.json" +} diff --git a/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/import_map.json b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/import_map.json new file mode 100644 index 000000000..e926207af --- /dev/null +++ b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/import_map.json @@ -0,0 +1,5 @@ +{ + "imports": { + "jsx/jsx-runtime": "./jsx_runtime.ts" + } +} diff --git a/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/jsx_runtime.ts b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/jsx_runtime.ts new file mode 100644 index 000000000..33a07ca73 --- /dev/null +++ b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/jsx_runtime.ts @@ -0,0 +1,4 @@ +// deno-lint-ignore no-namespace +export namespace JSX { + export type IntrinsicElements = { [key: string]: unknown }; +} diff --git a/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/main.tsx b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/main.tsx new file mode 100644 index 000000000..a1eb24f0b --- /dev/null +++ b/tests/specs/check/check_jsximportsource_importmap_config/jsximportsource_importmap_config/main.tsx @@ -0,0 +1 @@ +export const makeParagraph = () =>

A paragraph!

; 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 000000000..15884059c --- /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/specs/check/check_no_error_truncation/no_error_truncation/deno.json b/tests/specs/check/check_no_error_truncation/no_error_truncation/deno.json new file mode 100644 index 000000000..643707ccc --- /dev/null +++ b/tests/specs/check/check_no_error_truncation/no_error_truncation/deno.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "noErrorTruncation": true + } +} diff --git a/tests/specs/check/check_no_error_truncation/no_error_truncation/main.out b/tests/specs/check/check_no_error_truncation/no_error_truncation/main.out new file mode 100644 index 000000000..13fd5aae4 --- /dev/null +++ b/tests/specs/check/check_no_error_truncation/no_error_truncation/main.out @@ -0,0 +1,11 @@ +error: TS2322 [ERROR]: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propertyWithAnExceedinglyLongName3: string; propertyWithAnExceedinglyLongName4: string; propertyWithAnExceedinglyLongName5: string; propertyWithAnExceedinglyLongName6: string; propertyWithAnExceedinglyLongName7: string; propertyWithAnExceedinglyLongName8: string; }' is not assignable to type 'string'. +const _s: string = x; + ~~ + at file:///[WILDCARD]/no_error_truncation/main.ts:12:7 + +TS2454 [ERROR]: Variable 'x' is used before being assigned. +const _s: string = x; + ^ + at file:///[WILDCARD]/no_error_truncation/main.ts:12:20 + +Found 2 errors. diff --git a/tests/specs/check/check_no_error_truncation/no_error_truncation/main.ts b/tests/specs/check/check_no_error_truncation/no_error_truncation/main.ts new file mode 100644 index 000000000..bb1856602 --- /dev/null +++ b/tests/specs/check/check_no_error_truncation/no_error_truncation/main.ts @@ -0,0 +1,12 @@ +let x: { + propertyWithAnExceedinglyLongName1: string; + propertyWithAnExceedinglyLongName2: string; + propertyWithAnExceedinglyLongName3: string; + propertyWithAnExceedinglyLongName4: string; + propertyWithAnExceedinglyLongName5: string; + propertyWithAnExceedinglyLongName6: string; + propertyWithAnExceedinglyLongName7: string; + propertyWithAnExceedinglyLongName8: string; +}; + +const _s: string = x; 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 000000000..8f7a2a65a --- /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/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js b/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js new file mode 100644 index 000000000..196fb9be9 --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules_js/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_js/node_builtin_modules/mod.js.out b/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.js.out new file mode 100644 index 000000000..97786ebae --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules_js/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_js/node_builtin_modules/mod.ts b/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts new file mode 100644 index 000000000..0e62353fe --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules_js/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_js/node_builtin_modules/mod.ts.out b/tests/specs/check/check_node_builtin_modules_js/node_builtin_modules/mod.ts.out new file mode 100644 index 000000000..49b762cff --- /dev/null +++ b/tests/specs/check/check_node_builtin_modules_js/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_node_builtin_modules_ts/__test__.jsonc b/tests/specs/check/check_node_builtin_modules_ts/__test__.jsonc new file mode 100644 index 000000000..736885f2e --- /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 000000000..196fb9be9 --- /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 000000000..97786ebae --- /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 000000000..0e62353fe --- /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 000000000..49b762cff --- /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 000000000..18260d362 --- /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/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.out b/tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.out new file mode 100644 index 000000000..fe46f0e42 --- /dev/null +++ b/tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.out @@ -0,0 +1,11 @@ +error: TS2581 [ERROR]: Cannot find name '$'. Did you mean to import jQuery? Try adding `import $ from "npm:jquery";`. +$; +^ + at file:///[WILDCARD]/npm_install_diagnostics/main.ts:1:1 + +TS2580 [ERROR]: Cannot find name 'process'. +process; +~~~~~~~ + at file:///[WILDCARD]/npm_install_diagnostics/main.ts:2:1 + +Found 2 errors. diff --git a/tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.ts b/tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.ts new file mode 100644 index 000000000..62c0c5619 --- /dev/null +++ b/tests/specs/check/check_npm_install_diagnostics/npm_install_diagnostics/main.ts @@ -0,0 +1,2 @@ +$; +process; 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 000000000..d286d3aa8 --- /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/specs/check/check_static_response_json/response_json.ts b/tests/specs/check/check_static_response_json/response_json.ts new file mode 100644 index 000000000..e936f7bff --- /dev/null +++ b/tests/specs/check/check_static_response_json/response_json.ts @@ -0,0 +1,5 @@ +/// +/// +/// + +Response.json({}); 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 000000000..c7fe285da --- /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 000000000..2019f8953 --- /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 000000000..1d203ba08 --- /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 000000000..a9eca74ca --- /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 000000000..abd1c1258 --- /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 000000000..0419cf073 --- /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 000000000..8335ca3a2 --- /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 000000000..54700ca3d --- /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 000000000..2019f8953 --- /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 000000000..1d203ba08 --- /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 000000000..a9eca74ca --- /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 000000000..abd1c1258 --- /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 000000000..0419cf073 --- /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 000000000..8335ca3a2 --- /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 000000000..801786fa3 --- /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 000000000..2019f8953 --- /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 000000000..1d203ba08 --- /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 000000000..a9eca74ca --- /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 000000000..abd1c1258 --- /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 000000000..0419cf073 --- /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 000000000..8335ca3a2 --- /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 000000000..08fc0a2d6 --- /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/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports.ts b/tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports.ts new file mode 100644 index 000000000..ef5da7a38 --- /dev/null +++ b/tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports.ts @@ -0,0 +1,2 @@ +import * as foo from "./declaration_header_file_with_no_exports_js.js"; +console.log(foo); 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 000000000..e69de29bb diff --git a/tests/specs/check/declaration_header_file_with_no_exports/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 new file mode 100644 index 000000000..b8ae2bcef --- /dev/null +++ b/tests/specs/check/declaration_header_file_with_no_exports/declaration_header_file_with_no_exports_js.js @@ -0,0 +1 @@ +/// 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 000000000..dbaa9b2ea --- /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/specs/check/jsx_not_checked/jsx_not_checked/main.jsx b/tests/specs/check/jsx_not_checked/jsx_not_checked/main.jsx new file mode 100644 index 000000000..8de05f9f7 --- /dev/null +++ b/tests/specs/check/jsx_not_checked/jsx_not_checked/main.jsx @@ -0,0 +1,21 @@ +// should not error about jsx-runtime not being found in types here +/** @jsxImportSource npm:react@18.2.0 */ + +import "./other.ts"; + +export default ( + <> +

Hello world

+

This is a JSX page

+ +); + +/** + * @param {number} a + * @param {number} b + */ +function add(a, b) { + return a + b; +} + +console.log(add("1", "2")); diff --git a/tests/specs/check/jsx_not_checked/jsx_not_checked/main.out b/tests/specs/check/jsx_not_checked/jsx_not_checked/main.out new file mode 100644 index 000000000..25165044c --- /dev/null +++ b/tests/specs/check/jsx_not_checked/jsx_not_checked/main.out @@ -0,0 +1,13 @@ +[UNORDERED_START] +Download http://localhost:4260/react +Download http://localhost:4260/loose-envify +Download http://localhost:4260/js-tokens +Download http://localhost:4260/react/react-18.2.0.tgz +Download http://localhost:4260/loose-envify/loose-envify-1.4.0.tgz +Download http://localhost:4260/js-tokens/js-tokens-4.0.0.tgz +[UNORDERED_END] +Check file:///[WILDCARD]/jsx_not_checked/main.jsx +error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'number'. +console.log(add("1", "2")); + ~~~ + at file:///[WILDCARD]/other.ts:5:17 diff --git a/tests/specs/check/jsx_not_checked/jsx_not_checked/other.ts b/tests/specs/check/jsx_not_checked/jsx_not_checked/other.ts new file mode 100644 index 000000000..47995cb0f --- /dev/null +++ b/tests/specs/check/jsx_not_checked/jsx_not_checked/other.ts @@ -0,0 +1,5 @@ +function add(a: number, b: number) { + return a + b; +} + +console.log(add("1", "2")); 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 000000000..9c892bd72 --- /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/specs/check/module_detection_force/module_detection_force/import.ts b/tests/specs/check/module_detection_force/module_detection_force/import.ts new file mode 100644 index 000000000..66b229870 --- /dev/null +++ b/tests/specs/check/module_detection_force/module_detection_force/import.ts @@ -0,0 +1,2 @@ +const a = 2; +console.log(a); diff --git a/tests/specs/check/module_detection_force/module_detection_force/main.ts b/tests/specs/check/module_detection_force/module_detection_force/main.ts new file mode 100644 index 000000000..a55c9962b --- /dev/null +++ b/tests/specs/check/module_detection_force/module_detection_force/main.ts @@ -0,0 +1,3 @@ +const a = 1; +await import("./import.ts"); +console.log(a); diff --git a/tests/testdata/check/broadcast_channel.ts b/tests/testdata/check/broadcast_channel.ts deleted file mode 100644 index 6c75b4a8e..000000000 --- a/tests/testdata/check/broadcast_channel.ts +++ /dev/null @@ -1 +0,0 @@ -const _channel = new BroadcastChannel("foo"); diff --git a/tests/testdata/check/declaration_header_file_with_no_exports.ts b/tests/testdata/check/declaration_header_file_with_no_exports.ts deleted file mode 100644 index ef5da7a38..000000000 --- a/tests/testdata/check/declaration_header_file_with_no_exports.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as foo from "./declaration_header_file_with_no_exports_js.js"; -console.log(foo); diff --git a/tests/testdata/check/declaration_header_file_with_no_exports_js.js b/tests/testdata/check/declaration_header_file_with_no_exports_js.js deleted file mode 100644 index b8ae2bcef..000000000 --- a/tests/testdata/check/declaration_header_file_with_no_exports_js.js +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/tests/testdata/check/deno_not_found/main.out b/tests/testdata/check/deno_not_found/main.out deleted file mode 100644 index dc4a682c7..000000000 --- a/tests/testdata/check/deno_not_found/main.out +++ /dev/null @@ -1,4 +0,0 @@ -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 diff --git a/tests/testdata/check/deno_not_found/main.ts b/tests/testdata/check/deno_not_found/main.ts deleted file mode 100644 index 3269f047a..000000000 --- a/tests/testdata/check/deno_not_found/main.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -/// - -Deno; diff --git a/tests/testdata/check/dts/check_dts.d.ts b/tests/testdata/check/dts/check_dts.d.ts deleted file mode 100644 index 9cf60f063..000000000 --- a/tests/testdata/check/dts/check_dts.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// TS1039 [ERROR]: Initializers are not allowed in ambient contexts. -export const a: string = Deno.version.deno; diff --git a/tests/testdata/check/dts/check_dts.out b/tests/testdata/check/dts/check_dts.out deleted file mode 100644 index e7ff9a009..000000000 --- a/tests/testdata/check/dts/check_dts.out +++ /dev/null @@ -1,4 +0,0 @@ -error: TS1039 [ERROR]: Initializers are not allowed in ambient contexts. -export const a: string = Deno.version.deno; - ~~~~~~~~~~~~~~~~~ - at file:///[WILDCARD]/check_dts.d.ts:2:26 diff --git a/tests/testdata/check/exclude_option/deno.exclude_dir.json b/tests/testdata/check/exclude_option/deno.exclude_dir.json deleted file mode 100644 index 2019f8953..000000000 --- a/tests/testdata/check/exclude_option/deno.exclude_dir.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "exclude": [ - "ignored" - ] -} diff --git a/tests/testdata/check/exclude_option/deno.exclude_glob.json b/tests/testdata/check/exclude_option/deno.exclude_glob.json deleted file mode 100644 index 1d203ba08..000000000 --- a/tests/testdata/check/exclude_option/deno.exclude_glob.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "exclude": [ - "ignored/**/*" - ] -} diff --git a/tests/testdata/check/exclude_option/deno.json b/tests/testdata/check/exclude_option/deno.json deleted file mode 100644 index a9eca74ca..000000000 --- a/tests/testdata/check/exclude_option/deno.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "exclude": [] -} diff --git a/tests/testdata/check/exclude_option/exclude_option.ts.error.out b/tests/testdata/check/exclude_option/exclude_option.ts.error.out deleted file mode 100644 index abd1c1258..000000000 --- a/tests/testdata/check/exclude_option/exclude_option.ts.error.out +++ /dev/null @@ -1,4 +0,0 @@ -error: TS2304 [ERROR]: Cannot find name 'nothing'. -export { nothing }; - ~~~~~~~ - at [WILDCARD] diff --git a/tests/testdata/check/exclude_option/ignored/index.ts b/tests/testdata/check/exclude_option/ignored/index.ts deleted file mode 100644 index 0419cf073..000000000 --- a/tests/testdata/check/exclude_option/ignored/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { nothing }; diff --git a/tests/testdata/check/exclude_option/index.ts b/tests/testdata/check/exclude_option/index.ts deleted file mode 100644 index 8335ca3a2..000000000 --- a/tests/testdata/check/exclude_option/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { nothing } from "./ignored/index.ts"; - -const foo = 1; - -export { foo, nothing }; diff --git a/tests/testdata/check/jsx_not_checked/main.jsx b/tests/testdata/check/jsx_not_checked/main.jsx deleted file mode 100644 index 8de05f9f7..000000000 --- a/tests/testdata/check/jsx_not_checked/main.jsx +++ /dev/null @@ -1,21 +0,0 @@ -// should not error about jsx-runtime not being found in types here -/** @jsxImportSource npm:react@18.2.0 */ - -import "./other.ts"; - -export default ( - <> -

Hello world

-

This is a JSX page

- -); - -/** - * @param {number} a - * @param {number} b - */ -function add(a, b) { - return a + b; -} - -console.log(add("1", "2")); diff --git a/tests/testdata/check/jsx_not_checked/main.out b/tests/testdata/check/jsx_not_checked/main.out deleted file mode 100644 index 25165044c..000000000 --- a/tests/testdata/check/jsx_not_checked/main.out +++ /dev/null @@ -1,13 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/react -Download http://localhost:4260/loose-envify -Download http://localhost:4260/js-tokens -Download http://localhost:4260/react/react-18.2.0.tgz -Download http://localhost:4260/loose-envify/loose-envify-1.4.0.tgz -Download http://localhost:4260/js-tokens/js-tokens-4.0.0.tgz -[UNORDERED_END] -Check file:///[WILDCARD]/jsx_not_checked/main.jsx -error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type 'number'. -console.log(add("1", "2")); - ~~~ - at file:///[WILDCARD]/other.ts:5:17 diff --git a/tests/testdata/check/jsx_not_checked/other.ts b/tests/testdata/check/jsx_not_checked/other.ts deleted file mode 100644 index 47995cb0f..000000000 --- a/tests/testdata/check/jsx_not_checked/other.ts +++ /dev/null @@ -1,5 +0,0 @@ -function add(a: number, b: number) { - return a + b; -} - -console.log(add("1", "2")); diff --git a/tests/testdata/check/jsximportsource_importmap_config/deno.json b/tests/testdata/check/jsximportsource_importmap_config/deno.json deleted file mode 100644 index 6d837af7c..000000000 --- a/tests/testdata/check/jsximportsource_importmap_config/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "jsxImportSource": "jsx" - }, - "importMap": "./import_map.json" -} diff --git a/tests/testdata/check/jsximportsource_importmap_config/import_map.json b/tests/testdata/check/jsximportsource_importmap_config/import_map.json deleted file mode 100644 index e926207af..000000000 --- a/tests/testdata/check/jsximportsource_importmap_config/import_map.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "jsx/jsx-runtime": "./jsx_runtime.ts" - } -} diff --git a/tests/testdata/check/jsximportsource_importmap_config/jsx_runtime.ts b/tests/testdata/check/jsximportsource_importmap_config/jsx_runtime.ts deleted file mode 100644 index 33a07ca73..000000000 --- a/tests/testdata/check/jsximportsource_importmap_config/jsx_runtime.ts +++ /dev/null @@ -1,4 +0,0 @@ -// deno-lint-ignore no-namespace -export namespace JSX { - export type IntrinsicElements = { [key: string]: unknown }; -} diff --git a/tests/testdata/check/jsximportsource_importmap_config/main.tsx b/tests/testdata/check/jsximportsource_importmap_config/main.tsx deleted file mode 100644 index a1eb24f0b..000000000 --- a/tests/testdata/check/jsximportsource_importmap_config/main.tsx +++ /dev/null @@ -1 +0,0 @@ -export const makeParagraph = () =>

A paragraph!

; diff --git a/tests/testdata/check/module_detection_force/import.ts b/tests/testdata/check/module_detection_force/import.ts deleted file mode 100644 index 66b229870..000000000 --- a/tests/testdata/check/module_detection_force/import.ts +++ /dev/null @@ -1,2 +0,0 @@ -const a = 2; -console.log(a); diff --git a/tests/testdata/check/module_detection_force/main.ts b/tests/testdata/check/module_detection_force/main.ts deleted file mode 100644 index a55c9962b..000000000 --- a/tests/testdata/check/module_detection_force/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -const a = 1; -await import("./import.ts"); -console.log(a); diff --git a/tests/testdata/check/no_error_truncation/deno.json b/tests/testdata/check/no_error_truncation/deno.json deleted file mode 100644 index 643707ccc..000000000 --- a/tests/testdata/check/no_error_truncation/deno.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "noErrorTruncation": true - } -} diff --git a/tests/testdata/check/no_error_truncation/main.out b/tests/testdata/check/no_error_truncation/main.out deleted file mode 100644 index 13fd5aae4..000000000 --- a/tests/testdata/check/no_error_truncation/main.out +++ /dev/null @@ -1,11 +0,0 @@ -error: TS2322 [ERROR]: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propertyWithAnExceedinglyLongName3: string; propertyWithAnExceedinglyLongName4: string; propertyWithAnExceedinglyLongName5: string; propertyWithAnExceedinglyLongName6: string; propertyWithAnExceedinglyLongName7: string; propertyWithAnExceedinglyLongName8: string; }' is not assignable to type 'string'. -const _s: string = x; - ~~ - at file:///[WILDCARD]/no_error_truncation/main.ts:12:7 - -TS2454 [ERROR]: Variable 'x' is used before being assigned. -const _s: string = x; - ^ - at file:///[WILDCARD]/no_error_truncation/main.ts:12:20 - -Found 2 errors. diff --git a/tests/testdata/check/no_error_truncation/main.ts b/tests/testdata/check/no_error_truncation/main.ts deleted file mode 100644 index bb1856602..000000000 --- a/tests/testdata/check/no_error_truncation/main.ts +++ /dev/null @@ -1,12 +0,0 @@ -let x: { - propertyWithAnExceedinglyLongName1: string; - propertyWithAnExceedinglyLongName2: string; - propertyWithAnExceedinglyLongName3: string; - propertyWithAnExceedinglyLongName4: string; - propertyWithAnExceedinglyLongName5: string; - propertyWithAnExceedinglyLongName6: string; - propertyWithAnExceedinglyLongName7: string; - propertyWithAnExceedinglyLongName8: string; -}; - -const _s: string = x; diff --git a/tests/testdata/check/node_builtin_modules/mod.js b/tests/testdata/check/node_builtin_modules/mod.js deleted file mode 100644 index 196fb9be9..000000000 --- a/tests/testdata/check/node_builtin_modules/mod.js +++ /dev/null @@ -1,3 +0,0 @@ -// @ts-check -import fs from "node:fs"; -const _data = fs.readFileSync("./node_builtin.js", 123); diff --git a/tests/testdata/check/node_builtin_modules/mod.js.out b/tests/testdata/check/node_builtin_modules/mod.js.out deleted file mode 100644 index 97786ebae..000000000 --- a/tests/testdata/check/node_builtin_modules/mod.js.out +++ /dev/null @@ -1,5 +0,0 @@ -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/testdata/check/node_builtin_modules/mod.ts b/tests/testdata/check/node_builtin_modules/mod.ts deleted file mode 100644 index 0e62353fe..000000000 --- a/tests/testdata/check/node_builtin_modules/mod.ts +++ /dev/null @@ -1,9 +0,0 @@ -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/testdata/check/node_builtin_modules/mod.ts.out b/tests/testdata/check/node_builtin_modules/mod.ts.out deleted file mode 100644 index 49b762cff..000000000 --- a/tests/testdata/check/node_builtin_modules/mod.ts.out +++ /dev/null @@ -1,13 +0,0 @@ -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/testdata/check/npm_install_diagnostics/main.out b/tests/testdata/check/npm_install_diagnostics/main.out deleted file mode 100644 index fe46f0e42..000000000 --- a/tests/testdata/check/npm_install_diagnostics/main.out +++ /dev/null @@ -1,11 +0,0 @@ -error: TS2581 [ERROR]: Cannot find name '$'. Did you mean to import jQuery? Try adding `import $ from "npm:jquery";`. -$; -^ - at file:///[WILDCARD]/npm_install_diagnostics/main.ts:1:1 - -TS2580 [ERROR]: Cannot find name 'process'. -process; -~~~~~~~ - at file:///[WILDCARD]/npm_install_diagnostics/main.ts:2:1 - -Found 2 errors. diff --git a/tests/testdata/check/npm_install_diagnostics/main.ts b/tests/testdata/check/npm_install_diagnostics/main.ts deleted file mode 100644 index 62c0c5619..000000000 --- a/tests/testdata/check/npm_install_diagnostics/main.ts +++ /dev/null @@ -1,2 +0,0 @@ -$; -process; diff --git a/tests/testdata/check/response_json.ts b/tests/testdata/check/response_json.ts deleted file mode 100644 index e936f7bff..000000000 --- a/tests/testdata/check/response_json.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// -/// - -Response.json({}); -- cgit v1.2.3