From acc32e1cee043ef7233a94bcf5645c4a842ed13a Mon Sep 17 00:00:00 2001 From: Mohammad Sulaiman Date: Mon, 16 Sep 2024 20:08:00 +0300 Subject: chore: move info itests (#25659) --- tests/integration/info_tests.rs | 124 ---------------- tests/integration/mod.rs | 2 - .../_054_info_local_imports/005_more_imports.ts | 11 ++ .../054_info_local_imports.out | 9 ++ .../_054_info_local_imports/__test__.jsonc | 5 + .../info_tests/_054_info_local_imports/mod1.ts | 17 +++ .../info_tests/_054_info_local_imports/mod2.ts | 1 + .../_054_info_local_imports/print_hello.ts | 3 + .../subdir2/dynamic_import.ts | 4 + .../_054_info_local_imports/subdir2/mod2.ts | 9 ++ .../info_tests/data_null_error/__test__.jsonc | 4 + .../data_null_error/data_null_error.out | 7 + .../data_null_error/data_null_error/mod.ts | 1 + .../data_null_error/data_null_error/types.d.ts | 1 + .../info_dynamic_imports_tmpl_lit/__test__.jsonc | 5 + .../dynamic_imports_tmp_lit/main.info.out | 10 ++ .../dynamic_imports_tmp_lit/main.js | 14 ++ .../dynamic_imports_tmp_lit/other/data.json | 3 + .../dynamic_imports_tmp_lit/other/sub/data2.json | 3 + .../dynamic_imports_tmp_lit/sub/a.js | 1 + .../dynamic_imports_tmp_lit/sub/b.ts | 1 + tests/specs/info_tests/info_flag/041_info_flag.out | 6 + tests/specs/info_tests/info_flag/__test__.jsonc | 4 + .../info_flag_location/041_info_flag_location.out | 7 + .../info_tests/info_flag_location/__test__.jsonc | 4 + .../049_info_flag_script_jsx.out | 15 ++ .../info_tests/info_flag_script_jsx/__test__.jsonc | 4 + .../info_tests/info_import_map/__test__.jsonc | 5 + tests/specs/info_tests/info_import_map/deno.json | 6 + tests/specs/info_tests/info_import_map/deno.lock | 10 ++ tests/specs/info_tests/info_import_map/main.tsx | 2 + .../info_tests/info_import_map/with_import_map.out | 16 ++ tests/specs/info_tests/info_json/__test__.jsonc | 4 + tests/specs/info_tests/info_json/info_json.out | 9 ++ .../076_info_json_deps_order.out | 165 +++++++++++++++++++++ .../076_info_json_deps_order.ts | 2 + .../info_tests/info_json_deps_order/__test__.jsonc | 4 + .../info_json_deps_order/recursive_imports/A.ts | 7 + .../info_json_deps_order/recursive_imports/B.ts | 7 + .../info_json_deps_order/recursive_imports/C.ts | 8 + .../recursive_imports/common.ts | 2 + .../info_tests/info_json_location/__test__.jsonc | 4 + .../info_json_location/info_json_location.out | 10 ++ .../info_tests/info_missing_module/__test__.jsonc | 4 + .../error_009_missing_js_module.js | 1 + .../info_missing_module/info_missing_module.out | 7 + .../info_recursive_modules/__test__.jsonc | 5 + .../info_recursive_imports_test.out | 13 ++ .../info_recursive_imports_test.ts | 5 + .../info_recursive_modules/recursive_imports/A.ts | 7 + .../info_recursive_modules/recursive_imports/B.ts | 7 + .../info_recursive_modules/recursive_imports/C.ts | 8 + .../recursive_imports/common.ts | 2 + .../info_tests/info_type_import/__test__.jsonc | 4 + .../info_type_import/info_type_import.out | 7 + .../info_type_import/info_type_import.ts | 3 + .../info_tests/info_type_import/type_and_code.ts | 7 + tests/specs/info_tests/json_file/__test__.jsonc | 5 + .../info_tests/json_file/json_output/main.out | 92 ++++++++++++ .../specs/info_tests/json_file/json_output/main.ts | 11 ++ tests/specs/info_tests/json_file/mod1.ts | 17 +++ tests/specs/info_tests/json_file/mod2.ts | 1 + tests/specs/info_tests/json_file/print_hello.ts | 3 + .../info_tests/json_file/subdir2/dynamic_import.ts | 4 + tests/specs/info_tests/json_file/subdir2/mod2.ts | 9 ++ .../info_tests/multiple_imports/__test__.jsonc | 4 + .../multiple_imports/multiple_imports.out | 15 ++ .../info_tests/types_header_direct/__test__.jsonc | 4 + .../types_header_direct/type_directives_01.ts | 3 + .../types_header_direct/types_header.out | 9 ++ .../info_tests/with_config_override/__test__.jsonc | 4 + .../with_config/deno-override.json | 3 + .../with_config_override/with_config/deno.json | 1 + .../with_config/import_map.json | 1 + .../with_config_override/with_config/test.ts | 1 + .../with_config/with_config.out | 7 + tests/testdata/info/041_info_flag.out | 6 - tests/testdata/info/041_info_flag_location.out | 7 - tests/testdata/info/049_info_flag_script_jsx.out | 15 -- tests/testdata/info/054_info_local_imports.out | 9 -- tests/testdata/info/076_info_json_deps_order.out | 165 --------------------- tests/testdata/info/076_info_json_deps_order.ts | 2 - .../info/data_null_error/data_null_error.out | 7 - tests/testdata/info/data_null_error/mod.ts | 1 - tests/testdata/info/data_null_error/types.d.ts | 1 - tests/testdata/info/info_json.out | 9 -- tests/testdata/info/info_json_location.out | 10 -- tests/testdata/info/info_missing_module.out | 7 - .../testdata/info/info_recursive_imports_test.out | 13 -- tests/testdata/info/info_type_import.out | 7 - tests/testdata/info/json_output/main.out | 92 ------------ tests/testdata/info/json_output/main.ts | 11 -- tests/testdata/info/multiple_imports.out | 15 -- tests/testdata/info/types_header.out | 9 -- tests/testdata/info/with_config/deno-override.json | 3 - tests/testdata/info/with_config/deno.json | 1 - tests/testdata/info/with_config/import_map.json | 1 - tests/testdata/info/with_config/test.ts | 1 - tests/testdata/info/with_config/with_config.out | 7 - tests/testdata/info/with_import_map/deno.json | 6 - tests/testdata/info/with_import_map/deno.lock | 10 -- tests/testdata/info/with_import_map/main.tsx | 2 - .../info/with_import_map/with_import_map.out | 16 -- tools/lint.js | 1 - 104 files changed, 684 insertions(+), 560 deletions(-) delete mode 100644 tests/integration/info_tests.rs create mode 100644 tests/specs/info_tests/_054_info_local_imports/005_more_imports.ts create mode 100644 tests/specs/info_tests/_054_info_local_imports/054_info_local_imports.out create mode 100644 tests/specs/info_tests/_054_info_local_imports/__test__.jsonc create mode 100644 tests/specs/info_tests/_054_info_local_imports/mod1.ts create mode 100644 tests/specs/info_tests/_054_info_local_imports/mod2.ts create mode 100644 tests/specs/info_tests/_054_info_local_imports/print_hello.ts create mode 100644 tests/specs/info_tests/_054_info_local_imports/subdir2/dynamic_import.ts create mode 100644 tests/specs/info_tests/_054_info_local_imports/subdir2/mod2.ts create mode 100644 tests/specs/info_tests/data_null_error/__test__.jsonc create mode 100644 tests/specs/info_tests/data_null_error/data_null_error/data_null_error.out create mode 100644 tests/specs/info_tests/data_null_error/data_null_error/mod.ts create mode 100644 tests/specs/info_tests/data_null_error/data_null_error/types.d.ts create mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/__test__.jsonc create mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out create mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js create mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json create mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json create mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js create mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts create mode 100644 tests/specs/info_tests/info_flag/041_info_flag.out create mode 100644 tests/specs/info_tests/info_flag/__test__.jsonc create mode 100644 tests/specs/info_tests/info_flag_location/041_info_flag_location.out create mode 100644 tests/specs/info_tests/info_flag_location/__test__.jsonc create mode 100644 tests/specs/info_tests/info_flag_script_jsx/049_info_flag_script_jsx.out create mode 100644 tests/specs/info_tests/info_flag_script_jsx/__test__.jsonc create mode 100644 tests/specs/info_tests/info_import_map/__test__.jsonc create mode 100644 tests/specs/info_tests/info_import_map/deno.json create mode 100644 tests/specs/info_tests/info_import_map/deno.lock create mode 100644 tests/specs/info_tests/info_import_map/main.tsx create mode 100644 tests/specs/info_tests/info_import_map/with_import_map.out create mode 100644 tests/specs/info_tests/info_json/__test__.jsonc create mode 100644 tests/specs/info_tests/info_json/info_json.out create mode 100644 tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.out create mode 100644 tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.ts create mode 100644 tests/specs/info_tests/info_json_deps_order/__test__.jsonc create mode 100644 tests/specs/info_tests/info_json_deps_order/recursive_imports/A.ts create mode 100644 tests/specs/info_tests/info_json_deps_order/recursive_imports/B.ts create mode 100644 tests/specs/info_tests/info_json_deps_order/recursive_imports/C.ts create mode 100644 tests/specs/info_tests/info_json_deps_order/recursive_imports/common.ts create mode 100644 tests/specs/info_tests/info_json_location/__test__.jsonc create mode 100644 tests/specs/info_tests/info_json_location/info_json_location.out create mode 100644 tests/specs/info_tests/info_missing_module/__test__.jsonc create mode 100644 tests/specs/info_tests/info_missing_module/error_009_missing_js_module.js create mode 100644 tests/specs/info_tests/info_missing_module/info_missing_module.out create mode 100644 tests/specs/info_tests/info_recursive_modules/__test__.jsonc create mode 100644 tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.out create mode 100644 tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.ts create mode 100644 tests/specs/info_tests/info_recursive_modules/recursive_imports/A.ts create mode 100644 tests/specs/info_tests/info_recursive_modules/recursive_imports/B.ts create mode 100644 tests/specs/info_tests/info_recursive_modules/recursive_imports/C.ts create mode 100644 tests/specs/info_tests/info_recursive_modules/recursive_imports/common.ts create mode 100644 tests/specs/info_tests/info_type_import/__test__.jsonc create mode 100644 tests/specs/info_tests/info_type_import/info_type_import.out create mode 100644 tests/specs/info_tests/info_type_import/info_type_import.ts create mode 100644 tests/specs/info_tests/info_type_import/type_and_code.ts create mode 100644 tests/specs/info_tests/json_file/__test__.jsonc create mode 100644 tests/specs/info_tests/json_file/json_output/main.out create mode 100644 tests/specs/info_tests/json_file/json_output/main.ts create mode 100644 tests/specs/info_tests/json_file/mod1.ts create mode 100644 tests/specs/info_tests/json_file/mod2.ts create mode 100644 tests/specs/info_tests/json_file/print_hello.ts create mode 100644 tests/specs/info_tests/json_file/subdir2/dynamic_import.ts create mode 100644 tests/specs/info_tests/json_file/subdir2/mod2.ts create mode 100644 tests/specs/info_tests/multiple_imports/__test__.jsonc create mode 100644 tests/specs/info_tests/multiple_imports/multiple_imports.out create mode 100644 tests/specs/info_tests/types_header_direct/__test__.jsonc create mode 100644 tests/specs/info_tests/types_header_direct/type_directives_01.ts create mode 100644 tests/specs/info_tests/types_header_direct/types_header.out create mode 100644 tests/specs/info_tests/with_config_override/__test__.jsonc create mode 100644 tests/specs/info_tests/with_config_override/with_config/deno-override.json create mode 100644 tests/specs/info_tests/with_config_override/with_config/deno.json create mode 100644 tests/specs/info_tests/with_config_override/with_config/import_map.json create mode 100644 tests/specs/info_tests/with_config_override/with_config/test.ts create mode 100644 tests/specs/info_tests/with_config_override/with_config/with_config.out delete mode 100644 tests/testdata/info/041_info_flag.out delete mode 100644 tests/testdata/info/041_info_flag_location.out delete mode 100644 tests/testdata/info/049_info_flag_script_jsx.out delete mode 100644 tests/testdata/info/054_info_local_imports.out delete mode 100644 tests/testdata/info/076_info_json_deps_order.out delete mode 100644 tests/testdata/info/076_info_json_deps_order.ts delete mode 100644 tests/testdata/info/data_null_error/data_null_error.out delete mode 100644 tests/testdata/info/data_null_error/mod.ts delete mode 100644 tests/testdata/info/data_null_error/types.d.ts delete mode 100644 tests/testdata/info/info_json.out delete mode 100644 tests/testdata/info/info_json_location.out delete mode 100644 tests/testdata/info/info_missing_module.out delete mode 100644 tests/testdata/info/info_recursive_imports_test.out delete mode 100644 tests/testdata/info/info_type_import.out delete mode 100644 tests/testdata/info/json_output/main.out delete mode 100644 tests/testdata/info/json_output/main.ts delete mode 100644 tests/testdata/info/multiple_imports.out delete mode 100644 tests/testdata/info/types_header.out delete mode 100644 tests/testdata/info/with_config/deno-override.json delete mode 100644 tests/testdata/info/with_config/deno.json delete mode 100644 tests/testdata/info/with_config/import_map.json delete mode 100644 tests/testdata/info/with_config/test.ts delete mode 100644 tests/testdata/info/with_config/with_config.out delete mode 100644 tests/testdata/info/with_import_map/deno.json delete mode 100644 tests/testdata/info/with_import_map/deno.lock delete mode 100644 tests/testdata/info/with_import_map/main.tsx delete mode 100644 tests/testdata/info/with_import_map/with_import_map.out diff --git a/tests/integration/info_tests.rs b/tests/integration/info_tests.rs deleted file mode 100644 index 7699baba8..000000000 --- a/tests/integration/info_tests.rs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -use test_util as util; -use test_util::itest; -use util::TestContextBuilder; - -#[test] -fn info_lock_write() { - let context = TestContextBuilder::new().use_http_server().build(); - - context.temp_dir().write("deno.json", "{}"); - - let module_path = "http://127.0.0.1:4545/run/048_media_types_jsx.ts"; - - let output = context - .new_command() - .current_dir(context.temp_dir().path()) - .args_vec(["info", module_path]) - .run(); - output.assert_exit_code(0); - output.skip_output_check(); - - assert!( - context.temp_dir().path().join("deno.lock").exists(), - "missing deno.lock" - ); -} - -itest!(multiple_imports { - args: "info http://127.0.0.1:4545/run/019_media_types.ts", - output: "info/multiple_imports.out", - http_server: true, -}); - -itest!(info_flag { - args: "info", - output: "info/041_info_flag.out", -}); - -itest!(info_flag_location { - args: "info --location https://deno.land", - output: "info/041_info_flag_location.out", -}); - -itest!(info_json { - args: "info --json", - output: "info/info_json.out", -}); - -itest!(info_json_location { - args: "info --json --location https://deno.land", - output: "info/info_json_location.out", -}); - -itest!(info_flag_script_jsx { - args: "info http://127.0.0.1:4545/run/048_media_types_jsx.ts", - output: "info/049_info_flag_script_jsx.out", - http_server: true, -}); - -itest!(json_file { - args: "info --quiet --json info/json_output/main.ts", - output: "info/json_output/main.out", - exit_code: 0, -}); - -itest!(info_json_deps_order { - args: "info --json info/076_info_json_deps_order.ts", - output: "info/076_info_json_deps_order.out", -}); - -itest!(info_missing_module { - args: "info info/error_009_missing_js_module.js", - output: "info/info_missing_module.out", -}); - -itest!(info_recursive_modules { - args: "info --quiet info/info_recursive_imports_test.ts", - output: "info/info_recursive_imports_test.out", - exit_code: 0, -}); - -itest!(info_type_import { - args: "info info/info_type_import.ts", - output: "info/info_type_import.out", -}); - -itest!(_054_info_local_imports { - args: "info --quiet run/005_more_imports.ts", - output: "info/054_info_local_imports.out", - exit_code: 0, -}); - -// Tests for AssertionError where "data" is unexpectedly null when -// a file contains only triple slash references (#11196) -itest!(data_null_error { - args: "info info/data_null_error/mod.ts", - output: "info/data_null_error/data_null_error.out", -}); - -itest!(types_header_direct { - args: "info --reload run/type_directives_01.ts", - output: "info/types_header.out", - http_server: true, -}); - -itest!(with_config_override { - args: "info info/with_config/test.ts --config info/with_config/deno-override.json --import-map info/with_config/import_map.json", - output: "info/with_config/with_config.out", -}); - -itest!(info_import_map { - args: "info preact/debug", - output: "info/with_import_map/with_import_map.out", - cwd: Some("info/with_import_map"), - copy_temp_dir: Some("info/with_import_map"), - exit_code: 0, -}); - -itest!(info_dynamic_imports_tmpl_lit { - args: "info compile/dynamic_imports_tmp_lit/main.js", - output: "compile/dynamic_imports_tmp_lit/main.info.out", - exit_code: 0, -}); diff --git a/tests/integration/mod.rs b/tests/integration/mod.rs index 159663233..5cbe2a2ff 100644 --- a/tests/integration/mod.rs +++ b/tests/integration/mod.rs @@ -23,8 +23,6 @@ mod eval; mod flags; #[path = "fmt_tests.rs"] mod fmt; -#[path = "info_tests.rs"] -mod info; #[path = "init_tests.rs"] mod init; #[path = "inspector_tests.rs"] diff --git a/tests/specs/info_tests/_054_info_local_imports/005_more_imports.ts b/tests/specs/info_tests/_054_info_local_imports/005_more_imports.ts new file mode 100644 index 000000000..c69556be1 --- /dev/null +++ b/tests/specs/info_tests/_054_info_local_imports/005_more_imports.ts @@ -0,0 +1,11 @@ +import { printHello3, returnsFoo2, returnsHi } from "./mod1.ts"; + +printHello3(); + +if (returnsHi() !== "Hi") { + throw Error("Unexpected"); +} + +if (returnsFoo2() !== "Foo") { + throw Error("Unexpected"); +} diff --git a/tests/specs/info_tests/_054_info_local_imports/054_info_local_imports.out b/tests/specs/info_tests/_054_info_local_imports/054_info_local_imports.out new file mode 100644 index 000000000..388168a8b --- /dev/null +++ b/tests/specs/info_tests/_054_info_local_imports/054_info_local_imports.out @@ -0,0 +1,9 @@ +local: [WILDCARD]005_more_imports.ts +type: TypeScript +dependencies: 3 unique +size: [WILDCARD] + +file://[WILDCARD]/005_more_imports.ts ([WILDCARD]) +└─┬ file://[WILDCARD]/mod1.ts ([WILDCARD]) + └─┬ file://[WILDCARD]/subdir2/mod2.ts ([WILDCARD]) + └── file://[WILDCARD]/print_hello.ts ([WILDCARD]) diff --git a/tests/specs/info_tests/_054_info_local_imports/__test__.jsonc b/tests/specs/info_tests/_054_info_local_imports/__test__.jsonc new file mode 100644 index 000000000..4bfdfe155 --- /dev/null +++ b/tests/specs/info_tests/_054_info_local_imports/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "info --quiet 005_more_imports.ts", + "output": "054_info_local_imports.out", + "exitCode": 0 +} diff --git a/tests/specs/info_tests/_054_info_local_imports/mod1.ts b/tests/specs/info_tests/_054_info_local_imports/mod1.ts new file mode 100644 index 000000000..5e58f432e --- /dev/null +++ b/tests/specs/info_tests/_054_info_local_imports/mod1.ts @@ -0,0 +1,17 @@ +import { printHello2, returnsFoo } from "./subdir2/mod2.ts"; + +export function returnsHi(): string { + return "Hi"; +} + +export function returnsFoo2(): string { + return returnsFoo(); +} + +export function printHello3() { + printHello2(); +} + +export function throwsError() { + throw Error("exception from mod1"); +} diff --git a/tests/specs/info_tests/_054_info_local_imports/mod2.ts b/tests/specs/info_tests/_054_info_local_imports/mod2.ts new file mode 100644 index 000000000..ce1adc0e8 --- /dev/null +++ b/tests/specs/info_tests/_054_info_local_imports/mod2.ts @@ -0,0 +1 @@ +export { printHello } from "./print_hello.ts"; diff --git a/tests/specs/info_tests/_054_info_local_imports/print_hello.ts b/tests/specs/info_tests/_054_info_local_imports/print_hello.ts new file mode 100644 index 000000000..b9c0ad527 --- /dev/null +++ b/tests/specs/info_tests/_054_info_local_imports/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/info_tests/_054_info_local_imports/subdir2/dynamic_import.ts b/tests/specs/info_tests/_054_info_local_imports/subdir2/dynamic_import.ts new file mode 100644 index 000000000..59beb64c3 --- /dev/null +++ b/tests/specs/info_tests/_054_info_local_imports/subdir2/dynamic_import.ts @@ -0,0 +1,4 @@ +(async () => { + const { printHello } = await import("../mod2.ts"); + printHello(); +})(); diff --git a/tests/specs/info_tests/_054_info_local_imports/subdir2/mod2.ts b/tests/specs/info_tests/_054_info_local_imports/subdir2/mod2.ts new file mode 100644 index 000000000..9071d0aeb --- /dev/null +++ b/tests/specs/info_tests/_054_info_local_imports/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/specs/info_tests/data_null_error/__test__.jsonc b/tests/specs/info_tests/data_null_error/__test__.jsonc new file mode 100644 index 000000000..782cca43d --- /dev/null +++ b/tests/specs/info_tests/data_null_error/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info data_null_error/mod.ts", + "output": "data_null_error/data_null_error.out" +} diff --git a/tests/specs/info_tests/data_null_error/data_null_error/data_null_error.out b/tests/specs/info_tests/data_null_error/data_null_error/data_null_error.out new file mode 100644 index 000000000..065396f18 --- /dev/null +++ b/tests/specs/info_tests/data_null_error/data_null_error/data_null_error.out @@ -0,0 +1,7 @@ +local: [WILDCARD]mod.ts +type: TypeScript +dependencies: 1 unique +size: [WILDCARD] + +file://[WILDCARD]/mod.ts ([WILDCARD]) +└── file://[WILDCARD]/types.d.ts ([WILDCARD]) diff --git a/tests/specs/info_tests/data_null_error/data_null_error/mod.ts b/tests/specs/info_tests/data_null_error/data_null_error/mod.ts new file mode 100644 index 000000000..6e3e99bd4 --- /dev/null +++ b/tests/specs/info_tests/data_null_error/data_null_error/mod.ts @@ -0,0 +1 @@ +/// diff --git a/tests/specs/info_tests/data_null_error/data_null_error/types.d.ts b/tests/specs/info_tests/data_null_error/data_null_error/types.d.ts new file mode 100644 index 000000000..6ecc85676 --- /dev/null +++ b/tests/specs/info_tests/data_null_error/data_null_error/types.d.ts @@ -0,0 +1 @@ +declare class Test {} diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/__test__.jsonc b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/__test__.jsonc new file mode 100644 index 000000000..71f823a46 --- /dev/null +++ b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "info dynamic_imports_tmp_lit/main.js", + "output": "dynamic_imports_tmp_lit/main.info.out", + "exitCode": 0 +} diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out new file mode 100644 index 000000000..57d730a64 --- /dev/null +++ b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out @@ -0,0 +1,10 @@ +local: [WILDCARD]main.js +type: JavaScript +dependencies: 4 unique +size: [WILDCARD] + +file:///[WILDCARD]/dynamic_imports_tmp_lit/main.js ([WILDCARD]) +├── file:///[WILDCARD]/dynamic_imports_tmp_lit/sub/a.js ([WILDCARD]) +├── file:///[WILDCARD]/dynamic_imports_tmp_lit/sub/b.ts ([WILDCARD]) +├── file:///[WILDCARD]/dynamic_imports_tmp_lit/other/data.json ([WILDCARD]) +└── file:///[WILDCARD]/dynamic_imports_tmp_lit/other/sub/data2.json ([WILDCARD]) diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js new file mode 100644 index 000000000..3bda59772 --- /dev/null +++ b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js @@ -0,0 +1,14 @@ +const fileNames = [ + "a.js", + "b.ts", +]; + +for (const fileName of fileNames) { + await import(`./sub/${fileName}`); +} + +const jsonFileNames = ["data.json", "sub/data2.json"]; +for (const fileName of jsonFileNames) { + const mod = await import(`./other/${fileName}`, { with: { type: "json" } }); + console.log(mod.default); +} diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json new file mode 100644 index 000000000..0131e01e4 --- /dev/null +++ b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json @@ -0,0 +1,3 @@ +{ + "data": 5 +} diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json new file mode 100644 index 000000000..858a13cdd --- /dev/null +++ b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json @@ -0,0 +1,3 @@ +{ + "data": 1 +} diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js new file mode 100644 index 000000000..7b2a34601 --- /dev/null +++ b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js @@ -0,0 +1 @@ +console.log("a"); diff --git a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts new file mode 100644 index 000000000..6d012e7f1 --- /dev/null +++ b/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts @@ -0,0 +1 @@ +console.log("b"); diff --git a/tests/specs/info_tests/info_flag/041_info_flag.out b/tests/specs/info_tests/info_flag/041_info_flag.out new file mode 100644 index 000000000..3506a29e4 --- /dev/null +++ b/tests/specs/info_tests/info_flag/041_info_flag.out @@ -0,0 +1,6 @@ +DENO_DIR location: [WILDCARD] +Remote modules cache: [WILDCARD]deps +npm modules cache: [WILDCARD]npm +Emitted modules cache: [WILDCARD]gen +Language server registries cache: [WILDCARD]registries +Origin storage: [WILDCARD]location_data diff --git a/tests/specs/info_tests/info_flag/__test__.jsonc b/tests/specs/info_tests/info_flag/__test__.jsonc new file mode 100644 index 000000000..39b50c960 --- /dev/null +++ b/tests/specs/info_tests/info_flag/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info", + "output": "041_info_flag.out" +} diff --git a/tests/specs/info_tests/info_flag_location/041_info_flag_location.out b/tests/specs/info_tests/info_flag_location/041_info_flag_location.out new file mode 100644 index 000000000..b9e72f659 --- /dev/null +++ b/tests/specs/info_tests/info_flag_location/041_info_flag_location.out @@ -0,0 +1,7 @@ +DENO_DIR location: [WILDCARD] +Remote modules cache: [WILDCARD]deps +npm modules cache: [WILDCARD]npm +Emitted modules cache: [WILDCARD]gen +Language server registries cache: [WILDCARD]registries +Origin storage: [WILDCARD]location_data[WILDCARD] +Local Storage: [WILDCARD]location_data[WILDCARD]local_storage diff --git a/tests/specs/info_tests/info_flag_location/__test__.jsonc b/tests/specs/info_tests/info_flag_location/__test__.jsonc new file mode 100644 index 000000000..436e7cd9a --- /dev/null +++ b/tests/specs/info_tests/info_flag_location/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --location https://deno.land", + "output": "041_info_flag_location.out" +} diff --git a/tests/specs/info_tests/info_flag_script_jsx/049_info_flag_script_jsx.out b/tests/specs/info_tests/info_flag_script_jsx/049_info_flag_script_jsx.out new file mode 100644 index 000000000..f49fc2356 --- /dev/null +++ b/tests/specs/info_tests/info_flag_script_jsx/049_info_flag_script_jsx.out @@ -0,0 +1,15 @@ +[WILDCARD] +local: [WILDCARD]http[WILDCARD]127.0.0.1_PORT4545[WILDCARD] +type: TypeScript +dependencies: 8 unique +size: [WILDCARD] + +http://127.0.0.1:4545/run/048_media_types_jsx.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_typescript_tsx.t1.tsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_video_vdn_tsx.t2.tsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_video_mp2t_tsx.t3.tsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_x_typescript_tsx.t4.tsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_javascript_jsx.j1.jsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_ecmascript_jsx.j2.jsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_ecmascript_jsx.j3.jsx ([WILDCARD]) +└── http://localhost:4545/subdir/mt_application_x_javascript_jsx.j4.jsx ([WILDCARD]) diff --git a/tests/specs/info_tests/info_flag_script_jsx/__test__.jsonc b/tests/specs/info_tests/info_flag_script_jsx/__test__.jsonc new file mode 100644 index 000000000..b8dc305ae --- /dev/null +++ b/tests/specs/info_tests/info_flag_script_jsx/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info http://127.0.0.1:4545/run/048_media_types_jsx.ts", + "output": "049_info_flag_script_jsx.out" +} diff --git a/tests/specs/info_tests/info_import_map/__test__.jsonc b/tests/specs/info_tests/info_import_map/__test__.jsonc new file mode 100644 index 000000000..725276925 --- /dev/null +++ b/tests/specs/info_tests/info_import_map/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "info preact/debug", + "output": "with_import_map.out", + "exitCode": 0 +} diff --git a/tests/specs/info_tests/info_import_map/deno.json b/tests/specs/info_tests/info_import_map/deno.json new file mode 100644 index 000000000..aaf7260c6 --- /dev/null +++ b/tests/specs/info_tests/info_import_map/deno.json @@ -0,0 +1,6 @@ +{ + "imports": { + "preact": "https://esm.sh/preact@10.15.1", + "preact/": "https://esm.sh/preact@10.15.1/" + } +} diff --git a/tests/specs/info_tests/info_import_map/deno.lock b/tests/specs/info_tests/info_import_map/deno.lock new file mode 100644 index 000000000..cb5c6ca45 --- /dev/null +++ b/tests/specs/info_tests/info_import_map/deno.lock @@ -0,0 +1,10 @@ +{ + "version": "3", + "remote": { + "https://esm.sh/preact@10.15.1": "4bfd0b2c5a2d432e0c8cda295d6b7304152ae08c85f7d0a22f91289c97085b89", + "https://esm.sh/preact@10.15.1/debug": "4bfd0b2c5a2d432e0c8cda295d6b7304152ae08c85f7d0a22f91289c97085b89", + "https://esm.sh/stable/preact@10.15.1/denonext/debug.js": "e8e5e198bd48c93d484c91c4c78af1900bd81d9bfcfd543e8ac75216f5404c10", + "https://esm.sh/stable/preact@10.15.1/denonext/devtools.js": "f61430e179a84483f8ea8dc098d7d0d46b2f0546de4027518bfcef197cd665c9", + "https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs": "30710ac1d5ff3711ae0c04eddbeb706f34f82d97489f61aaf09897bc75d2a628" + } +} diff --git a/tests/specs/info_tests/info_import_map/main.tsx b/tests/specs/info_tests/info_import_map/main.tsx new file mode 100644 index 000000000..e38f14a58 --- /dev/null +++ b/tests/specs/info_tests/info_import_map/main.tsx @@ -0,0 +1,2 @@ +import { render } from "preact"; +console.log(render); diff --git a/tests/specs/info_tests/info_import_map/with_import_map.out b/tests/specs/info_tests/info_import_map/with_import_map.out new file mode 100644 index 000000000..29dc17737 --- /dev/null +++ b/tests/specs/info_tests/info_import_map/with_import_map.out @@ -0,0 +1,16 @@ +Download https://esm.sh/preact@10.15.1/debug +Download https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs +Download https://esm.sh/stable/preact@10.15.1/denonext/devtools.js +Download https://esm.sh/stable/preact@10.15.1/denonext/debug.js +local: [WILDCARD] +type: JavaScript +dependencies: 3 unique +size: [WILDCARD] + +https://esm.sh/preact@10.15.1/debug [WILDCARD] +├── https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs [WILDCARD] +├─┬ https://esm.sh/stable/preact@10.15.1/denonext/devtools.js [WILDCARD] +│ └── https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs [WILDCARD] +└─┬ https://esm.sh/stable/preact@10.15.1/denonext/debug.js [WILDCARD] + ├── https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs [WILDCARD] + └── https://esm.sh/stable/preact@10.15.1/denonext/devtools.js [WILDCARD] diff --git a/tests/specs/info_tests/info_json/__test__.jsonc b/tests/specs/info_tests/info_json/__test__.jsonc new file mode 100644 index 000000000..4b50dc32b --- /dev/null +++ b/tests/specs/info_tests/info_json/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --json", + "output": "info_json.out" +} diff --git a/tests/specs/info_tests/info_json/info_json.out b/tests/specs/info_tests/info_json/info_json.out new file mode 100644 index 000000000..607489ca3 --- /dev/null +++ b/tests/specs/info_tests/info_json/info_json.out @@ -0,0 +1,9 @@ +{ + "version": 1, + "denoDir": "[WILDCARD]", + "modulesCache": "[WILDCARD]deps", + "npmCache": "[WILDCARD]npm", + "typescriptCache": "[WILDCARD]gen", + "registryCache": "[WILDCARD]registries", + "originStorage": "[WILDCARD]location_data" +} diff --git a/tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.out b/tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.out new file mode 100644 index 000000000..33d58da16 --- /dev/null +++ b/tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.out @@ -0,0 +1,165 @@ +{ + "roots": [ + "file://[WILDCARD]/076_info_json_deps_order.ts" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "./recursive_imports/A.ts", + "code": { + "specifier": "file://[WILDCARD]/recursive_imports/A.ts", + "span": { + "start": { + "line": 1, + "character": 18 + }, + "end": { + "line": 1, + "character": 44 + } + } + } + } + ], + "local": "[WILDCARD]076_info_json_deps_order.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/076_info_json_deps_order.ts" + }, + { + "kind": "esm", + "dependencies": [ + { + "specifier": "./B.ts", + "code": { + "specifier": "file://[WILDCARD]/recursive_imports/B.ts", + "span": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 26 + } + } + } + }, + { + "specifier": "./common.ts", + "code": { + "specifier": "file://[WILDCARD]/recursive_imports/common.ts", + "span": { + "start": { + "line": 1, + "character": 22 + }, + "end": { + "line": 1, + "character": 35 + } + } + } + } + ], + "local": "[WILDCARD]A.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/recursive_imports/A.ts" + }, + { + "kind": "esm", + "dependencies": [ + { + "specifier": "./C.ts", + "code": { + "specifier": "file://[WILDCARD]/recursive_imports/C.ts", + "span": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 26 + } + } + } + }, + { + "specifier": "./common.ts", + "code": { + "specifier": "file://[WILDCARD]/recursive_imports/common.ts", + "span": { + "start": { + "line": 1, + "character": 22 + }, + "end": { + "line": 1, + "character": 35 + } + } + } + } + ], + "local": "[WILDCARD]B.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/recursive_imports/B.ts" + }, + { + "kind": "esm", + "dependencies": [ + { + "specifier": "./A.ts", + "code": { + "specifier": "file://[WILDCARD]/recursive_imports/A.ts", + "span": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 26 + } + } + } + }, + { + "specifier": "./common.ts", + "code": { + "specifier": "file://[WILDCARD]/recursive_imports/common.ts", + "span": { + "start": { + "line": 1, + "character": 22 + }, + "end": { + "line": 1, + "character": 35 + } + } + } + } + ], + "local": "[WILDCARD]C.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/recursive_imports/C.ts" + }, + { + "kind": "esm", + "local": "[WILDCARD]common.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/recursive_imports/common.ts" + } + ], + "redirects": {}, + "version": 1, + "npmPackages": {} +} diff --git a/tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.ts b/tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.ts new file mode 100644 index 000000000..b1ae75e68 --- /dev/null +++ b/tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.ts @@ -0,0 +1,2 @@ +// deno-lint-ignore no-unused-vars +import { A } from "./recursive_imports/A.ts"; diff --git a/tests/specs/info_tests/info_json_deps_order/__test__.jsonc b/tests/specs/info_tests/info_json_deps_order/__test__.jsonc new file mode 100644 index 000000000..f474f4d38 --- /dev/null +++ b/tests/specs/info_tests/info_json_deps_order/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --json 076_info_json_deps_order.ts", + "output": "076_info_json_deps_order.out" +} diff --git a/tests/specs/info_tests/info_json_deps_order/recursive_imports/A.ts b/tests/specs/info_tests/info_json_deps_order/recursive_imports/A.ts new file mode 100644 index 000000000..43ecdbe5e --- /dev/null +++ b/tests/specs/info_tests/info_json_deps_order/recursive_imports/A.ts @@ -0,0 +1,7 @@ +import { B } from "./B.ts"; +import { thing } from "./common.ts"; + +export function A() { + thing(); + B(); +} diff --git a/tests/specs/info_tests/info_json_deps_order/recursive_imports/B.ts b/tests/specs/info_tests/info_json_deps_order/recursive_imports/B.ts new file mode 100644 index 000000000..9fff0fdc9 --- /dev/null +++ b/tests/specs/info_tests/info_json_deps_order/recursive_imports/B.ts @@ -0,0 +1,7 @@ +import { C } from "./C.ts"; +import { thing } from "./common.ts"; + +export function B() { + thing(); + C(); +} diff --git a/tests/specs/info_tests/info_json_deps_order/recursive_imports/C.ts b/tests/specs/info_tests/info_json_deps_order/recursive_imports/C.ts new file mode 100644 index 000000000..e47e77b41 --- /dev/null +++ b/tests/specs/info_tests/info_json_deps_order/recursive_imports/C.ts @@ -0,0 +1,8 @@ +import { A } from "./A.ts"; +import { thing } from "./common.ts"; + +export function C() { + if (A != null) { + thing(); + } +} diff --git a/tests/specs/info_tests/info_json_deps_order/recursive_imports/common.ts b/tests/specs/info_tests/info_json_deps_order/recursive_imports/common.ts new file mode 100644 index 000000000..2b16a7bf1 --- /dev/null +++ b/tests/specs/info_tests/info_json_deps_order/recursive_imports/common.ts @@ -0,0 +1,2 @@ +export function thing() { +} diff --git a/tests/specs/info_tests/info_json_location/__test__.jsonc b/tests/specs/info_tests/info_json_location/__test__.jsonc new file mode 100644 index 000000000..0c1acc3d9 --- /dev/null +++ b/tests/specs/info_tests/info_json_location/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --json --location https://deno.land", + "output": "info_json_location.out" +} diff --git a/tests/specs/info_tests/info_json_location/info_json_location.out b/tests/specs/info_tests/info_json_location/info_json_location.out new file mode 100644 index 000000000..004bf03db --- /dev/null +++ b/tests/specs/info_tests/info_json_location/info_json_location.out @@ -0,0 +1,10 @@ +{ + "version": 1, + "denoDir": "[WILDCARD]", + "modulesCache": "[WILDCARD]deps", + "npmCache": "[WILDCARD]npm", + "typescriptCache": "[WILDCARD]gen", + "registryCache": "[WILDCARD]registries", + "originStorage": "[WILDCARD]location_data[WILDCARD]", + "localStorage": "[WILDCARD]location_data[WILDCARD]local_storage" +} diff --git a/tests/specs/info_tests/info_missing_module/__test__.jsonc b/tests/specs/info_tests/info_missing_module/__test__.jsonc new file mode 100644 index 000000000..edc151972 --- /dev/null +++ b/tests/specs/info_tests/info_missing_module/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info error_009_missing_js_module.js", + "output": "info_missing_module.out" +} diff --git a/tests/specs/info_tests/info_missing_module/error_009_missing_js_module.js b/tests/specs/info_tests/info_missing_module/error_009_missing_js_module.js new file mode 100644 index 000000000..e6ca88934 --- /dev/null +++ b/tests/specs/info_tests/info_missing_module/error_009_missing_js_module.js @@ -0,0 +1 @@ +import "./bad-module.js"; diff --git a/tests/specs/info_tests/info_missing_module/info_missing_module.out b/tests/specs/info_tests/info_missing_module/info_missing_module.out new file mode 100644 index 000000000..c62d690c1 --- /dev/null +++ b/tests/specs/info_tests/info_missing_module/info_missing_module.out @@ -0,0 +1,7 @@ +local: [WILDCARD]error_009_missing_js_module.js +type: JavaScript +dependencies: 0 unique +size: 26B + +file://[WILDCARD]/error_009_missing_js_module.js (26B) +└── file://[WILDCARD]/bad-module.js (missing) diff --git a/tests/specs/info_tests/info_recursive_modules/__test__.jsonc b/tests/specs/info_tests/info_recursive_modules/__test__.jsonc new file mode 100644 index 000000000..c4313a2fb --- /dev/null +++ b/tests/specs/info_tests/info_recursive_modules/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "info --quiet info_recursive_imports_test.ts", + "output": "info_recursive_imports_test.out", + "exitCode": 0 +} diff --git a/tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.out b/tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.out new file mode 100644 index 000000000..3340f3859 --- /dev/null +++ b/tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.out @@ -0,0 +1,13 @@ +local: [WILDCARD]info_recursive_imports_test.ts +type: TypeScript +dependencies: 4 unique +size: [WILDCARD] + +file://[WILDCARD]/info_recursive_imports_test.ts ([WILDCARD]) +└─┬ file://[WILDCARD]/recursive_imports/A.ts ([WILDCARD]) + ├─┬ file://[WILDCARD]/recursive_imports/B.ts ([WILDCARD]) + │ ├─┬ file://[WILDCARD]/recursive_imports/C.ts ([WILDCARD]) + │ │ ├── file://[WILDCARD]/recursive_imports/A.ts * + │ │ └── file://[WILDCARD]/recursive_imports/common.ts ([WILDCARD]) + │ └── file://[WILDCARD]/recursive_imports/common.ts * + └── file://[WILDCARD]/recursive_imports/common.ts * diff --git a/tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.ts b/tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.ts new file mode 100644 index 000000000..c9ba44755 --- /dev/null +++ b/tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.ts @@ -0,0 +1,5 @@ +import { A } from "./recursive_imports/A.ts"; + +export function test() { + A(); +} diff --git a/tests/specs/info_tests/info_recursive_modules/recursive_imports/A.ts b/tests/specs/info_tests/info_recursive_modules/recursive_imports/A.ts new file mode 100644 index 000000000..43ecdbe5e --- /dev/null +++ b/tests/specs/info_tests/info_recursive_modules/recursive_imports/A.ts @@ -0,0 +1,7 @@ +import { B } from "./B.ts"; +import { thing } from "./common.ts"; + +export function A() { + thing(); + B(); +} diff --git a/tests/specs/info_tests/info_recursive_modules/recursive_imports/B.ts b/tests/specs/info_tests/info_recursive_modules/recursive_imports/B.ts new file mode 100644 index 000000000..9fff0fdc9 --- /dev/null +++ b/tests/specs/info_tests/info_recursive_modules/recursive_imports/B.ts @@ -0,0 +1,7 @@ +import { C } from "./C.ts"; +import { thing } from "./common.ts"; + +export function B() { + thing(); + C(); +} diff --git a/tests/specs/info_tests/info_recursive_modules/recursive_imports/C.ts b/tests/specs/info_tests/info_recursive_modules/recursive_imports/C.ts new file mode 100644 index 000000000..e47e77b41 --- /dev/null +++ b/tests/specs/info_tests/info_recursive_modules/recursive_imports/C.ts @@ -0,0 +1,8 @@ +import { A } from "./A.ts"; +import { thing } from "./common.ts"; + +export function C() { + if (A != null) { + thing(); + } +} diff --git a/tests/specs/info_tests/info_recursive_modules/recursive_imports/common.ts b/tests/specs/info_tests/info_recursive_modules/recursive_imports/common.ts new file mode 100644 index 000000000..2b16a7bf1 --- /dev/null +++ b/tests/specs/info_tests/info_recursive_modules/recursive_imports/common.ts @@ -0,0 +1,2 @@ +export function thing() { +} diff --git a/tests/specs/info_tests/info_type_import/__test__.jsonc b/tests/specs/info_tests/info_type_import/__test__.jsonc new file mode 100644 index 000000000..2092ecf08 --- /dev/null +++ b/tests/specs/info_tests/info_type_import/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info info_type_import.ts", + "output": "info_type_import.out" +} diff --git a/tests/specs/info_tests/info_type_import/info_type_import.out b/tests/specs/info_tests/info_type_import/info_type_import.out new file mode 100644 index 000000000..0423efe82 --- /dev/null +++ b/tests/specs/info_tests/info_type_import/info_type_import.out @@ -0,0 +1,7 @@ +local: [WILDCARD]info_type_import.ts +type: TypeScript +dependencies: 1 unique +size: [WILDCARD] + +[WILDCARD]info_type_import.ts ([WILDCARD]) +└── [WILDCARD]type_and_code.ts ([WILDCARD]) diff --git a/tests/specs/info_tests/info_type_import/info_type_import.ts b/tests/specs/info_tests/info_type_import/info_type_import.ts new file mode 100644 index 000000000..5d8ca21ce --- /dev/null +++ b/tests/specs/info_tests/info_type_import/info_type_import.ts @@ -0,0 +1,3 @@ +import { AnInterface as _, isAnInterface } from "./type_and_code.ts"; + +isAnInterface({}); diff --git a/tests/specs/info_tests/info_type_import/type_and_code.ts b/tests/specs/info_tests/info_type_import/type_and_code.ts new file mode 100644 index 000000000..b14713419 --- /dev/null +++ b/tests/specs/info_tests/info_type_import/type_and_code.ts @@ -0,0 +1,7 @@ +export interface AnInterface { + a: string; +} + +export function isAnInterface(value: unknown): value is AnInterface { + return value && typeof value === "object" && "a" in value; +} diff --git a/tests/specs/info_tests/json_file/__test__.jsonc b/tests/specs/info_tests/json_file/__test__.jsonc new file mode 100644 index 000000000..61289da94 --- /dev/null +++ b/tests/specs/info_tests/json_file/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "info --quiet --json json_output/main.ts", + "output": "json_output/main.out", + "exitCode": 0 +} diff --git a/tests/specs/info_tests/json_file/json_output/main.out b/tests/specs/info_tests/json_file/json_output/main.out new file mode 100644 index 000000000..d4c2f234d --- /dev/null +++ b/tests/specs/info_tests/json_file/json_output/main.out @@ -0,0 +1,92 @@ +{ + "roots": [ + "file://[WILDCARD]/json_output/main.ts" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "../mod1.ts", + "code": { + "specifier": "file://[WILDCARD]/mod1.ts", + "span": { + "start": { + "line": 0, + "character": 52 + }, + "end": { + "line": 0, + "character": 64 + } + } + } + } + ], + "local": "[WILDCARD]main.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/json_output/main.ts" + }, + { + "kind": "esm", + "dependencies": [ + { + "specifier": "./subdir2/mod2.ts", + "code": { + "specifier": "file://[WILDCARD]/subdir2/mod2.ts", + "span": { + "start": { + "line": 0, + "character": 40 + }, + "end": { + "line": 0, + "character": 59 + } + } + } + } + ], + "local": "[WILDCARD]mod1.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/mod1.ts" + }, + { + "kind": "esm", + "local": "[WILDCARD]print_hello.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/print_hello.ts" + }, + { + "kind": "esm", + "dependencies": [ + { + "specifier": "../print_hello.ts", + "code": { + "specifier": "file://[WILDCARD]/print_hello.ts", + "span": { + "start": { + "line": 0, + "character": 27 + }, + "end": { + "line": 0, + "character": 46 + } + } + } + } + ], + "local": "[WILDCARD]mod2.ts", + [WILDCARD] + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/subdir2/mod2.ts" + } + ], + "redirects": {}, + "version": 1, + "npmPackages": {} +} diff --git a/tests/specs/info_tests/json_file/json_output/main.ts b/tests/specs/info_tests/json_file/json_output/main.ts new file mode 100644 index 000000000..d9029af8a --- /dev/null +++ b/tests/specs/info_tests/json_file/json_output/main.ts @@ -0,0 +1,11 @@ +import { printHello3, returnsFoo2, returnsHi } from "../mod1.ts"; + +printHello3(); + +if (returnsHi() !== "Hi") { + throw Error("Unexpected"); +} + +if (returnsFoo2() !== "Foo") { + throw Error("Unexpected"); +} diff --git a/tests/specs/info_tests/json_file/mod1.ts b/tests/specs/info_tests/json_file/mod1.ts new file mode 100644 index 000000000..5e58f432e --- /dev/null +++ b/tests/specs/info_tests/json_file/mod1.ts @@ -0,0 +1,17 @@ +import { printHello2, returnsFoo } from "./subdir2/mod2.ts"; + +export function returnsHi(): string { + return "Hi"; +} + +export function returnsFoo2(): string { + return returnsFoo(); +} + +export function printHello3() { + printHello2(); +} + +export function throwsError() { + throw Error("exception from mod1"); +} diff --git a/tests/specs/info_tests/json_file/mod2.ts b/tests/specs/info_tests/json_file/mod2.ts new file mode 100644 index 000000000..ce1adc0e8 --- /dev/null +++ b/tests/specs/info_tests/json_file/mod2.ts @@ -0,0 +1 @@ +export { printHello } from "./print_hello.ts"; diff --git a/tests/specs/info_tests/json_file/print_hello.ts b/tests/specs/info_tests/json_file/print_hello.ts new file mode 100644 index 000000000..b9c0ad527 --- /dev/null +++ b/tests/specs/info_tests/json_file/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/info_tests/json_file/subdir2/dynamic_import.ts b/tests/specs/info_tests/json_file/subdir2/dynamic_import.ts new file mode 100644 index 000000000..59beb64c3 --- /dev/null +++ b/tests/specs/info_tests/json_file/subdir2/dynamic_import.ts @@ -0,0 +1,4 @@ +(async () => { + const { printHello } = await import("../mod2.ts"); + printHello(); +})(); diff --git a/tests/specs/info_tests/json_file/subdir2/mod2.ts b/tests/specs/info_tests/json_file/subdir2/mod2.ts new file mode 100644 index 000000000..9071d0aeb --- /dev/null +++ b/tests/specs/info_tests/json_file/subdir2/mod2.ts @@ -0,0 +1,9 @@ +import { printHello } from "../print_hello.ts"; + +export function returnsFoo(): string { + return "Foo"; +} + +export function printHello2() { + printHello(); +} diff --git a/tests/specs/info_tests/multiple_imports/__test__.jsonc b/tests/specs/info_tests/multiple_imports/__test__.jsonc new file mode 100644 index 000000000..b110b2d4c --- /dev/null +++ b/tests/specs/info_tests/multiple_imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info http://127.0.0.1:4545/run/019_media_types.ts", + "output": "multiple_imports.out" +} diff --git a/tests/specs/info_tests/multiple_imports/multiple_imports.out b/tests/specs/info_tests/multiple_imports/multiple_imports.out new file mode 100644 index 000000000..cb13318ca --- /dev/null +++ b/tests/specs/info_tests/multiple_imports/multiple_imports.out @@ -0,0 +1,15 @@ +[WILDCARD] +local: [WILDCARD]http[WILDCARD]127.0.0.1_PORT4545[WILDCARD] +type: TypeScript +dependencies: 8 unique +size: [WILDCARD] + +http://127.0.0.1:4545/run/019_media_types.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_typescript.t1.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_video_vdn.t2.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_video_mp2t.t3.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_x_typescript.t4.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_javascript.j1.js ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_ecmascript.j2.js ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_ecmascript.j3.js ([WILDCARD]) +└── http://localhost:4545/subdir/mt_application_x_javascript.j4.js ([WILDCARD]) diff --git a/tests/specs/info_tests/types_header_direct/__test__.jsonc b/tests/specs/info_tests/types_header_direct/__test__.jsonc new file mode 100644 index 000000000..7f9b462ef --- /dev/null +++ b/tests/specs/info_tests/types_header_direct/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --reload type_directives_01.ts", + "output": "types_header.out" +} diff --git a/tests/specs/info_tests/types_header_direct/type_directives_01.ts b/tests/specs/info_tests/types_header_direct/type_directives_01.ts new file mode 100644 index 000000000..71305824c --- /dev/null +++ b/tests/specs/info_tests/types_header_direct/type_directives_01.ts @@ -0,0 +1,3 @@ +import * as foo from "http://127.0.0.1:4545/xTypeScriptTypes.js"; + +console.log(foo.foo); diff --git a/tests/specs/info_tests/types_header_direct/types_header.out b/tests/specs/info_tests/types_header_direct/types_header.out new file mode 100644 index 000000000..722e02f77 --- /dev/null +++ b/tests/specs/info_tests/types_header_direct/types_header.out @@ -0,0 +1,9 @@ +[WILDCARD] +local: [WILDCARD]type_directives_01.ts +type: TypeScript +dependencies: 2 unique +size: [WILDCARD] + +[WILDCARD]/type_directives_01.ts ([WILDCARD]) +└─┬ http://127.0.0.1:4545/xTypeScriptTypes.js ([WILDCARD]) + └── http://127.0.0.1:4545/xTypeScriptTypes.d.ts ([WILDCARD]) diff --git a/tests/specs/info_tests/with_config_override/__test__.jsonc b/tests/specs/info_tests/with_config_override/__test__.jsonc new file mode 100644 index 000000000..02c7d2a78 --- /dev/null +++ b/tests/specs/info_tests/with_config_override/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info with_config/test.ts --config with_config/deno-override.json --import-map with_config/import_map.json", + "output": "with_config/with_config.out" +} diff --git a/tests/specs/info_tests/with_config_override/with_config/deno-override.json b/tests/specs/info_tests/with_config_override/with_config/deno-override.json new file mode 100644 index 000000000..ee44ba947 --- /dev/null +++ b/tests/specs/info_tests/with_config_override/with_config/deno-override.json @@ -0,0 +1,3 @@ +{ + "importMap": "import_map.json" +} diff --git a/tests/specs/info_tests/with_config_override/with_config/deno.json b/tests/specs/info_tests/with_config_override/with_config/deno.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/tests/specs/info_tests/with_config_override/with_config/deno.json @@ -0,0 +1 @@ +{} diff --git a/tests/specs/info_tests/with_config_override/with_config/import_map.json b/tests/specs/info_tests/with_config_override/with_config/import_map.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/tests/specs/info_tests/with_config_override/with_config/import_map.json @@ -0,0 +1 @@ +{} diff --git a/tests/specs/info_tests/with_config_override/with_config/test.ts b/tests/specs/info_tests/with_config_override/with_config/test.ts new file mode 100644 index 000000000..85ce559e8 --- /dev/null +++ b/tests/specs/info_tests/with_config_override/with_config/test.ts @@ -0,0 +1 @@ +console.log("foo"); diff --git a/tests/specs/info_tests/with_config_override/with_config/with_config.out b/tests/specs/info_tests/with_config_override/with_config/with_config.out new file mode 100644 index 000000000..95a1f30bc --- /dev/null +++ b/tests/specs/info_tests/with_config_override/with_config/with_config.out @@ -0,0 +1,7 @@ +Warning the configuration file "[WILDCARD]/deno-override.json" contains an entry for "importMap" that is being ignored. +local: [WILDCARD]test.ts +type: TypeScript +dependencies: 0 unique +size: [WILDCARD] + +file:///[WILDCARD]/test.ts ([WILDCARD]) diff --git a/tests/testdata/info/041_info_flag.out b/tests/testdata/info/041_info_flag.out deleted file mode 100644 index 3506a29e4..000000000 --- a/tests/testdata/info/041_info_flag.out +++ /dev/null @@ -1,6 +0,0 @@ -DENO_DIR location: [WILDCARD] -Remote modules cache: [WILDCARD]deps -npm modules cache: [WILDCARD]npm -Emitted modules cache: [WILDCARD]gen -Language server registries cache: [WILDCARD]registries -Origin storage: [WILDCARD]location_data diff --git a/tests/testdata/info/041_info_flag_location.out b/tests/testdata/info/041_info_flag_location.out deleted file mode 100644 index b9e72f659..000000000 --- a/tests/testdata/info/041_info_flag_location.out +++ /dev/null @@ -1,7 +0,0 @@ -DENO_DIR location: [WILDCARD] -Remote modules cache: [WILDCARD]deps -npm modules cache: [WILDCARD]npm -Emitted modules cache: [WILDCARD]gen -Language server registries cache: [WILDCARD]registries -Origin storage: [WILDCARD]location_data[WILDCARD] -Local Storage: [WILDCARD]location_data[WILDCARD]local_storage diff --git a/tests/testdata/info/049_info_flag_script_jsx.out b/tests/testdata/info/049_info_flag_script_jsx.out deleted file mode 100644 index f49fc2356..000000000 --- a/tests/testdata/info/049_info_flag_script_jsx.out +++ /dev/null @@ -1,15 +0,0 @@ -[WILDCARD] -local: [WILDCARD]http[WILDCARD]127.0.0.1_PORT4545[WILDCARD] -type: TypeScript -dependencies: 8 unique -size: [WILDCARD] - -http://127.0.0.1:4545/run/048_media_types_jsx.ts ([WILDCARD]) -├── http://localhost:4545/subdir/mt_text_typescript_tsx.t1.tsx ([WILDCARD]) -├── http://localhost:4545/subdir/mt_video_vdn_tsx.t2.tsx ([WILDCARD]) -├── http://localhost:4545/subdir/mt_video_mp2t_tsx.t3.tsx ([WILDCARD]) -├── http://localhost:4545/subdir/mt_application_x_typescript_tsx.t4.tsx ([WILDCARD]) -├── http://localhost:4545/subdir/mt_text_javascript_jsx.j1.jsx ([WILDCARD]) -├── http://localhost:4545/subdir/mt_application_ecmascript_jsx.j2.jsx ([WILDCARD]) -├── http://localhost:4545/subdir/mt_text_ecmascript_jsx.j3.jsx ([WILDCARD]) -└── http://localhost:4545/subdir/mt_application_x_javascript_jsx.j4.jsx ([WILDCARD]) diff --git a/tests/testdata/info/054_info_local_imports.out b/tests/testdata/info/054_info_local_imports.out deleted file mode 100644 index ee1773b76..000000000 --- a/tests/testdata/info/054_info_local_imports.out +++ /dev/null @@ -1,9 +0,0 @@ -local: [WILDCARD]005_more_imports.ts -type: TypeScript -dependencies: 3 unique -size: [WILDCARD] - -file://[WILDCARD]/005_more_imports.ts ([WILDCARD]) -└─┬ file://[WILDCARD]/subdir/mod1.ts ([WILDCARD]) - └─┬ file://[WILDCARD]/subdir/subdir2/mod2.ts ([WILDCARD]) - └── file://[WILDCARD]/subdir/print_hello.ts ([WILDCARD]) diff --git a/tests/testdata/info/076_info_json_deps_order.out b/tests/testdata/info/076_info_json_deps_order.out deleted file mode 100644 index 33d58da16..000000000 --- a/tests/testdata/info/076_info_json_deps_order.out +++ /dev/null @@ -1,165 +0,0 @@ -{ - "roots": [ - "file://[WILDCARD]/076_info_json_deps_order.ts" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "./recursive_imports/A.ts", - "code": { - "specifier": "file://[WILDCARD]/recursive_imports/A.ts", - "span": { - "start": { - "line": 1, - "character": 18 - }, - "end": { - "line": 1, - "character": 44 - } - } - } - } - ], - "local": "[WILDCARD]076_info_json_deps_order.ts", - [WILDCARD] - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/076_info_json_deps_order.ts" - }, - { - "kind": "esm", - "dependencies": [ - { - "specifier": "./B.ts", - "code": { - "specifier": "file://[WILDCARD]/recursive_imports/B.ts", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 26 - } - } - } - }, - { - "specifier": "./common.ts", - "code": { - "specifier": "file://[WILDCARD]/recursive_imports/common.ts", - "span": { - "start": { - "line": 1, - "character": 22 - }, - "end": { - "line": 1, - "character": 35 - } - } - } - } - ], - "local": "[WILDCARD]A.ts", - [WILDCARD] - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/recursive_imports/A.ts" - }, - { - "kind": "esm", - "dependencies": [ - { - "specifier": "./C.ts", - "code": { - "specifier": "file://[WILDCARD]/recursive_imports/C.ts", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 26 - } - } - } - }, - { - "specifier": "./common.ts", - "code": { - "specifier": "file://[WILDCARD]/recursive_imports/common.ts", - "span": { - "start": { - "line": 1, - "character": 22 - }, - "end": { - "line": 1, - "character": 35 - } - } - } - } - ], - "local": "[WILDCARD]B.ts", - [WILDCARD] - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/recursive_imports/B.ts" - }, - { - "kind": "esm", - "dependencies": [ - { - "specifier": "./A.ts", - "code": { - "specifier": "file://[WILDCARD]/recursive_imports/A.ts", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 26 - } - } - } - }, - { - "specifier": "./common.ts", - "code": { - "specifier": "file://[WILDCARD]/recursive_imports/common.ts", - "span": { - "start": { - "line": 1, - "character": 22 - }, - "end": { - "line": 1, - "character": 35 - } - } - } - } - ], - "local": "[WILDCARD]C.ts", - [WILDCARD] - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/recursive_imports/C.ts" - }, - { - "kind": "esm", - "local": "[WILDCARD]common.ts", - [WILDCARD] - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/recursive_imports/common.ts" - } - ], - "redirects": {}, - "version": 1, - "npmPackages": {} -} diff --git a/tests/testdata/info/076_info_json_deps_order.ts b/tests/testdata/info/076_info_json_deps_order.ts deleted file mode 100644 index b1ae75e68..000000000 --- a/tests/testdata/info/076_info_json_deps_order.ts +++ /dev/null @@ -1,2 +0,0 @@ -// deno-lint-ignore no-unused-vars -import { A } from "./recursive_imports/A.ts"; diff --git a/tests/testdata/info/data_null_error/data_null_error.out b/tests/testdata/info/data_null_error/data_null_error.out deleted file mode 100644 index 065396f18..000000000 --- a/tests/testdata/info/data_null_error/data_null_error.out +++ /dev/null @@ -1,7 +0,0 @@ -local: [WILDCARD]mod.ts -type: TypeScript -dependencies: 1 unique -size: [WILDCARD] - -file://[WILDCARD]/mod.ts ([WILDCARD]) -└── file://[WILDCARD]/types.d.ts ([WILDCARD]) diff --git a/tests/testdata/info/data_null_error/mod.ts b/tests/testdata/info/data_null_error/mod.ts deleted file mode 100644 index 6e3e99bd4..000000000 --- a/tests/testdata/info/data_null_error/mod.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/tests/testdata/info/data_null_error/types.d.ts b/tests/testdata/info/data_null_error/types.d.ts deleted file mode 100644 index 6ecc85676..000000000 --- a/tests/testdata/info/data_null_error/types.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare class Test {} diff --git a/tests/testdata/info/info_json.out b/tests/testdata/info/info_json.out deleted file mode 100644 index 607489ca3..000000000 --- a/tests/testdata/info/info_json.out +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 1, - "denoDir": "[WILDCARD]", - "modulesCache": "[WILDCARD]deps", - "npmCache": "[WILDCARD]npm", - "typescriptCache": "[WILDCARD]gen", - "registryCache": "[WILDCARD]registries", - "originStorage": "[WILDCARD]location_data" -} diff --git a/tests/testdata/info/info_json_location.out b/tests/testdata/info/info_json_location.out deleted file mode 100644 index 004bf03db..000000000 --- a/tests/testdata/info/info_json_location.out +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 1, - "denoDir": "[WILDCARD]", - "modulesCache": "[WILDCARD]deps", - "npmCache": "[WILDCARD]npm", - "typescriptCache": "[WILDCARD]gen", - "registryCache": "[WILDCARD]registries", - "originStorage": "[WILDCARD]location_data[WILDCARD]", - "localStorage": "[WILDCARD]location_data[WILDCARD]local_storage" -} diff --git a/tests/testdata/info/info_missing_module.out b/tests/testdata/info/info_missing_module.out deleted file mode 100644 index c62d690c1..000000000 --- a/tests/testdata/info/info_missing_module.out +++ /dev/null @@ -1,7 +0,0 @@ -local: [WILDCARD]error_009_missing_js_module.js -type: JavaScript -dependencies: 0 unique -size: 26B - -file://[WILDCARD]/error_009_missing_js_module.js (26B) -└── file://[WILDCARD]/bad-module.js (missing) diff --git a/tests/testdata/info/info_recursive_imports_test.out b/tests/testdata/info/info_recursive_imports_test.out deleted file mode 100644 index 3340f3859..000000000 --- a/tests/testdata/info/info_recursive_imports_test.out +++ /dev/null @@ -1,13 +0,0 @@ -local: [WILDCARD]info_recursive_imports_test.ts -type: TypeScript -dependencies: 4 unique -size: [WILDCARD] - -file://[WILDCARD]/info_recursive_imports_test.ts ([WILDCARD]) -└─┬ file://[WILDCARD]/recursive_imports/A.ts ([WILDCARD]) - ├─┬ file://[WILDCARD]/recursive_imports/B.ts ([WILDCARD]) - │ ├─┬ file://[WILDCARD]/recursive_imports/C.ts ([WILDCARD]) - │ │ ├── file://[WILDCARD]/recursive_imports/A.ts * - │ │ └── file://[WILDCARD]/recursive_imports/common.ts ([WILDCARD]) - │ └── file://[WILDCARD]/recursive_imports/common.ts * - └── file://[WILDCARD]/recursive_imports/common.ts * diff --git a/tests/testdata/info/info_type_import.out b/tests/testdata/info/info_type_import.out deleted file mode 100644 index 0423efe82..000000000 --- a/tests/testdata/info/info_type_import.out +++ /dev/null @@ -1,7 +0,0 @@ -local: [WILDCARD]info_type_import.ts -type: TypeScript -dependencies: 1 unique -size: [WILDCARD] - -[WILDCARD]info_type_import.ts ([WILDCARD]) -└── [WILDCARD]type_and_code.ts ([WILDCARD]) diff --git a/tests/testdata/info/json_output/main.out b/tests/testdata/info/json_output/main.out deleted file mode 100644 index 43c4f7398..000000000 --- a/tests/testdata/info/json_output/main.out +++ /dev/null @@ -1,92 +0,0 @@ -{ - "roots": [ - "file://[WILDCARD]/info/json_output/main.ts" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "../../subdir/mod1.ts", - "code": { - "specifier": "file://[WILDCARD]/subdir/mod1.ts", - "span": { - "start": { - "line": 0, - "character": 52 - }, - "end": { - "line": 0, - "character": 74 - } - } - } - } - ], - "local": "[WILDCARD]main.ts", - [WILDCARD] - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/json_output/main.ts" - }, - { - "kind": "esm", - "dependencies": [ - { - "specifier": "./subdir2/mod2.ts", - "code": { - "specifier": "file://[WILDCARD]/subdir/subdir2/mod2.ts", - "span": { - "start": { - "line": 0, - "character": 40 - }, - "end": { - "line": 0, - "character": 59 - } - } - } - } - ], - "local": "[WILDCARD]mod1.ts", - [WILDCARD] - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/subdir/mod1.ts" - }, - { - "kind": "esm", - "local": "[WILDCARD]print_hello.ts", - [WILDCARD] - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/subdir/print_hello.ts" - }, - { - "kind": "esm", - "dependencies": [ - { - "specifier": "../print_hello.ts", - "code": { - "specifier": "file://[WILDCARD]/subdir/print_hello.ts", - "span": { - "start": { - "line": 0, - "character": 27 - }, - "end": { - "line": 0, - "character": 46 - } - } - } - } - ], - "local": "[WILDCARD]mod2.ts", - [WILDCARD] - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/subdir/subdir2/mod2.ts" - } - ], - "redirects": {}, - "version": 1, - "npmPackages": {} -} diff --git a/tests/testdata/info/json_output/main.ts b/tests/testdata/info/json_output/main.ts deleted file mode 100644 index 927bc55ed..000000000 --- a/tests/testdata/info/json_output/main.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { printHello3, returnsFoo2, returnsHi } from "../../subdir/mod1.ts"; - -printHello3(); - -if (returnsHi() !== "Hi") { - throw Error("Unexpected"); -} - -if (returnsFoo2() !== "Foo") { - throw Error("Unexpected"); -} diff --git a/tests/testdata/info/multiple_imports.out b/tests/testdata/info/multiple_imports.out deleted file mode 100644 index cb13318ca..000000000 --- a/tests/testdata/info/multiple_imports.out +++ /dev/null @@ -1,15 +0,0 @@ -[WILDCARD] -local: [WILDCARD]http[WILDCARD]127.0.0.1_PORT4545[WILDCARD] -type: TypeScript -dependencies: 8 unique -size: [WILDCARD] - -http://127.0.0.1:4545/run/019_media_types.ts ([WILDCARD]) -├── http://localhost:4545/subdir/mt_text_typescript.t1.ts ([WILDCARD]) -├── http://localhost:4545/subdir/mt_video_vdn.t2.ts ([WILDCARD]) -├── http://localhost:4545/subdir/mt_video_mp2t.t3.ts ([WILDCARD]) -├── http://localhost:4545/subdir/mt_application_x_typescript.t4.ts ([WILDCARD]) -├── http://localhost:4545/subdir/mt_text_javascript.j1.js ([WILDCARD]) -├── http://localhost:4545/subdir/mt_application_ecmascript.j2.js ([WILDCARD]) -├── http://localhost:4545/subdir/mt_text_ecmascript.j3.js ([WILDCARD]) -└── http://localhost:4545/subdir/mt_application_x_javascript.j4.js ([WILDCARD]) diff --git a/tests/testdata/info/types_header.out b/tests/testdata/info/types_header.out deleted file mode 100644 index 722e02f77..000000000 --- a/tests/testdata/info/types_header.out +++ /dev/null @@ -1,9 +0,0 @@ -[WILDCARD] -local: [WILDCARD]type_directives_01.ts -type: TypeScript -dependencies: 2 unique -size: [WILDCARD] - -[WILDCARD]/type_directives_01.ts ([WILDCARD]) -└─┬ http://127.0.0.1:4545/xTypeScriptTypes.js ([WILDCARD]) - └── http://127.0.0.1:4545/xTypeScriptTypes.d.ts ([WILDCARD]) diff --git a/tests/testdata/info/with_config/deno-override.json b/tests/testdata/info/with_config/deno-override.json deleted file mode 100644 index ee44ba947..000000000 --- a/tests/testdata/info/with_config/deno-override.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "importMap": "import_map.json" -} diff --git a/tests/testdata/info/with_config/deno.json b/tests/testdata/info/with_config/deno.json deleted file mode 100644 index 0967ef424..000000000 --- a/tests/testdata/info/with_config/deno.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/tests/testdata/info/with_config/import_map.json b/tests/testdata/info/with_config/import_map.json deleted file mode 100644 index 0967ef424..000000000 --- a/tests/testdata/info/with_config/import_map.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/tests/testdata/info/with_config/test.ts b/tests/testdata/info/with_config/test.ts deleted file mode 100644 index 85ce559e8..000000000 --- a/tests/testdata/info/with_config/test.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("foo"); diff --git a/tests/testdata/info/with_config/with_config.out b/tests/testdata/info/with_config/with_config.out deleted file mode 100644 index 95a1f30bc..000000000 --- a/tests/testdata/info/with_config/with_config.out +++ /dev/null @@ -1,7 +0,0 @@ -Warning the configuration file "[WILDCARD]/deno-override.json" contains an entry for "importMap" that is being ignored. -local: [WILDCARD]test.ts -type: TypeScript -dependencies: 0 unique -size: [WILDCARD] - -file:///[WILDCARD]/test.ts ([WILDCARD]) diff --git a/tests/testdata/info/with_import_map/deno.json b/tests/testdata/info/with_import_map/deno.json deleted file mode 100644 index aaf7260c6..000000000 --- a/tests/testdata/info/with_import_map/deno.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "imports": { - "preact": "https://esm.sh/preact@10.15.1", - "preact/": "https://esm.sh/preact@10.15.1/" - } -} diff --git a/tests/testdata/info/with_import_map/deno.lock b/tests/testdata/info/with_import_map/deno.lock deleted file mode 100644 index cb5c6ca45..000000000 --- a/tests/testdata/info/with_import_map/deno.lock +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": "3", - "remote": { - "https://esm.sh/preact@10.15.1": "4bfd0b2c5a2d432e0c8cda295d6b7304152ae08c85f7d0a22f91289c97085b89", - "https://esm.sh/preact@10.15.1/debug": "4bfd0b2c5a2d432e0c8cda295d6b7304152ae08c85f7d0a22f91289c97085b89", - "https://esm.sh/stable/preact@10.15.1/denonext/debug.js": "e8e5e198bd48c93d484c91c4c78af1900bd81d9bfcfd543e8ac75216f5404c10", - "https://esm.sh/stable/preact@10.15.1/denonext/devtools.js": "f61430e179a84483f8ea8dc098d7d0d46b2f0546de4027518bfcef197cd665c9", - "https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs": "30710ac1d5ff3711ae0c04eddbeb706f34f82d97489f61aaf09897bc75d2a628" - } -} diff --git a/tests/testdata/info/with_import_map/main.tsx b/tests/testdata/info/with_import_map/main.tsx deleted file mode 100644 index e38f14a58..000000000 --- a/tests/testdata/info/with_import_map/main.tsx +++ /dev/null @@ -1,2 +0,0 @@ -import { render } from "preact"; -console.log(render); diff --git a/tests/testdata/info/with_import_map/with_import_map.out b/tests/testdata/info/with_import_map/with_import_map.out deleted file mode 100644 index 29dc17737..000000000 --- a/tests/testdata/info/with_import_map/with_import_map.out +++ /dev/null @@ -1,16 +0,0 @@ -Download https://esm.sh/preact@10.15.1/debug -Download https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs -Download https://esm.sh/stable/preact@10.15.1/denonext/devtools.js -Download https://esm.sh/stable/preact@10.15.1/denonext/debug.js -local: [WILDCARD] -type: JavaScript -dependencies: 3 unique -size: [WILDCARD] - -https://esm.sh/preact@10.15.1/debug [WILDCARD] -├── https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs [WILDCARD] -├─┬ https://esm.sh/stable/preact@10.15.1/denonext/devtools.js [WILDCARD] -│ └── https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs [WILDCARD] -└─┬ https://esm.sh/stable/preact@10.15.1/denonext/debug.js [WILDCARD] - ├── https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs [WILDCARD] - └── https://esm.sh/stable/preact@10.15.1/denonext/devtools.js [WILDCARD] diff --git a/tools/lint.js b/tools/lint.js index 013bd4930..bcbf1c27e 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -204,7 +204,6 @@ async function ensureNoNewITests() { "eval_tests.rs": 0, "flags_tests.rs": 0, "fmt_tests.rs": 16, - "info_tests.rs": 17, "init_tests.rs": 0, "inspector_tests.rs": 0, "install_tests.rs": 0, -- cgit v1.2.3