From 5504acea6751480f1425c88353ad5d36257bdce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 26 Sep 2024 02:50:54 +0100 Subject: feat: add `--allow-import` flag (#25469) This replaces `--allow-net` for import permissions and makes the security sandbox stricter by also checking permissions for statically analyzable imports. By default, this has a value of `--allow-import=deno.land:443,jsr.io:443,esm.sh:443,raw.githubusercontent.com:443,gist.githubusercontent.com:443`, but that can be overridden by providing a different set of hosts. Additionally, when no value is provided, import permissions are inferred from the CLI arguments so the following works because `fresh.deno.dev:443` will be added to the list of allowed imports: ```ts deno run -A -r https://fresh.deno.dev ``` --------- Co-authored-by: David Sherret --- tests/integration/cache_tests.rs | 2 +- tests/integration/check_tests.rs | 5 +- tests/integration/compile_tests.rs | 2 + tests/integration/coverage_tests.rs | 1 + tests/integration/install_tests.rs | 4 +- tests/integration/lsp_tests.rs | 2 +- tests/integration/run_tests.rs | 199 ++++++----- tests/integration/watcher_tests.rs | 1 + .../bench/check_local_by_default/__test__.jsonc | 2 +- .../bench/check_local_by_default2/__test__.jsonc | 2 +- .../cache/check_local_by_default/__test__.jsonc | 2 +- .../cache/check_local_by_default2/__test__.jsonc | 2 +- tests/specs/cache/fetch_multiple/__test__.jsonc | 2 +- tests/specs/cache/globbing/__test__.jsonc | 2 +- tests/specs/cache/redirect/__test__.jsonc | 2 +- tests/specs/cert/cafile_ts_fetch/__test__.jsonc | 6 +- tests/specs/cert/cafile_url_imports/__test__.jsonc | 2 +- .../cafile_url_imports_unsafe_ssl/__test__.jsonc | 2 +- .../specs/cert/localhost_unsafe_ssl/__test__.jsonc | 2 +- .../check/jsx_import_source_types/__test__.jsonc | 2 +- .../jsx_import_source_types_config/__test__.jsonc | 2 +- .../check/remote_missing_override/__test__.jsonc | 2 +- .../repetitive_unstable_flag/__test__.jsonc | 1 + tests/specs/doc/types_header/__test__.jsonc | 2 +- tests/specs/doc/types_header_direct/__test__.jsonc | 2 +- .../_054_info_local_imports/005_more_imports.ts | 11 + .../054_info_local_imports.out | 9 + .../info/_054_info_local_imports/__test__.jsonc | 5 + tests/specs/info/_054_info_local_imports/mod1.ts | 17 + tests/specs/info/_054_info_local_imports/mod2.ts | 1 + .../info/_054_info_local_imports/print_hello.ts | 3 + .../subdir2/dynamic_import.ts | 4 + .../info/_054_info_local_imports/subdir2/mod2.ts | 9 + tests/specs/info/data_null_error/__test__.jsonc | 4 + .../data_null_error/data_null_error.out | 7 + .../info/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/flag/041_info_flag.out | 6 + tests/specs/info/flag/__test__.jsonc | 4 + .../info/flag_location/041_info_flag_location.out | 7 + tests/specs/info/flag_location/__test__.jsonc | 4 + .../flag_script_jsx/049_info_flag_script_jsx.out | 15 + tests/specs/info/flag_script_jsx/__test__.jsonc | 4 + tests/specs/info/import_map/__test__.jsonc | 5 + tests/specs/info/import_map/deno.json | 6 + tests/specs/info/import_map/deno.lock | 10 + tests/specs/info/import_map/main.tsx | 2 + tests/specs/info/import_map/with_import_map.out | 16 + tests/specs/info/json/__test__.jsonc | 4 + tests/specs/info/json/info_json.out | 9 + .../json_deps_order/076_info_json_deps_order.out | 165 +++++++++ .../json_deps_order/076_info_json_deps_order.ts | 2 + tests/specs/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 + .../json_deps_order/recursive_imports/common.ts | 2 + tests/specs/info/json_file/__test__.jsonc | 5 + tests/specs/info/json_file/json_output/main.out | 92 +++++ tests/specs/info/json_file/json_output/main.ts | 11 + tests/specs/info/json_file/mod1.ts | 17 + tests/specs/info/json_file/mod2.ts | 1 + tests/specs/info/json_file/print_hello.ts | 3 + .../specs/info/json_file/subdir2/dynamic_import.ts | 4 + tests/specs/info/json_file/subdir2/mod2.ts | 9 + tests/specs/info/json_location/__test__.jsonc | 4 + .../info/json_location/info_json_location.out | 10 + tests/specs/info/missing_module/__test__.jsonc | 4 + .../missing_module/error_009_missing_js_module.js | 1 + .../info/missing_module/info_missing_module.out | 7 + tests/specs/info/multiple_imports/__test__.jsonc | 4 + .../info/multiple_imports/multiple_imports.out | 15 + tests/specs/info/multiple_redirects/__test__.jsonc | 2 +- tests/specs/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_modules/recursive_imports/common.ts | 2 + tests/specs/info/type_import/__test__.jsonc | 4 + tests/specs/info/type_import/info_type_import.out | 7 + tests/specs/info/type_import/info_type_import.ts | 3 + tests/specs/info/type_import/type_and_code.ts | 7 + .../specs/info/types_header_direct/__test__.jsonc | 4 + .../info/types_header_direct/type_directives_01.ts | 3 + .../info/types_header_direct/types_header.out | 9 + .../specs/info/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 + .../info/with_config_override/with_config/test.ts | 1 + .../with_config/with_config.out | 7 + .../_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 - .../future_install_local_deno/__test__.jsonc | 4 +- .../specs/lockfile/adding_redirect/__test__.jsonc | 4 +- .../lockfile/auto_discover_lockfile/__test__.jsonc | 2 +- .../config_file_lock_boolean/__test__.jsonc | 4 +- .../lockfile/config_file_lock_path/__test__.jsonc | 4 +- .../specs/lockfile/frozen_lockfile/__test__.jsonc | 2 +- .../lockfile/no_declaration_files/__test__.jsonc | 2 +- tests/specs/lockfile/no_lock/__test__.jsonc | 16 +- .../__test__.jsonc | 5 + .../process_beforeexit_exit_events.out | 2 + .../process_beforeexit_exit_events.ts | 9 + tests/specs/node/node_test_module/__test__.jsonc | 9 + tests/specs/node/node_test_module/test.js | 390 +++++++++++++++++++++ tests/specs/node/node_test_module/test.out | 175 +++++++++ .../node_test_module_no_sanitizers/__test__.jsonc | 9 + .../test_no_sanitizers/cat.ts | 4 + .../test_no_sanitizers/test.js | 28 ++ .../test_no_sanitizers/test.out | 7 + .../test_no_sanitizers/welcome.ts | 1 + .../__test__.jsonc | 5 + .../events_order.out | 12 + .../events_order.ts | 25 ++ .../__test__.jsonc | 5 - .../process_beforeexit_exit_events.out | 2 - .../process_beforeexit_exit_events.ts | 9 - .../node_test_module/__test__.jsonc | 9 - .../node_compat_tests/node_test_module/test.js | 390 --------------------- .../node_compat_tests/node_test_module/test.out | 175 --------- .../node_test_module_no_sanitizers/__test__.jsonc | 9 - .../test_no_sanitizers/cat.ts | 4 - .../test_no_sanitizers/test.js | 28 -- .../test_no_sanitizers/test.out | 7 - .../test_no_sanitizers/welcome.ts | 1 - .../__test__.jsonc | 5 - .../events_order.out | 12 - .../events_order.ts | 25 -- .../specs/npm/builtin_module_module/__test__.jsonc | 8 + .../builtin_module_module/main.js | 1 + .../builtin_module_module/main.out | 4 + tests/specs/npm/cached_only/__test__.jsonc | 9 + tests/specs/npm/cached_only/cached_only/main.out | 2 + tests/specs/npm/cached_only/cached_only/main.ts | 3 + tests/specs/npm/check_all/__test__.jsonc | 9 + tests/specs/npm/check_all/check_errors/main.ts | 3 + .../specs/npm/check_all/check_errors/main_all.out | 19 + .../npm/check_all/check_errors/main_local.out | 7 + tests/specs/npm/check_local/__test__.jsonc | 9 + tests/specs/npm/check_local/check_errors/main.ts | 3 + .../npm/check_local/check_errors/main_all.out | 19 + .../npm/check_local/check_errors/main_local.out | 7 + .../__test__.jsonc | 9 + .../file_dts_dmts_dcts/main.out | 24 ++ .../file_dts_dmts_dcts/main.ts | 9 + .../npm/child_process_fork_test/__test__.jsonc | 8 + .../child_process_fork_test/main.out | 2 + .../child_process_fork_test/main.ts | 4 + .../npm/cjs_invalid_name_exports/__test__.jsonc | 8 + .../cjs-invalid-name-exports/main.out | 13 + .../cjs-invalid-name-exports/main.ts | 3 + .../npm/cjs_local_global_decls/__test__.jsonc | 8 + .../cjs_local_global_decls/main.out | 3 + .../cjs_local_global_decls/main.ts | 1 + .../cjs_module_export_assignment/__test__.jsonc | 8 + .../cjs_module_export_assignment/main.out | 6 + .../cjs_module_export_assignment/main.ts | 6 + .../__test__.jsonc | 8 + .../cjs_module_export_assignment_number/main.out | 3 + .../cjs_module_export_assignment_number/main.ts | 7 + tests/specs/npm/cjs_pkg_imports/__test__.jsonc | 8 + .../npm/cjs_pkg_imports/cjs_pkg_imports/main.out | 3 + .../npm/cjs_pkg_imports/cjs_pkg_imports/main.ts | 3 + .../npm/cjs_reexport_collision/__test__.jsonc | 8 + .../cjs_reexport_collision/main.out | 1 + .../cjs_reexport_collision/main.ts | 2 + tests/specs/npm/cjs_require_esm/__test__.jsonc | 8 + .../npm/cjs_require_esm/cjs_require_esm/main.out | 4 + .../npm/cjs_require_esm/cjs_require_esm/main.ts | 2 + tests/specs/npm/cjs_require_esm_mjs/__test__.jsonc | 8 + .../cjs_require_esm_mjs/main.out | 4 + .../cjs_require_esm_mjs/main.ts | 2 + tests/specs/npm/cjs_sub_path/__test__.jsonc | 8 + tests/specs/npm/cjs_sub_path/cjs_sub_path/main.js | 21 ++ tests/specs/npm/cjs_sub_path/cjs_sub_path/main.out | 35 ++ tests/specs/npm/cjs_this_in_exports/__test__.jsonc | 9 + .../cjs_this_in_exports/main.js | 11 + .../cjs_this_in_exports/main.out | 5 + tests/specs/npm/cjs_with_deps/__test__.jsonc | 8 + .../specs/npm/cjs_with_deps/cjs_with_deps/main.js | 12 + .../specs/npm/cjs_with_deps/cjs_with_deps/main.out | 33 ++ .../npm/cjs_with_deps/cjs_with_deps/main_info.out | 22 ++ .../cjs_with_deps/cjs_with_deps/main_info_json.out | 148 ++++++++ .../cjs_with_deps/main_node_modules.out | 47 +++ tests/specs/npm/compare_globals/__test__.jsonc | 8 + .../npm/compare_globals/compare_globals/main.out | 30 ++ .../npm/compare_globals/compare_globals/main.ts | 54 +++ tests/specs/npm/create_require/__test__.jsonc | 9 + .../npm/create_require/create_require/main.out | 12 + .../npm/create_require/create_require/main.ts | 1 + tests/specs/npm/deno_cache/__test__.jsonc | 8 + tests/specs/npm/deno_cache/deno_cache.out | 8 + tests/specs/npm/deno_run_bin_cjs/__test__.jsonc | 8 + tests/specs/npm/deno_run_bin_cjs/deno_run_cjs.out | 4 + .../__test__.jsonc | 8 + .../deno_run_cjs.out | 4 + tests/specs/npm/deno_run_bin_esm/__test__.jsonc | 8 + tests/specs/npm/deno_run_bin_esm/deno_run_esm.out | 4 + .../__test__.jsonc | 8 + .../deno_run_esm.out | 4 + tests/specs/npm/deno_run_bin_no_ext/__test__.jsonc | 8 + .../npm/deno_run_bin_no_ext/deno_run_no_ext.out | 4 + .../npm/deno_run_bin_special_chars/__test__.jsonc | 8 + .../deno_run_special_chars_in_bin_name.out | 4 + tests/specs/npm/deno_run_cowsay/__test__.jsonc | 8 + .../specs/npm/deno_run_cowsay/deno_run_cowsay.out | 8 + .../npm/deno_run_cowsay_explicit/__test__.jsonc | 8 + .../deno_run_cowsay_explicit/deno_run_cowsay.out | 8 + .../__test__.jsonc | 9 + .../deno_run_cowsay.out | 8 + tests/specs/npm/deno_run_cowthink/__test__.jsonc | 8 + .../npm/deno_run_cowthink/deno_run_cowthink.out | 8 + .../npm/deno_run_no_bin_entrypoint/__test__.jsonc | 9 + .../deno_run_no_bin_entrypoint.out | 1 + .../__test__.jsonc | 9 + ..._run_no_bin_entrypoint_non_existent_subpath.out | 3 + .../specs/npm/deno_run_non_existent/__test__.jsonc | 9 + .../deno_run_non_existent.out | 2 + .../__test__.jsonc | 9 + .../different_nested_dep/main.js | 5 + .../different_nested_dep/main.out | 2 + .../different_nested_dep/package.json | 6 + .../__test__.jsonc | 10 + .../different_nested_dep/main.js | 5 + .../different_nested_dep/main.out | 2 + .../different_nested_dep/package.json | 6 + .../__test__.jsonc | 9 + .../directory_import/folder_index_js.out | 7 + .../directory_import/folder_index_js.ts | 2 + .../directory_import/folder_no_index.out | 6 + .../directory_import/folder_no_index.ts | 2 + .../__test__.jsonc | 9 + .../directory_import/folder_index_js.out | 7 + .../directory_import/folder_index_js.ts | 2 + .../directory_import/folder_no_index.out | 6 + .../directory_import/folder_no_index.ts | 2 + tests/specs/npm/dual_cjs_esm/__test__.jsonc | 8 + tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.out | 3 + tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.ts | 6 + .../dynamic_import_deno_ts_from_npm/__test__.jsonc | 8 + .../dynamic_import_deno_ts_from_npm/add.ts | 3 + .../dynamic_import_deno_ts_from_npm/main.out | 2 + .../dynamic_import_deno_ts_from_npm/main.ts | 8 + .../dynamic_import_deno_ts_from_npm/subtract.mts | 3 + .../__test__.jsonc | 8 + .../dynamic_import_invalid_package_name/main.out | 6 + .../dynamic_import_invalid_package_name/main.ts | 6 + tests/specs/npm/dynamic_import_json/__test__.jsonc | 8 + .../npm/dynamic_import_json/import_json/main.js | 4 + .../npm/dynamic_import_json/import_json/main.out | 10 + .../__test__.jsonc | 8 + .../dynamic_import_reload_same_package/main.out | 5 + .../dynamic_import_reload_same_package/main.ts | 7 + .../dynamic_import_reload_same_package/other.ts | 3 + .../specs/npm/env_var_re_export_dev/__test__.jsonc | 8 + .../env_var_re_export/main.js | 3 + .../npm/env_var_re_export_prod/__test__.jsonc | 9 + .../env_var_re_export/main.js | 3 + .../npm/error_version_after_subpath/__test__.jsonc | 9 + .../error_version_after_subpath/main.js | 1 + .../error_version_after_subpath/main.out | 2 + tests/specs/npm/import_json/__test__.jsonc | 8 + tests/specs/npm/import_json/import_json/main.js | 4 + tests/specs/npm/import_json/import_json/main.out | 10 + tests/specs/npm/import_map/__test__.jsonc | 8 + .../npm/import_map/import_map/import_map.json | 6 + tests/specs/npm/import_map/import_map/main.js | 10 + tests/specs/npm/import_map/import_map/main.out | 10 + .../specs/npm/imports_package_json/__test__.jsonc | 8 + .../imports_package_json/import_not_defined.js | 3 + .../imports_package_json/import_not_defined.out | 3 + .../imports_package_json/main.js | 7 + .../imports_package_json/main.out | 7 + .../imports_package_json/package.json | 6 + .../sub_path_import_not_defined.js | 3 + .../sub_path_import_not_defined.out | 3 + .../__test__.jsonc | 9 + .../imports_package_json/import_not_defined.js | 3 + .../imports_package_json/import_not_defined.out | 3 + .../imports_package_json/main.js | 7 + .../imports_package_json/main.out | 7 + .../imports_package_json/package.json | 6 + .../sub_path_import_not_defined.js | 3 + .../sub_path_import_not_defined.out | 3 + .../__test__.jsonc | 9 + .../imports_package_json/import_not_defined.js | 3 + .../imports_package_json/import_not_defined.out | 3 + .../imports_package_json/main.js | 7 + .../imports_package_json/main.out | 7 + .../imports_package_json/package.json | 6 + .../sub_path_import_not_defined.js | 3 + .../sub_path_import_not_defined.out | 3 + tests/specs/npm/info_chalk_display/__test__.jsonc | 9 + .../npm/info_chalk_display/cjs_with_deps/main.js | 12 + .../npm/info_chalk_display/cjs_with_deps/main.out | 33 ++ .../info_chalk_display/cjs_with_deps/main_info.out | 22 ++ .../cjs_with_deps/main_info_json.out | 148 ++++++++ .../cjs_with_deps/main_node_modules.out | 47 +++ .../__test__.jsonc | 10 + .../cjs_with_deps/main.js | 12 + .../cjs_with_deps/main.out | 33 ++ .../cjs_with_deps/main_info.out | 22 ++ .../cjs_with_deps/main_info_json.out | 148 ++++++++ .../cjs_with_deps/main_node_modules.out | 47 +++ tests/specs/npm/info_chalk_json/__test__.jsonc | 9 + .../npm/info_chalk_json/cjs_with_deps/main.js | 12 + .../npm/info_chalk_json/cjs_with_deps/main.out | 33 ++ .../info_chalk_json/cjs_with_deps/main_info.out | 22 ++ .../cjs_with_deps/main_info_json.out | 148 ++++++++ .../cjs_with_deps/main_node_modules.out | 47 +++ .../__test__.jsonc | 10 + .../cjs_with_deps/main.js | 12 + .../cjs_with_deps/main.out | 33 ++ .../cjs_with_deps/main_info.out | 22 ++ .../cjs_with_deps/main_info_json.out | 148 ++++++++ .../cjs_with_deps/main_node_modules.out | 47 +++ .../npm/info_cli_chalk_display/__test__.jsonc | 9 + .../npm/info_cli_chalk_display/info/chalk.out | 9 + .../npm/info_cli_chalk_display/info/chalk_json.out | 57 +++ tests/specs/npm/info_cli_chalk_json/__test__.jsonc | 9 + tests/specs/npm/info_cli_chalk_json/info/chalk.out | 9 + .../npm/info_cli_chalk_json/info/chalk_json.out | 57 +++ tests/specs/npm/info_peer_deps/__test__.jsonc | 9 + .../peer_deps_with_copied_folders/main.out | 14 + .../peer_deps_with_copied_folders/main.ts | 5 + .../peer_deps_with_copied_folders/main_info.out | 14 + .../main_info_json.out | 97 +++++ .../main_node_modules.out | 9 + .../main_node_modules_reload.out | 19 + tests/specs/npm/info_peer_deps_json/__test__.jsonc | 9 + .../peer_deps_with_copied_folders/main.out | 14 + .../peer_deps_with_copied_folders/main.ts | 5 + .../peer_deps_with_copied_folders/main_info.out | 14 + .../main_info_json.out | 97 +++++ .../main_node_modules.out | 9 + .../main_node_modules_reload.out | 19 + .../__test__.jsonc | 9 + .../mixed_case_package_name/global.out | 9 + .../mixed_case_package_name/global.ts | 2 + .../mixed_case_package_name/local.out | 13 + .../mixed_case_package_name/local.ts | 18 + .../__test__.jsonc | 10 + .../mixed_case_package_name/global.out | 9 + .../mixed_case_package_name/global.ts | 2 + .../mixed_case_package_name/local.out | 13 + .../mixed_case_package_name/local.ts | 18 + .../node_modules_deno_node_modules/__test__.jsonc | 9 + .../node_modules_deno_node_modules/main.out | 2 + .../node_modules_deno_node_modules/main.ts | 7 + .../__test__.jsonc | 10 + .../node_modules_deno_node_modules/main.out | 2 + .../node_modules_deno_node_modules/main.ts | 7 + .../__test__.jsonc | 10 + .../require_added_nm_folder/main.js | 10 + .../require_added_nm_folder/main.out | 1 + .../__test__.jsonc | 10 + .../require_main/main.js | 2 + .../require_main/main.out | 1 + .../npm/node_modules_dir_with_deps/__test__.jsonc | 9 + .../cjs_with_deps/main.js | 12 + .../cjs_with_deps/main.out | 33 ++ .../cjs_with_deps/main_info.out | 22 ++ .../cjs_with_deps/main_info_json.out | 148 ++++++++ .../cjs_with_deps/main_node_modules.out | 47 +++ .../npm/node_modules_dir_yargs/__test__.jsonc | 9 + .../npm/node_modules_dir_yargs/cjs_yargs/main.js | 20 ++ .../npm/node_modules_dir_yargs/cjs_yargs/main.out | 84 +++++ tests/specs/npm/non_existent_dep/__test__.jsonc | 9 + .../npm/non_existent_dep_version/__test__.jsonc | 9 + tests/specs/npm/nonexistent_file/__test__.jsonc | 9 + .../npm/nonexistent_file/nonexistent_file/main.js | 2 + .../npm/nonexistent_file/nonexistent_file/main.out | 4 + .../__test__.jsonc | 10 + .../nonexistent_file/main.js | 2 + .../nonexistent_file/main.out | 4 + .../npm/permissions_outside_package/__test__.jsonc | 8 + .../permissions_outside_package/foo/config.js | 4 + .../permissions_outside_package/foo/package.json | 4 + .../permissions_outside_package/main.out | 3 + .../permissions_outside_package/main.ts | 5 + .../specs/npm/remote_npm_specifier/__test__.jsonc | 9 + .../remote_npm_specifier/main.out | 1 + .../remote_npm_specifier/main.ts | 1 + .../remote_npm_specifier/remote.ts | 3 + tests/specs/npm/require_esm/__test__.jsonc | 4 + tests/specs/npm/require_esm/require_esm/esm.js | 1 + tests/specs/npm/require_esm/require_esm/main.out | 1 + tests/specs/npm/require_esm/require_esm/main.ts | 5 + tests/specs/npm/require_json/__test__.jsonc | 8 + tests/specs/npm/require_json/require_json/main.js | 2 + tests/specs/npm/require_json/require_json/main.out | 3 + .../specs/npm/reserved_word_exports/__test__.jsonc | 8 + .../reserved_word_exports/main.out | 141 ++++++++ .../reserved_word_exports/main.ts | 3 + .../__test__.jsonc | 9 + .../run_existing_npm_package_with_subpath/main.out | 5 + .../package.json | 6 + tests/specs/npm/sub_paths/__test__.jsonc | 8 + tests/specs/npm/sub_paths/sub_paths/main.jsx | 8 + tests/specs/npm/sub_paths/sub_paths/main.out | 1 + .../npm/tarball_with_global_header/__test__.jsonc | 8 + .../tarball_with_global_header/main.js | 3 + .../tarball_with_global_header/main.out | 1 + .../specs/npm/translate_cjs_to_esm/__test__.jsonc | 8 + .../translate_cjs_to_esm/main.js | 6 + .../translate_cjs_to_esm/main.out | 4 + .../specs/npm/types_ambient_module/__test__.jsonc | 9 + .../types_ambient_module/import_map.json | 5 + .../types_ambient_module/main.out | 21 ++ .../types_ambient_module/main.ts | 7 + .../types_ambient_module/main_import_map.out | 9 + .../types_ambient_module/main_import_map.ts | 4 + .../types_ambient_module_import_map/__test__.jsonc | 9 + .../types_ambient_module/import_map.json | 5 + .../types_ambient_module/main.out | 21 ++ .../types_ambient_module/main.ts | 7 + .../types_ambient_module/main_import_map.out | 9 + .../types_ambient_module/main_import_map.ts | 4 + tests/specs/npm/types_d_ext/__test__.jsonc | 8 + tests/specs/npm/types_d_ext/d_ext/main.out | 3 + tests/specs/npm/types_d_ext/d_ext/main.ts | 3 + .../types_entry_value_not_exists/__test__.jsonc | 9 + .../types_entry_value_not_exists/main.out | 7 + .../types_entry_value_not_exists/main.ts | 5 + .../npm/types_exports_import_types/__test__.jsonc | 9 + .../types_exports_import_types/main.out | 7 + .../types_exports_import_types/main.ts | 5 + .../specs/npm/types_no_types_entry/__test__.jsonc | 9 + .../types_no_types_entry/main.out | 13 + .../types_no_types_entry/main.ts | 5 + .../npm/typescript_file_in_package/__test__.jsonc | 9 + .../typescript_file_in_package/main.out | 6 + .../typescript_file_in_package/main.ts | 5 + .../npm_tests/builtin_module_module/__test__.jsonc | 8 - .../builtin_module_module/main.js | 1 - .../builtin_module_module/main.out | 4 - tests/specs/npm_tests/cached_only/__test__.jsonc | 9 - .../npm_tests/cached_only/cached_only/main.out | 2 - .../npm_tests/cached_only/cached_only/main.ts | 3 - tests/specs/npm_tests/check_all/__test__.jsonc | 9 - .../specs/npm_tests/check_all/check_errors/main.ts | 3 - .../npm_tests/check_all/check_errors/main_all.out | 19 - .../check_all/check_errors/main_local.out | 7 - tests/specs/npm_tests/check_local/__test__.jsonc | 9 - .../npm_tests/check_local/check_errors/main.ts | 3 - .../check_local/check_errors/main_all.out | 19 - .../check_local/check_errors/main_local.out | 7 - .../__test__.jsonc | 9 - .../file_dts_dmts_dcts/main.out | 24 -- .../file_dts_dmts_dcts/main.ts | 9 - .../child_process_fork_test/__test__.jsonc | 8 - .../child_process_fork_test/main.out | 2 - .../child_process_fork_test/main.ts | 4 - .../cjs_invalid_name_exports/__test__.jsonc | 8 - .../cjs-invalid-name-exports/main.out | 13 - .../cjs-invalid-name-exports/main.ts | 3 - .../cjs_local_global_decls/__test__.jsonc | 8 - .../cjs_local_global_decls/main.out | 3 - .../cjs_local_global_decls/main.ts | 1 - .../cjs_module_export_assignment/__test__.jsonc | 8 - .../cjs_module_export_assignment/main.out | 6 - .../cjs_module_export_assignment/main.ts | 6 - .../__test__.jsonc | 8 - .../cjs_module_export_assignment_number/main.out | 3 - .../cjs_module_export_assignment_number/main.ts | 7 - .../specs/npm_tests/cjs_pkg_imports/__test__.jsonc | 8 - .../cjs_pkg_imports/cjs_pkg_imports/main.out | 3 - .../cjs_pkg_imports/cjs_pkg_imports/main.ts | 3 - .../cjs_reexport_collision/__test__.jsonc | 8 - .../cjs_reexport_collision/main.out | 1 - .../cjs_reexport_collision/main.ts | 2 - .../specs/npm_tests/cjs_require_esm/__test__.jsonc | 8 - .../cjs_require_esm/cjs_require_esm/main.out | 4 - .../cjs_require_esm/cjs_require_esm/main.ts | 2 - .../npm_tests/cjs_require_esm_mjs/__test__.jsonc | 8 - .../cjs_require_esm_mjs/main.out | 4 - .../cjs_require_esm_mjs/main.ts | 2 - tests/specs/npm_tests/cjs_sub_path/__test__.jsonc | 8 - .../npm_tests/cjs_sub_path/cjs_sub_path/main.js | 21 -- .../npm_tests/cjs_sub_path/cjs_sub_path/main.out | 35 -- .../npm_tests/cjs_this_in_exports/__test__.jsonc | 9 - .../cjs_this_in_exports/main.js | 11 - .../cjs_this_in_exports/main.out | 5 - tests/specs/npm_tests/cjs_with_deps/__test__.jsonc | 8 - .../npm_tests/cjs_with_deps/cjs_with_deps/main.js | 12 - .../npm_tests/cjs_with_deps/cjs_with_deps/main.out | 33 -- .../cjs_with_deps/cjs_with_deps/main_info.out | 22 -- .../cjs_with_deps/cjs_with_deps/main_info_json.out | 148 -------- .../cjs_with_deps/main_node_modules.out | 47 --- .../specs/npm_tests/compare_globals/__test__.jsonc | 8 - .../compare_globals/compare_globals/main.out | 30 -- .../compare_globals/compare_globals/main.ts | 54 --- .../specs/npm_tests/create_require/__test__.jsonc | 9 - .../create_require/create_require/main.out | 12 - .../create_require/create_require/main.ts | 1 - tests/specs/npm_tests/deno_cache/__test__.jsonc | 8 - tests/specs/npm_tests/deno_cache/deno_cache.out | 8 - .../npm_tests/deno_run_bin_cjs/__test__.jsonc | 8 - .../npm_tests/deno_run_bin_cjs/deno_run_cjs.out | 4 - .../__test__.jsonc | 8 - .../deno_run_cjs.out | 4 - .../npm_tests/deno_run_bin_esm/__test__.jsonc | 8 - .../npm_tests/deno_run_bin_esm/deno_run_esm.out | 4 - .../__test__.jsonc | 8 - .../deno_run_esm.out | 4 - .../npm_tests/deno_run_bin_no_ext/__test__.jsonc | 8 - .../deno_run_bin_no_ext/deno_run_no_ext.out | 4 - .../deno_run_bin_special_chars/__test__.jsonc | 8 - .../deno_run_special_chars_in_bin_name.out | 4 - .../specs/npm_tests/deno_run_cowsay/__test__.jsonc | 8 - .../npm_tests/deno_run_cowsay/deno_run_cowsay.out | 8 - .../deno_run_cowsay_explicit/__test__.jsonc | 8 - .../deno_run_cowsay_explicit/deno_run_cowsay.out | 8 - .../__test__.jsonc | 8 - .../deno_run_cowsay.out | 8 - .../npm_tests/deno_run_cowthink/__test__.jsonc | 8 - .../deno_run_cowthink/deno_run_cowthink.out | 8 - .../deno_run_no_bin_entrypoint/__test__.jsonc | 9 - .../deno_run_no_bin_entrypoint.out | 1 - .../__test__.jsonc | 9 - ..._run_no_bin_entrypoint_non_existent_subpath.out | 3 - .../npm_tests/deno_run_non_existent/__test__.jsonc | 9 - .../deno_run_non_existent.out | 2 - .../__test__.jsonc | 9 - .../different_nested_dep/main.js | 5 - .../different_nested_dep/main.out | 2 - .../different_nested_dep/package.json | 6 - .../__test__.jsonc | 9 - .../different_nested_dep/main.js | 5 - .../different_nested_dep/main.out | 2 - .../different_nested_dep/package.json | 6 - .../__test__.jsonc | 9 - .../directory_import/folder_index_js.out | 7 - .../directory_import/folder_index_js.ts | 2 - .../directory_import/folder_no_index.out | 6 - .../directory_import/folder_no_index.ts | 2 - .../__test__.jsonc | 9 - .../directory_import/folder_index_js.out | 7 - .../directory_import/folder_index_js.ts | 2 - .../directory_import/folder_no_index.out | 6 - .../directory_import/folder_no_index.ts | 2 - tests/specs/npm_tests/dual_cjs_esm/__test__.jsonc | 8 - .../npm_tests/dual_cjs_esm/dual_cjs_esm/main.out | 3 - .../npm_tests/dual_cjs_esm/dual_cjs_esm/main.ts | 6 - .../dynamic_import_deno_ts_from_npm/__test__.jsonc | 8 - .../dynamic_import_deno_ts_from_npm/add.ts | 3 - .../dynamic_import_deno_ts_from_npm/main.out | 2 - .../dynamic_import_deno_ts_from_npm/main.ts | 8 - .../dynamic_import_deno_ts_from_npm/subtract.mts | 3 - .../__test__.jsonc | 8 - .../dynamic_import_invalid_package_name/main.out | 6 - .../dynamic_import_invalid_package_name/main.ts | 6 - .../npm_tests/dynamic_import_json/__test__.jsonc | 8 - .../dynamic_import_json/import_json/main.js | 4 - .../dynamic_import_json/import_json/main.out | 10 - .../__test__.jsonc | 8 - .../dynamic_import_reload_same_package/main.out | 5 - .../dynamic_import_reload_same_package/main.ts | 7 - .../dynamic_import_reload_same_package/other.ts | 3 - .../npm_tests/env_var_re_export_dev/__test__.jsonc | 8 - .../env_var_re_export/main.js | 3 - .../env_var_re_export_prod/__test__.jsonc | 9 - .../env_var_re_export/main.js | 3 - .../error_version_after_subpath/__test__.jsonc | 9 - .../error_version_after_subpath/main.js | 1 - .../error_version_after_subpath/main.out | 2 - tests/specs/npm_tests/import_json/__test__.jsonc | 8 - .../npm_tests/import_json/import_json/main.js | 4 - .../npm_tests/import_json/import_json/main.out | 10 - tests/specs/npm_tests/import_map/__test__.jsonc | 8 - .../import_map/import_map/import_map.json | 6 - .../specs/npm_tests/import_map/import_map/main.js | 10 - .../specs/npm_tests/import_map/import_map/main.out | 10 - .../npm_tests/imports_package_json/__test__.jsonc | 8 - .../imports_package_json/import_not_defined.js | 3 - .../imports_package_json/import_not_defined.out | 3 - .../imports_package_json/main.js | 7 - .../imports_package_json/main.out | 7 - .../imports_package_json/package.json | 6 - .../sub_path_import_not_defined.js | 3 - .../sub_path_import_not_defined.out | 3 - .../__test__.jsonc | 9 - .../imports_package_json/import_not_defined.js | 3 - .../imports_package_json/import_not_defined.out | 3 - .../imports_package_json/main.js | 7 - .../imports_package_json/main.out | 7 - .../imports_package_json/package.json | 6 - .../sub_path_import_not_defined.js | 3 - .../sub_path_import_not_defined.out | 3 - .../__test__.jsonc | 9 - .../imports_package_json/import_not_defined.js | 3 - .../imports_package_json/import_not_defined.out | 3 - .../imports_package_json/main.js | 7 - .../imports_package_json/main.out | 7 - .../imports_package_json/package.json | 6 - .../sub_path_import_not_defined.js | 3 - .../sub_path_import_not_defined.out | 3 - .../npm_tests/info_chalk_display/__test__.jsonc | 9 - .../info_chalk_display/cjs_with_deps/main.js | 12 - .../info_chalk_display/cjs_with_deps/main.out | 33 -- .../info_chalk_display/cjs_with_deps/main_info.out | 22 -- .../cjs_with_deps/main_info_json.out | 148 -------- .../cjs_with_deps/main_node_modules.out | 47 --- .../__test__.jsonc | 9 - .../cjs_with_deps/main.js | 12 - .../cjs_with_deps/main.out | 33 -- .../cjs_with_deps/main_info.out | 22 -- .../cjs_with_deps/main_info_json.out | 148 -------- .../cjs_with_deps/main_node_modules.out | 47 --- .../specs/npm_tests/info_chalk_json/__test__.jsonc | 9 - .../info_chalk_json/cjs_with_deps/main.js | 12 - .../info_chalk_json/cjs_with_deps/main.out | 33 -- .../info_chalk_json/cjs_with_deps/main_info.out | 22 -- .../cjs_with_deps/main_info_json.out | 148 -------- .../cjs_with_deps/main_node_modules.out | 47 --- .../__test__.jsonc | 9 - .../cjs_with_deps/main.js | 12 - .../cjs_with_deps/main.out | 33 -- .../cjs_with_deps/main_info.out | 22 -- .../cjs_with_deps/main_info_json.out | 148 -------- .../cjs_with_deps/main_node_modules.out | 47 --- .../info_cli_chalk_display/__test__.jsonc | 9 - .../info_cli_chalk_display/info/chalk.out | 9 - .../info_cli_chalk_display/info/chalk_json.out | 57 --- .../npm_tests/info_cli_chalk_json/__test__.jsonc | 9 - .../npm_tests/info_cli_chalk_json/info/chalk.out | 9 - .../info_cli_chalk_json/info/chalk_json.out | 57 --- .../specs/npm_tests/info_peer_deps/__test__.jsonc | 9 - .../peer_deps_with_copied_folders/main.out | 14 - .../peer_deps_with_copied_folders/main.ts | 5 - .../peer_deps_with_copied_folders/main_info.out | 14 - .../main_info_json.out | 97 ----- .../main_node_modules.out | 9 - .../main_node_modules_reload.out | 19 - .../npm_tests/info_peer_deps_json/__test__.jsonc | 9 - .../peer_deps_with_copied_folders/main.out | 14 - .../peer_deps_with_copied_folders/main.ts | 5 - .../peer_deps_with_copied_folders/main_info.out | 14 - .../main_info_json.out | 97 ----- .../main_node_modules.out | 9 - .../main_node_modules_reload.out | 19 - .../__test__.jsonc | 9 - .../mixed_case_package_name/global.out | 9 - .../mixed_case_package_name/global.ts | 2 - .../mixed_case_package_name/local.out | 13 - .../mixed_case_package_name/local.ts | 18 - .../__test__.jsonc | 9 - .../mixed_case_package_name/global.out | 9 - .../mixed_case_package_name/global.ts | 2 - .../mixed_case_package_name/local.out | 13 - .../mixed_case_package_name/local.ts | 18 - .../node_modules_deno_node_modules/__test__.jsonc | 9 - .../node_modules_deno_node_modules/main.out | 2 - .../node_modules_deno_node_modules/main.ts | 7 - .../__test__.jsonc | 9 - .../node_modules_deno_node_modules/main.out | 2 - .../node_modules_deno_node_modules/main.ts | 7 - .../__test__.jsonc | 9 - .../require_added_nm_folder/main.js | 10 - .../require_added_nm_folder/main.out | 1 - .../__test__.jsonc | 9 - .../require_main/main.js | 2 - .../require_main/main.out | 1 - .../node_modules_dir_with_deps/__test__.jsonc | 8 - .../cjs_with_deps/main.js | 12 - .../cjs_with_deps/main.out | 33 -- .../cjs_with_deps/main_info.out | 22 -- .../cjs_with_deps/main_info_json.out | 148 -------- .../cjs_with_deps/main_node_modules.out | 47 --- .../node_modules_dir_yargs/__test__.jsonc | 8 - .../node_modules_dir_yargs/cjs_yargs/main.js | 20 -- .../node_modules_dir_yargs/cjs_yargs/main.out | 84 ----- .../npm_tests/non_existent_dep/__test__.jsonc | 9 - .../non_existent_dep_version/__test__.jsonc | 9 - .../npm_tests/nonexistent_file/__test__.jsonc | 9 - .../nonexistent_file/nonexistent_file/main.js | 2 - .../nonexistent_file/nonexistent_file/main.out | 4 - .../__test__.jsonc | 9 - .../nonexistent_file/main.js | 2 - .../nonexistent_file/main.out | 4 - .../permissions_outside_package/__test__.jsonc | 8 - .../permissions_outside_package/foo/config.js | 4 - .../permissions_outside_package/foo/package.json | 4 - .../permissions_outside_package/main.out | 3 - .../permissions_outside_package/main.ts | 5 - .../npm_tests/remote_npm_specifier/__test__.jsonc | 9 - .../remote_npm_specifier/main.out | 1 - .../remote_npm_specifier/main.ts | 1 - .../remote_npm_specifier/remote.ts | 3 - tests/specs/npm_tests/require_esm/__test__.jsonc | 4 - .../specs/npm_tests/require_esm/require_esm/esm.js | 1 - .../npm_tests/require_esm/require_esm/main.out | 1 - .../npm_tests/require_esm/require_esm/main.ts | 5 - tests/specs/npm_tests/require_json/__test__.jsonc | 8 - .../npm_tests/require_json/require_json/main.js | 2 - .../npm_tests/require_json/require_json/main.out | 3 - .../npm_tests/reserved_word_exports/__test__.jsonc | 8 - .../reserved_word_exports/main.out | 141 -------- .../reserved_word_exports/main.ts | 3 - .../__test__.jsonc | 8 - .../run_existing_npm_package_with_subpath/main.out | 5 - .../package.json | 6 - tests/specs/npm_tests/sub_paths/__test__.jsonc | 8 - tests/specs/npm_tests/sub_paths/sub_paths/main.jsx | 8 - tests/specs/npm_tests/sub_paths/sub_paths/main.out | 1 - .../tarball_with_global_header/__test__.jsonc | 8 - .../tarball_with_global_header/main.js | 3 - .../tarball_with_global_header/main.out | 1 - .../npm_tests/translate_cjs_to_esm/__test__.jsonc | 8 - .../translate_cjs_to_esm/main.js | 6 - .../translate_cjs_to_esm/main.out | 4 - .../npm_tests/types_ambient_module/__test__.jsonc | 9 - .../types_ambient_module/import_map.json | 5 - .../types_ambient_module/main.out | 21 -- .../types_ambient_module/main.ts | 7 - .../types_ambient_module/main_import_map.out | 9 - .../types_ambient_module/main_import_map.ts | 4 - .../types_ambient_module_import_map/__test__.jsonc | 9 - .../types_ambient_module/import_map.json | 5 - .../types_ambient_module/main.out | 21 -- .../types_ambient_module/main.ts | 7 - .../types_ambient_module/main_import_map.out | 9 - .../types_ambient_module/main_import_map.ts | 4 - tests/specs/npm_tests/types_d_ext/__test__.jsonc | 8 - tests/specs/npm_tests/types_d_ext/d_ext/main.out | 3 - tests/specs/npm_tests/types_d_ext/d_ext/main.ts | 3 - .../types_entry_value_not_exists/__test__.jsonc | 9 - .../types_entry_value_not_exists/main.out | 7 - .../types_entry_value_not_exists/main.ts | 5 - .../types_exports_import_types/__test__.jsonc | 9 - .../types_exports_import_types/main.out | 7 - .../types_exports_import_types/main.ts | 5 - .../npm_tests/types_no_types_entry/__test__.jsonc | 9 - .../types_no_types_entry/main.out | 13 - .../types_no_types_entry/main.ts | 5 - .../typescript_file_in_package/__test__.jsonc | 9 - .../typescript_file_in_package/main.out | 6 - .../typescript_file_in_package/main.ts | 5 - tests/specs/permission/allow_import/__test__.jsonc | 52 +++ .../specs/permission/allow_import/builtin_host.ts | 4 + tests/specs/permission/allow_import/cache.out | 2 + tests/specs/permission/allow_import/check.out | 2 + tests/specs/permission/allow_import/compile.out | 2 + tests/specs/permission/allow_import/doc.out | 6 + tests/specs/permission/allow_import/doc.ts | 3 + .../specs/permission/allow_import/doc_allowed.out | 10 + tests/specs/permission/allow_import/info.out | 7 + tests/specs/permission/allow_import/main.ts | 1 + tests/specs/permission/allow_import/run.out | 2 + tests/specs/permission/allow_import/serve.out | 2 + .../permission/allow_import_jsx/__test__.jsonc | 5 + tests/specs/permission/allow_import_jsx/deno.jsonc | 6 + tests/specs/permission/allow_import_jsx/main.out | 3 + tests/specs/permission/allow_import_jsx/main.tsx | 3 + .../allow_import_main_module/__test__.jsonc | 17 + .../allow_import_not_on_redirect/__test__.jsonc | 5 + .../allow_import_not_on_redirect/main.js | 2 + .../allow_import_not_on_redirect/main.out | 2 + .../banned_triple_slash_directives/publish.out | 1 - .../publish/invalid_import/invalid_import.out | 5 +- .../invalid_import_esm_sh_suggestion.out | 3 - tests/specs/publish/missing_constraint/publish.out | 20 +- .../missing_constraint_jsx_import_source/mod.out | 11 +- .../specs/publish/prefer_fast_check_graph/main.out | 3 - tests/specs/run/redirect_javascript/__test__.jsonc | 2 +- .../test/check_local_by_default/__test__.jsonc | 2 +- .../test/check_local_by_default2/__test__.jsonc | 2 +- .../error_worker_permissions_remote/__test__.jsonc | 2 +- .../error_worker_permissions_remote.ts.out | 2 +- .../permissions_blob_remote.ts.out | 2 +- .../permissions_data_remote.ts.out | 2 +- .../__test__.jsonc | 4 +- .../permissions_dynamic_remote.ts | 12 + .../permissions_dynamic_remote.ts.out | 6 + .../__test__.jsonc | 2 +- .../permissions_remote_remote.ts | 3 + .../permissions_remote_remote.ts.out | 2 +- tests/testdata/add.ts | 3 + .../dynamic_import/permissions_blob_local.ts | 2 +- .../dynamic_import/permissions_blob_remote.ts | 1 - .../dynamic_import/permissions_blob_remote.ts.out | 4 +- .../dynamic_import/permissions_data_local.ts | 2 +- .../dynamic_import/permissions_data_remote.ts.out | 2 +- .../permissions_remote_remote.ts.out | 2 +- .../run/error_015_dynamic_import_permissions.js | 2 +- .../run/error_015_dynamic_import_permissions.out | 4 +- tests/testdata/run/lock_write_fetch/main.ts | 3 + tests/testdata/run/type_directives_01.ts | 2 +- tests/testdata/run/type_directives_01.ts.out | 2 +- tests/testdata/run/type_headers_deno_types.ts | 4 +- .../testdata/workers/permissions_dynamic_remote.ts | 11 - .../workers/permissions_dynamic_remote.ts.out | 6 - .../testdata/workers/permissions_remote_remote.ts | 3 - tests/testdata/workers/static_remote.ts | 2 +- 876 files changed, 5772 insertions(+), 5580 deletions(-) create mode 100644 tests/specs/info/_054_info_local_imports/005_more_imports.ts create mode 100644 tests/specs/info/_054_info_local_imports/054_info_local_imports.out create mode 100644 tests/specs/info/_054_info_local_imports/__test__.jsonc create mode 100644 tests/specs/info/_054_info_local_imports/mod1.ts create mode 100644 tests/specs/info/_054_info_local_imports/mod2.ts create mode 100644 tests/specs/info/_054_info_local_imports/print_hello.ts create mode 100644 tests/specs/info/_054_info_local_imports/subdir2/dynamic_import.ts create mode 100644 tests/specs/info/_054_info_local_imports/subdir2/mod2.ts create mode 100644 tests/specs/info/data_null_error/__test__.jsonc create mode 100644 tests/specs/info/data_null_error/data_null_error/data_null_error.out create mode 100644 tests/specs/info/data_null_error/data_null_error/mod.ts create mode 100644 tests/specs/info/data_null_error/data_null_error/types.d.ts create mode 100644 tests/specs/info/dynamic_imports_tmpl_lit/__test__.jsonc create mode 100644 tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out create mode 100644 tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js create mode 100644 tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json create mode 100644 tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json create mode 100644 tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js create mode 100644 tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts create mode 100644 tests/specs/info/flag/041_info_flag.out create mode 100644 tests/specs/info/flag/__test__.jsonc create mode 100644 tests/specs/info/flag_location/041_info_flag_location.out create mode 100644 tests/specs/info/flag_location/__test__.jsonc create mode 100644 tests/specs/info/flag_script_jsx/049_info_flag_script_jsx.out create mode 100644 tests/specs/info/flag_script_jsx/__test__.jsonc create mode 100644 tests/specs/info/import_map/__test__.jsonc create mode 100644 tests/specs/info/import_map/deno.json create mode 100644 tests/specs/info/import_map/deno.lock create mode 100644 tests/specs/info/import_map/main.tsx create mode 100644 tests/specs/info/import_map/with_import_map.out create mode 100644 tests/specs/info/json/__test__.jsonc create mode 100644 tests/specs/info/json/info_json.out create mode 100644 tests/specs/info/json_deps_order/076_info_json_deps_order.out create mode 100644 tests/specs/info/json_deps_order/076_info_json_deps_order.ts create mode 100644 tests/specs/info/json_deps_order/__test__.jsonc create mode 100644 tests/specs/info/json_deps_order/recursive_imports/A.ts create mode 100644 tests/specs/info/json_deps_order/recursive_imports/B.ts create mode 100644 tests/specs/info/json_deps_order/recursive_imports/C.ts create mode 100644 tests/specs/info/json_deps_order/recursive_imports/common.ts create mode 100644 tests/specs/info/json_file/__test__.jsonc create mode 100644 tests/specs/info/json_file/json_output/main.out create mode 100644 tests/specs/info/json_file/json_output/main.ts create mode 100644 tests/specs/info/json_file/mod1.ts create mode 100644 tests/specs/info/json_file/mod2.ts create mode 100644 tests/specs/info/json_file/print_hello.ts create mode 100644 tests/specs/info/json_file/subdir2/dynamic_import.ts create mode 100644 tests/specs/info/json_file/subdir2/mod2.ts create mode 100644 tests/specs/info/json_location/__test__.jsonc create mode 100644 tests/specs/info/json_location/info_json_location.out create mode 100644 tests/specs/info/missing_module/__test__.jsonc create mode 100644 tests/specs/info/missing_module/error_009_missing_js_module.js create mode 100644 tests/specs/info/missing_module/info_missing_module.out create mode 100644 tests/specs/info/multiple_imports/__test__.jsonc create mode 100644 tests/specs/info/multiple_imports/multiple_imports.out create mode 100644 tests/specs/info/recursive_modules/__test__.jsonc create mode 100644 tests/specs/info/recursive_modules/info_recursive_imports_test.out create mode 100644 tests/specs/info/recursive_modules/info_recursive_imports_test.ts create mode 100644 tests/specs/info/recursive_modules/recursive_imports/A.ts create mode 100644 tests/specs/info/recursive_modules/recursive_imports/B.ts create mode 100644 tests/specs/info/recursive_modules/recursive_imports/C.ts create mode 100644 tests/specs/info/recursive_modules/recursive_imports/common.ts create mode 100644 tests/specs/info/type_import/__test__.jsonc create mode 100644 tests/specs/info/type_import/info_type_import.out create mode 100644 tests/specs/info/type_import/info_type_import.ts create mode 100644 tests/specs/info/type_import/type_and_code.ts create mode 100644 tests/specs/info/types_header_direct/__test__.jsonc create mode 100644 tests/specs/info/types_header_direct/type_directives_01.ts create mode 100644 tests/specs/info/types_header_direct/types_header.out create mode 100644 tests/specs/info/with_config_override/__test__.jsonc create mode 100644 tests/specs/info/with_config_override/with_config/deno-override.json create mode 100644 tests/specs/info/with_config_override/with_config/deno.json create mode 100644 tests/specs/info/with_config_override/with_config/import_map.json create mode 100644 tests/specs/info/with_config_override/with_config/test.ts create mode 100644 tests/specs/info/with_config_override/with_config/with_config.out delete mode 100644 tests/specs/info_tests/_054_info_local_imports/005_more_imports.ts delete mode 100644 tests/specs/info_tests/_054_info_local_imports/054_info_local_imports.out delete mode 100644 tests/specs/info_tests/_054_info_local_imports/__test__.jsonc delete mode 100644 tests/specs/info_tests/_054_info_local_imports/mod1.ts delete mode 100644 tests/specs/info_tests/_054_info_local_imports/mod2.ts delete mode 100644 tests/specs/info_tests/_054_info_local_imports/print_hello.ts delete mode 100644 tests/specs/info_tests/_054_info_local_imports/subdir2/dynamic_import.ts delete mode 100644 tests/specs/info_tests/_054_info_local_imports/subdir2/mod2.ts delete mode 100644 tests/specs/info_tests/data_null_error/__test__.jsonc delete mode 100644 tests/specs/info_tests/data_null_error/data_null_error/data_null_error.out delete mode 100644 tests/specs/info_tests/data_null_error/data_null_error/mod.ts delete mode 100644 tests/specs/info_tests/data_null_error/data_null_error/types.d.ts delete mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out delete mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js delete mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json delete mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json delete mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js delete mode 100644 tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts delete mode 100644 tests/specs/info_tests/info_flag/041_info_flag.out delete mode 100644 tests/specs/info_tests/info_flag/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_flag_location/041_info_flag_location.out delete mode 100644 tests/specs/info_tests/info_flag_location/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_flag_script_jsx/049_info_flag_script_jsx.out delete mode 100644 tests/specs/info_tests/info_flag_script_jsx/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_import_map/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_import_map/deno.json delete mode 100644 tests/specs/info_tests/info_import_map/deno.lock delete mode 100644 tests/specs/info_tests/info_import_map/main.tsx delete mode 100644 tests/specs/info_tests/info_import_map/with_import_map.out delete mode 100644 tests/specs/info_tests/info_json/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_json/info_json.out delete mode 100644 tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.out delete mode 100644 tests/specs/info_tests/info_json_deps_order/076_info_json_deps_order.ts delete mode 100644 tests/specs/info_tests/info_json_deps_order/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_json_deps_order/recursive_imports/A.ts delete mode 100644 tests/specs/info_tests/info_json_deps_order/recursive_imports/B.ts delete mode 100644 tests/specs/info_tests/info_json_deps_order/recursive_imports/C.ts delete mode 100644 tests/specs/info_tests/info_json_deps_order/recursive_imports/common.ts delete mode 100644 tests/specs/info_tests/info_json_location/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_json_location/info_json_location.out delete mode 100644 tests/specs/info_tests/info_missing_module/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_missing_module/error_009_missing_js_module.js delete mode 100644 tests/specs/info_tests/info_missing_module/info_missing_module.out delete mode 100644 tests/specs/info_tests/info_recursive_modules/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.out delete mode 100644 tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.ts delete mode 100644 tests/specs/info_tests/info_recursive_modules/recursive_imports/A.ts delete mode 100644 tests/specs/info_tests/info_recursive_modules/recursive_imports/B.ts delete mode 100644 tests/specs/info_tests/info_recursive_modules/recursive_imports/C.ts delete mode 100644 tests/specs/info_tests/info_recursive_modules/recursive_imports/common.ts delete mode 100644 tests/specs/info_tests/info_type_import/__test__.jsonc delete mode 100644 tests/specs/info_tests/info_type_import/info_type_import.out delete mode 100644 tests/specs/info_tests/info_type_import/info_type_import.ts delete mode 100644 tests/specs/info_tests/info_type_import/type_and_code.ts delete mode 100644 tests/specs/info_tests/json_file/__test__.jsonc delete mode 100644 tests/specs/info_tests/json_file/json_output/main.out delete mode 100644 tests/specs/info_tests/json_file/json_output/main.ts delete mode 100644 tests/specs/info_tests/json_file/mod1.ts delete mode 100644 tests/specs/info_tests/json_file/mod2.ts delete mode 100644 tests/specs/info_tests/json_file/print_hello.ts delete mode 100644 tests/specs/info_tests/json_file/subdir2/dynamic_import.ts delete mode 100644 tests/specs/info_tests/json_file/subdir2/mod2.ts delete mode 100644 tests/specs/info_tests/multiple_imports/__test__.jsonc delete mode 100644 tests/specs/info_tests/multiple_imports/multiple_imports.out delete mode 100644 tests/specs/info_tests/types_header_direct/__test__.jsonc delete mode 100644 tests/specs/info_tests/types_header_direct/type_directives_01.ts delete mode 100644 tests/specs/info_tests/types_header_direct/types_header.out delete mode 100644 tests/specs/info_tests/with_config_override/__test__.jsonc delete mode 100644 tests/specs/info_tests/with_config_override/with_config/deno-override.json delete mode 100644 tests/specs/info_tests/with_config_override/with_config/deno.json delete mode 100644 tests/specs/info_tests/with_config_override/with_config/import_map.json delete mode 100644 tests/specs/info_tests/with_config_override/with_config/test.ts delete mode 100644 tests/specs/info_tests/with_config_override/with_config/with_config.out create mode 100644 tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc create mode 100644 tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out create mode 100644 tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts create mode 100644 tests/specs/node/node_test_module/__test__.jsonc create mode 100644 tests/specs/node/node_test_module/test.js create mode 100644 tests/specs/node/node_test_module/test.out create mode 100644 tests/specs/node/node_test_module_no_sanitizers/__test__.jsonc create mode 100644 tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts create mode 100644 tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.js create mode 100644 tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.out create mode 100644 tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts create mode 100644 tests/specs/node/web_node_events_dispatched_in_correct_order/__test__.jsonc create mode 100644 tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.out create mode 100644 tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.ts delete mode 100644 tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc delete mode 100644 tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out delete mode 100644 tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts delete mode 100644 tests/specs/node_compat_tests/node_test_module/__test__.jsonc delete mode 100644 tests/specs/node_compat_tests/node_test_module/test.js delete mode 100644 tests/specs/node_compat_tests/node_test_module/test.out delete mode 100644 tests/specs/node_compat_tests/node_test_module_no_sanitizers/__test__.jsonc delete mode 100644 tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts delete mode 100644 tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.js delete mode 100644 tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.out delete mode 100644 tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts delete mode 100644 tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/__test__.jsonc delete mode 100644 tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.out delete mode 100644 tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.ts create mode 100644 tests/specs/npm/builtin_module_module/__test__.jsonc create mode 100644 tests/specs/npm/builtin_module_module/builtin_module_module/main.js create mode 100644 tests/specs/npm/builtin_module_module/builtin_module_module/main.out create mode 100644 tests/specs/npm/cached_only/__test__.jsonc create mode 100644 tests/specs/npm/cached_only/cached_only/main.out create mode 100644 tests/specs/npm/cached_only/cached_only/main.ts create mode 100644 tests/specs/npm/check_all/__test__.jsonc create mode 100644 tests/specs/npm/check_all/check_errors/main.ts create mode 100644 tests/specs/npm/check_all/check_errors/main_all.out create mode 100644 tests/specs/npm/check_all/check_errors/main_local.out create mode 100644 tests/specs/npm/check_local/__test__.jsonc create mode 100644 tests/specs/npm/check_local/check_errors/main.ts create mode 100644 tests/specs/npm/check_local/check_errors/main_all.out create mode 100644 tests/specs/npm/check_local/check_errors/main_local.out create mode 100644 tests/specs/npm/check_package_file_dts_dmts_dcts/__test__.jsonc create mode 100644 tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out create mode 100644 tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts create mode 100644 tests/specs/npm/child_process_fork_test/__test__.jsonc create mode 100644 tests/specs/npm/child_process_fork_test/child_process_fork_test/main.out create mode 100644 tests/specs/npm/child_process_fork_test/child_process_fork_test/main.ts create mode 100644 tests/specs/npm/cjs_invalid_name_exports/__test__.jsonc create mode 100644 tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out create mode 100644 tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts create mode 100644 tests/specs/npm/cjs_local_global_decls/__test__.jsonc create mode 100644 tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out create mode 100644 tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.ts create mode 100644 tests/specs/npm/cjs_module_export_assignment/__test__.jsonc create mode 100644 tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.out create mode 100644 tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.ts create mode 100644 tests/specs/npm/cjs_module_export_assignment_number/__test__.jsonc create mode 100644 tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out create mode 100644 tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts create mode 100644 tests/specs/npm/cjs_pkg_imports/__test__.jsonc create mode 100644 tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out create mode 100644 tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.ts create mode 100644 tests/specs/npm/cjs_reexport_collision/__test__.jsonc create mode 100644 tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.out create mode 100644 tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.ts create mode 100644 tests/specs/npm/cjs_require_esm/__test__.jsonc create mode 100644 tests/specs/npm/cjs_require_esm/cjs_require_esm/main.out create mode 100644 tests/specs/npm/cjs_require_esm/cjs_require_esm/main.ts create mode 100644 tests/specs/npm/cjs_require_esm_mjs/__test__.jsonc create mode 100644 tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out create mode 100644 tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts create mode 100644 tests/specs/npm/cjs_sub_path/__test__.jsonc create mode 100644 tests/specs/npm/cjs_sub_path/cjs_sub_path/main.js create mode 100644 tests/specs/npm/cjs_sub_path/cjs_sub_path/main.out create mode 100644 tests/specs/npm/cjs_this_in_exports/__test__.jsonc create mode 100644 tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.js create mode 100644 tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.out create mode 100644 tests/specs/npm/cjs_with_deps/__test__.jsonc create mode 100644 tests/specs/npm/cjs_with_deps/cjs_with_deps/main.js create mode 100644 tests/specs/npm/cjs_with_deps/cjs_with_deps/main.out create mode 100644 tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info.out create mode 100644 tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info_json.out create mode 100644 tests/specs/npm/cjs_with_deps/cjs_with_deps/main_node_modules.out create mode 100644 tests/specs/npm/compare_globals/__test__.jsonc create mode 100644 tests/specs/npm/compare_globals/compare_globals/main.out create mode 100644 tests/specs/npm/compare_globals/compare_globals/main.ts create mode 100644 tests/specs/npm/create_require/__test__.jsonc create mode 100644 tests/specs/npm/create_require/create_require/main.out create mode 100644 tests/specs/npm/create_require/create_require/main.ts create mode 100644 tests/specs/npm/deno_cache/__test__.jsonc create mode 100644 tests/specs/npm/deno_cache/deno_cache.out create mode 100644 tests/specs/npm/deno_run_bin_cjs/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_bin_cjs/deno_run_cjs.out create mode 100644 tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out create mode 100644 tests/specs/npm/deno_run_bin_esm/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_bin_esm/deno_run_esm.out create mode 100644 tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out create mode 100644 tests/specs/npm/deno_run_bin_no_ext/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_bin_no_ext/deno_run_no_ext.out create mode 100644 tests/specs/npm/deno_run_bin_special_chars/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out create mode 100644 tests/specs/npm/deno_run_cowsay/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_cowsay/deno_run_cowsay.out create mode 100644 tests/specs/npm/deno_run_cowsay_explicit/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_cowsay_explicit/deno_run_cowsay.out create mode 100644 tests/specs/npm/deno_run_cowsay_with_node_modules_dir/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out create mode 100644 tests/specs/npm/deno_run_cowthink/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_cowthink/deno_run_cowthink.out create mode 100644 tests/specs/npm/deno_run_no_bin_entrypoint/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out create mode 100644 tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out create mode 100644 tests/specs/npm/deno_run_non_existent/__test__.jsonc create mode 100644 tests/specs/npm/deno_run_non_existent/deno_run_non_existent.out create mode 100644 tests/specs/npm/different_nested_dep_node_modules_dir_false/__test__.jsonc create mode 100644 tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js create mode 100644 tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out create mode 100644 tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json create mode 100644 tests/specs/npm/different_nested_dep_node_modules_dir_true/__test__.jsonc create mode 100644 tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js create mode 100644 tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out create mode 100644 tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json create mode 100644 tests/specs/npm/directory_import_folder_index_js/__test__.jsonc create mode 100644 tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out create mode 100644 tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.ts create mode 100644 tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out create mode 100644 tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.ts create mode 100644 tests/specs/npm/directory_import_folder_no_index/__test__.jsonc create mode 100644 tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out create mode 100644 tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.ts create mode 100644 tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out create mode 100644 tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.ts create mode 100644 tests/specs/npm/dual_cjs_esm/__test__.jsonc create mode 100644 tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.out create mode 100644 tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.ts create mode 100644 tests/specs/npm/dynamic_import_deno_ts_from_npm/__test__.jsonc create mode 100644 tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts create mode 100644 tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out create mode 100644 tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts create mode 100644 tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts create mode 100644 tests/specs/npm/dynamic_import_invalid_package_name/__test__.jsonc create mode 100644 tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out create mode 100644 tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts create mode 100644 tests/specs/npm/dynamic_import_json/__test__.jsonc create mode 100644 tests/specs/npm/dynamic_import_json/import_json/main.js create mode 100644 tests/specs/npm/dynamic_import_json/import_json/main.out create mode 100644 tests/specs/npm/dynamic_import_reload_same_package/__test__.jsonc create mode 100644 tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out create mode 100644 tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts create mode 100644 tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts create mode 100644 tests/specs/npm/env_var_re_export_dev/__test__.jsonc create mode 100644 tests/specs/npm/env_var_re_export_dev/env_var_re_export/main.js create mode 100644 tests/specs/npm/env_var_re_export_prod/__test__.jsonc create mode 100644 tests/specs/npm/env_var_re_export_prod/env_var_re_export/main.js create mode 100644 tests/specs/npm/error_version_after_subpath/__test__.jsonc create mode 100644 tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.js create mode 100644 tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.out create mode 100644 tests/specs/npm/import_json/__test__.jsonc create mode 100644 tests/specs/npm/import_json/import_json/main.js create mode 100644 tests/specs/npm/import_json/import_json/main.out create mode 100644 tests/specs/npm/import_map/__test__.jsonc create mode 100644 tests/specs/npm/import_map/import_map/import_map.json create mode 100644 tests/specs/npm/import_map/import_map/main.js create mode 100644 tests/specs/npm/import_map/import_map/main.out create mode 100644 tests/specs/npm/imports_package_json/__test__.jsonc create mode 100644 tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.js create mode 100644 tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out create mode 100644 tests/specs/npm/imports_package_json/imports_package_json/main.js create mode 100644 tests/specs/npm/imports_package_json/imports_package_json/main.out create mode 100644 tests/specs/npm/imports_package_json/imports_package_json/package.json create mode 100644 tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.js create mode 100644 tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out create mode 100644 tests/specs/npm/imports_package_json_import_not_defined/__test__.jsonc create mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js create mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out create mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.js create mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out create mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/package.json create mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js create mode 100644 tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out create mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/__test__.jsonc create mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js create mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out create mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js create mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out create mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json create mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js create mode 100644 tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out create mode 100644 tests/specs/npm/info_chalk_display/__test__.jsonc create mode 100644 tests/specs/npm/info_chalk_display/cjs_with_deps/main.js create mode 100644 tests/specs/npm/info_chalk_display/cjs_with_deps/main.out create mode 100644 tests/specs/npm/info_chalk_display/cjs_with_deps/main_info.out create mode 100644 tests/specs/npm/info_chalk_display/cjs_with_deps/main_info_json.out create mode 100644 tests/specs/npm/info_chalk_display/cjs_with_deps/main_node_modules.out create mode 100644 tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc create mode 100644 tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.js create mode 100644 tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.out create mode 100644 tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out create mode 100644 tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out create mode 100644 tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out create mode 100644 tests/specs/npm/info_chalk_json/__test__.jsonc create mode 100644 tests/specs/npm/info_chalk_json/cjs_with_deps/main.js create mode 100644 tests/specs/npm/info_chalk_json/cjs_with_deps/main.out create mode 100644 tests/specs/npm/info_chalk_json/cjs_with_deps/main_info.out create mode 100644 tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out create mode 100644 tests/specs/npm/info_chalk_json/cjs_with_deps/main_node_modules.out create mode 100644 tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc create mode 100644 tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.js create mode 100644 tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.out create mode 100644 tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out create mode 100644 tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out create mode 100644 tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out create mode 100644 tests/specs/npm/info_cli_chalk_display/__test__.jsonc create mode 100644 tests/specs/npm/info_cli_chalk_display/info/chalk.out create mode 100644 tests/specs/npm/info_cli_chalk_display/info/chalk_json.out create mode 100644 tests/specs/npm/info_cli_chalk_json/__test__.jsonc create mode 100644 tests/specs/npm/info_cli_chalk_json/info/chalk.out create mode 100644 tests/specs/npm/info_cli_chalk_json/info/chalk_json.out create mode 100644 tests/specs/npm/info_peer_deps/__test__.jsonc create mode 100644 tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out create mode 100644 tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.ts create mode 100644 tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info.out create mode 100644 tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out create mode 100644 tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out create mode 100644 tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out create mode 100644 tests/specs/npm/info_peer_deps_json/__test__.jsonc create mode 100644 tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out create mode 100644 tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.ts create mode 100644 tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out create mode 100644 tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out create mode 100644 tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out create mode 100644 tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out create mode 100644 tests/specs/npm/mixed_case_package_name_global_dir/__test__.jsonc create mode 100644 tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out create mode 100644 tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts create mode 100644 tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out create mode 100644 tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts create mode 100644 tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc create mode 100644 tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out create mode 100644 tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts create mode 100644 tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out create mode 100644 tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts create mode 100644 tests/specs/npm/node_modules_deno_node_modules/__test__.jsonc create mode 100644 tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out create mode 100644 tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts create mode 100644 tests/specs/npm/node_modules_deno_node_modules_local/__test__.jsonc create mode 100644 tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out create mode 100644 tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts create mode 100644 tests/specs/npm/node_modules_dir_require_added_node_modules_folder/__test__.jsonc create mode 100644 tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js create mode 100644 tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out create mode 100644 tests/specs/npm/node_modules_dir_require_main_entry/__test__.jsonc create mode 100644 tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.js create mode 100644 tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.out create mode 100644 tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc create mode 100644 tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.js create mode 100644 tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.out create mode 100644 tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info.out create mode 100644 tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out create mode 100644 tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out create mode 100644 tests/specs/npm/node_modules_dir_yargs/__test__.jsonc create mode 100644 tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.js create mode 100644 tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.out create mode 100644 tests/specs/npm/non_existent_dep/__test__.jsonc create mode 100644 tests/specs/npm/non_existent_dep_version/__test__.jsonc create mode 100644 tests/specs/npm/nonexistent_file/__test__.jsonc create mode 100644 tests/specs/npm/nonexistent_file/nonexistent_file/main.js create mode 100644 tests/specs/npm/nonexistent_file/nonexistent_file/main.out create mode 100644 tests/specs/npm/nonexistent_file_node_modules_dir/__test__.jsonc create mode 100644 tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.js create mode 100644 tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.out create mode 100644 tests/specs/npm/permissions_outside_package/__test__.jsonc create mode 100644 tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/config.js create mode 100644 tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/package.json create mode 100644 tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out create mode 100644 tests/specs/npm/permissions_outside_package/permissions_outside_package/main.ts create mode 100644 tests/specs/npm/remote_npm_specifier/__test__.jsonc create mode 100644 tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.out create mode 100644 tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.ts create mode 100644 tests/specs/npm/remote_npm_specifier/remote_npm_specifier/remote.ts create mode 100644 tests/specs/npm/require_esm/__test__.jsonc create mode 100644 tests/specs/npm/require_esm/require_esm/esm.js create mode 100644 tests/specs/npm/require_esm/require_esm/main.out create mode 100644 tests/specs/npm/require_esm/require_esm/main.ts create mode 100644 tests/specs/npm/require_json/__test__.jsonc create mode 100644 tests/specs/npm/require_json/require_json/main.js create mode 100644 tests/specs/npm/require_json/require_json/main.out create mode 100644 tests/specs/npm/reserved_word_exports/__test__.jsonc create mode 100644 tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out create mode 100644 tests/specs/npm/reserved_word_exports/reserved_word_exports/main.ts create mode 100644 tests/specs/npm/run_existing_npm_package_with_subpath/__test__.jsonc create mode 100644 tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out create mode 100644 tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json create mode 100644 tests/specs/npm/sub_paths/__test__.jsonc create mode 100644 tests/specs/npm/sub_paths/sub_paths/main.jsx create mode 100644 tests/specs/npm/sub_paths/sub_paths/main.out create mode 100644 tests/specs/npm/tarball_with_global_header/__test__.jsonc create mode 100644 tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.js create mode 100644 tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.out create mode 100644 tests/specs/npm/translate_cjs_to_esm/__test__.jsonc create mode 100644 tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.js create mode 100644 tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.out create mode 100644 tests/specs/npm/types_ambient_module/__test__.jsonc create mode 100644 tests/specs/npm/types_ambient_module/types_ambient_module/import_map.json create mode 100644 tests/specs/npm/types_ambient_module/types_ambient_module/main.out create mode 100644 tests/specs/npm/types_ambient_module/types_ambient_module/main.ts create mode 100644 tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.out create mode 100644 tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.ts create mode 100644 tests/specs/npm/types_ambient_module_import_map/__test__.jsonc create mode 100644 tests/specs/npm/types_ambient_module_import_map/types_ambient_module/import_map.json create mode 100644 tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.out create mode 100644 tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.ts create mode 100644 tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.out create mode 100644 tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.ts create mode 100644 tests/specs/npm/types_d_ext/__test__.jsonc create mode 100644 tests/specs/npm/types_d_ext/d_ext/main.out create mode 100644 tests/specs/npm/types_d_ext/d_ext/main.ts create mode 100644 tests/specs/npm/types_entry_value_not_exists/__test__.jsonc create mode 100644 tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out create mode 100644 tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.ts create mode 100644 tests/specs/npm/types_exports_import_types/__test__.jsonc create mode 100644 tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out create mode 100644 tests/specs/npm/types_exports_import_types/types_exports_import_types/main.ts create mode 100644 tests/specs/npm/types_no_types_entry/__test__.jsonc create mode 100644 tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out create mode 100644 tests/specs/npm/types_no_types_entry/types_no_types_entry/main.ts create mode 100644 tests/specs/npm/typescript_file_in_package/__test__.jsonc create mode 100644 tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out create mode 100644 tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts delete mode 100644 tests/specs/npm_tests/builtin_module_module/__test__.jsonc delete mode 100644 tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.js delete mode 100644 tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.out delete mode 100644 tests/specs/npm_tests/cached_only/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cached_only/cached_only/main.out delete mode 100644 tests/specs/npm_tests/cached_only/cached_only/main.ts delete mode 100644 tests/specs/npm_tests/check_all/__test__.jsonc delete mode 100644 tests/specs/npm_tests/check_all/check_errors/main.ts delete mode 100644 tests/specs/npm_tests/check_all/check_errors/main_all.out delete mode 100644 tests/specs/npm_tests/check_all/check_errors/main_local.out delete mode 100644 tests/specs/npm_tests/check_local/__test__.jsonc delete mode 100644 tests/specs/npm_tests/check_local/check_errors/main.ts delete mode 100644 tests/specs/npm_tests/check_local/check_errors/main_all.out delete mode 100644 tests/specs/npm_tests/check_local/check_errors/main_local.out delete mode 100644 tests/specs/npm_tests/check_package_file_dts_dmts_dcts/__test__.jsonc delete mode 100644 tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out delete mode 100644 tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts delete mode 100644 tests/specs/npm_tests/child_process_fork_test/__test__.jsonc delete mode 100644 tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.out delete mode 100644 tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.ts delete mode 100644 tests/specs/npm_tests/cjs_invalid_name_exports/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out delete mode 100644 tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts delete mode 100644 tests/specs/npm_tests/cjs_local_global_decls/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.out delete mode 100644 tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.ts delete mode 100644 tests/specs/npm_tests/cjs_module_export_assignment/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.out delete mode 100644 tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.ts delete mode 100644 tests/specs/npm_tests/cjs_module_export_assignment_number/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out delete mode 100644 tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts delete mode 100644 tests/specs/npm_tests/cjs_pkg_imports/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.out delete mode 100644 tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.ts delete mode 100644 tests/specs/npm_tests/cjs_reexport_collision/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.out delete mode 100644 tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.ts delete mode 100644 tests/specs/npm_tests/cjs_require_esm/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.out delete mode 100644 tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.ts delete mode 100644 tests/specs/npm_tests/cjs_require_esm_mjs/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out delete mode 100644 tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts delete mode 100644 tests/specs/npm_tests/cjs_sub_path/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.js delete mode 100644 tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.out delete mode 100644 tests/specs/npm_tests/cjs_this_in_exports/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.js delete mode 100644 tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.out delete mode 100644 tests/specs/npm_tests/cjs_with_deps/__test__.jsonc delete mode 100644 tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.js delete mode 100644 tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.out delete mode 100644 tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info.out delete mode 100644 tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info_json.out delete mode 100644 tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_node_modules.out delete mode 100644 tests/specs/npm_tests/compare_globals/__test__.jsonc delete mode 100644 tests/specs/npm_tests/compare_globals/compare_globals/main.out delete mode 100644 tests/specs/npm_tests/compare_globals/compare_globals/main.ts delete mode 100644 tests/specs/npm_tests/create_require/__test__.jsonc delete mode 100644 tests/specs/npm_tests/create_require/create_require/main.out delete mode 100644 tests/specs/npm_tests/create_require/create_require/main.ts delete mode 100644 tests/specs/npm_tests/deno_cache/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_cache/deno_cache.out delete mode 100644 tests/specs/npm_tests/deno_run_bin_cjs/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_bin_cjs/deno_run_cjs.out delete mode 100644 tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out delete mode 100644 tests/specs/npm_tests/deno_run_bin_esm/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_bin_esm/deno_run_esm.out delete mode 100644 tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out delete mode 100644 tests/specs/npm_tests/deno_run_bin_no_ext/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_bin_no_ext/deno_run_no_ext.out delete mode 100644 tests/specs/npm_tests/deno_run_bin_special_chars/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out delete mode 100644 tests/specs/npm_tests/deno_run_cowsay/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_cowsay/deno_run_cowsay.out delete mode 100644 tests/specs/npm_tests/deno_run_cowsay_explicit/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_cowsay_explicit/deno_run_cowsay.out delete mode 100644 tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out delete mode 100644 tests/specs/npm_tests/deno_run_cowthink/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_cowthink/deno_run_cowthink.out delete mode 100644 tests/specs/npm_tests/deno_run_no_bin_entrypoint/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out delete mode 100644 tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out delete mode 100644 tests/specs/npm_tests/deno_run_non_existent/__test__.jsonc delete mode 100644 tests/specs/npm_tests/deno_run_non_existent/deno_run_non_existent.out delete mode 100644 tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/__test__.jsonc delete mode 100644 tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js delete mode 100644 tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out delete mode 100644 tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json delete mode 100644 tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/__test__.jsonc delete mode 100644 tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js delete mode 100644 tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out delete mode 100644 tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json delete mode 100644 tests/specs/npm_tests/directory_import_folder_index_js/__test__.jsonc delete mode 100644 tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.out delete mode 100644 tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.ts delete mode 100644 tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.out delete mode 100644 tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.ts delete mode 100644 tests/specs/npm_tests/directory_import_folder_no_index/__test__.jsonc delete mode 100644 tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.out delete mode 100644 tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.ts delete mode 100644 tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.out delete mode 100644 tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.ts delete mode 100644 tests/specs/npm_tests/dual_cjs_esm/__test__.jsonc delete mode 100644 tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.out delete mode 100644 tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.ts delete mode 100644 tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/__test__.jsonc delete mode 100644 tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts delete mode 100644 tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out delete mode 100644 tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts delete mode 100644 tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts delete mode 100644 tests/specs/npm_tests/dynamic_import_invalid_package_name/__test__.jsonc delete mode 100644 tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out delete mode 100644 tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts delete mode 100644 tests/specs/npm_tests/dynamic_import_json/__test__.jsonc delete mode 100644 tests/specs/npm_tests/dynamic_import_json/import_json/main.js delete mode 100644 tests/specs/npm_tests/dynamic_import_json/import_json/main.out delete mode 100644 tests/specs/npm_tests/dynamic_import_reload_same_package/__test__.jsonc delete mode 100644 tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out delete mode 100644 tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts delete mode 100644 tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts delete mode 100644 tests/specs/npm_tests/env_var_re_export_dev/__test__.jsonc delete mode 100644 tests/specs/npm_tests/env_var_re_export_dev/env_var_re_export/main.js delete mode 100644 tests/specs/npm_tests/env_var_re_export_prod/__test__.jsonc delete mode 100644 tests/specs/npm_tests/env_var_re_export_prod/env_var_re_export/main.js delete mode 100644 tests/specs/npm_tests/error_version_after_subpath/__test__.jsonc delete mode 100644 tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.js delete mode 100644 tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.out delete mode 100644 tests/specs/npm_tests/import_json/__test__.jsonc delete mode 100644 tests/specs/npm_tests/import_json/import_json/main.js delete mode 100644 tests/specs/npm_tests/import_json/import_json/main.out delete mode 100644 tests/specs/npm_tests/import_map/__test__.jsonc delete mode 100644 tests/specs/npm_tests/import_map/import_map/import_map.json delete mode 100644 tests/specs/npm_tests/import_map/import_map/main.js delete mode 100644 tests/specs/npm_tests/import_map/import_map/main.out delete mode 100644 tests/specs/npm_tests/imports_package_json/__test__.jsonc delete mode 100644 tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.js delete mode 100644 tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.out delete mode 100644 tests/specs/npm_tests/imports_package_json/imports_package_json/main.js delete mode 100644 tests/specs/npm_tests/imports_package_json/imports_package_json/main.out delete mode 100644 tests/specs/npm_tests/imports_package_json/imports_package_json/package.json delete mode 100644 tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.js delete mode 100644 tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.out delete mode 100644 tests/specs/npm_tests/imports_package_json_import_not_defined/__test__.jsonc delete mode 100644 tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js delete mode 100644 tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out delete mode 100644 tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.js delete mode 100644 tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.out delete mode 100644 tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/package.json delete mode 100644 tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js delete mode 100644 tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out delete mode 100644 tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/__test__.jsonc delete mode 100644 tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js delete mode 100644 tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out delete mode 100644 tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js delete mode 100644 tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out delete mode 100644 tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json delete mode 100644 tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js delete mode 100644 tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out delete mode 100644 tests/specs/npm_tests/info_chalk_display/__test__.jsonc delete mode 100644 tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.js delete mode 100644 tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.out delete mode 100644 tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info.out delete mode 100644 tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info_json.out delete mode 100644 tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_node_modules.out delete mode 100644 tests/specs/npm_tests/info_chalk_display_node_modules_dir/__test__.jsonc delete mode 100644 tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.js delete mode 100644 tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.out delete mode 100644 tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out delete mode 100644 tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out delete mode 100644 tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out delete mode 100644 tests/specs/npm_tests/info_chalk_json/__test__.jsonc delete mode 100644 tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.js delete mode 100644 tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.out delete mode 100644 tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info.out delete mode 100644 tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info_json.out delete mode 100644 tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_node_modules.out delete mode 100644 tests/specs/npm_tests/info_chalk_json_node_modules_dir/__test__.jsonc delete mode 100644 tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.js delete mode 100644 tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.out delete mode 100644 tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out delete mode 100644 tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out delete mode 100644 tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out delete mode 100644 tests/specs/npm_tests/info_cli_chalk_display/__test__.jsonc delete mode 100644 tests/specs/npm_tests/info_cli_chalk_display/info/chalk.out delete mode 100644 tests/specs/npm_tests/info_cli_chalk_display/info/chalk_json.out delete mode 100644 tests/specs/npm_tests/info_cli_chalk_json/__test__.jsonc delete mode 100644 tests/specs/npm_tests/info_cli_chalk_json/info/chalk.out delete mode 100644 tests/specs/npm_tests/info_cli_chalk_json/info/chalk_json.out delete mode 100644 tests/specs/npm_tests/info_peer_deps/__test__.jsonc delete mode 100644 tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.out delete mode 100644 tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.ts delete mode 100644 tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info.out delete mode 100644 tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out delete mode 100644 tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out delete mode 100644 tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out delete mode 100644 tests/specs/npm_tests/info_peer_deps_json/__test__.jsonc delete mode 100644 tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.out delete mode 100644 tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.ts delete mode 100644 tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out delete mode 100644 tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out delete mode 100644 tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out delete mode 100644 tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out delete mode 100644 tests/specs/npm_tests/mixed_case_package_name_global_dir/__test__.jsonc delete mode 100644 tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.out delete mode 100644 tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts delete mode 100644 tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.out delete mode 100644 tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts delete mode 100644 tests/specs/npm_tests/mixed_case_package_name_local_dir/__test__.jsonc delete mode 100644 tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.out delete mode 100644 tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts delete mode 100644 tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.out delete mode 100644 tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts delete mode 100644 tests/specs/npm_tests/node_modules_deno_node_modules/__test__.jsonc delete mode 100644 tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out delete mode 100644 tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts delete mode 100644 tests/specs/npm_tests/node_modules_deno_node_modules_local/__test__.jsonc delete mode 100644 tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out delete mode 100644 tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts delete mode 100644 tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/__test__.jsonc delete mode 100644 tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js delete mode 100644 tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out delete mode 100644 tests/specs/npm_tests/node_modules_dir_require_main_entry/__test__.jsonc delete mode 100644 tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.js delete mode 100644 tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.out delete mode 100644 tests/specs/npm_tests/node_modules_dir_with_deps/__test__.jsonc delete mode 100644 tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.js delete mode 100644 tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.out delete mode 100644 tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info.out delete mode 100644 tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out delete mode 100644 tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out delete mode 100644 tests/specs/npm_tests/node_modules_dir_yargs/__test__.jsonc delete mode 100644 tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.js delete mode 100644 tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.out delete mode 100644 tests/specs/npm_tests/non_existent_dep/__test__.jsonc delete mode 100644 tests/specs/npm_tests/non_existent_dep_version/__test__.jsonc delete mode 100644 tests/specs/npm_tests/nonexistent_file/__test__.jsonc delete mode 100644 tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.js delete mode 100644 tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.out delete mode 100644 tests/specs/npm_tests/nonexistent_file_node_modules_dir/__test__.jsonc delete mode 100644 tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.js delete mode 100644 tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.out delete mode 100644 tests/specs/npm_tests/permissions_outside_package/__test__.jsonc delete mode 100644 tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/config.js delete mode 100644 tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/package.json delete mode 100644 tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.out delete mode 100644 tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.ts delete mode 100644 tests/specs/npm_tests/remote_npm_specifier/__test__.jsonc delete mode 100644 tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.out delete mode 100644 tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.ts delete mode 100644 tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/remote.ts delete mode 100644 tests/specs/npm_tests/require_esm/__test__.jsonc delete mode 100644 tests/specs/npm_tests/require_esm/require_esm/esm.js delete mode 100644 tests/specs/npm_tests/require_esm/require_esm/main.out delete mode 100644 tests/specs/npm_tests/require_esm/require_esm/main.ts delete mode 100644 tests/specs/npm_tests/require_json/__test__.jsonc delete mode 100644 tests/specs/npm_tests/require_json/require_json/main.js delete mode 100644 tests/specs/npm_tests/require_json/require_json/main.out delete mode 100644 tests/specs/npm_tests/reserved_word_exports/__test__.jsonc delete mode 100644 tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.out delete mode 100644 tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.ts delete mode 100644 tests/specs/npm_tests/run_existing_npm_package_with_subpath/__test__.jsonc delete mode 100644 tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out delete mode 100644 tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json delete mode 100644 tests/specs/npm_tests/sub_paths/__test__.jsonc delete mode 100644 tests/specs/npm_tests/sub_paths/sub_paths/main.jsx delete mode 100644 tests/specs/npm_tests/sub_paths/sub_paths/main.out delete mode 100644 tests/specs/npm_tests/tarball_with_global_header/__test__.jsonc delete mode 100644 tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.js delete mode 100644 tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.out delete mode 100644 tests/specs/npm_tests/translate_cjs_to_esm/__test__.jsonc delete mode 100644 tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.js delete mode 100644 tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.out delete mode 100644 tests/specs/npm_tests/types_ambient_module/__test__.jsonc delete mode 100644 tests/specs/npm_tests/types_ambient_module/types_ambient_module/import_map.json delete mode 100644 tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.out delete mode 100644 tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.ts delete mode 100644 tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.out delete mode 100644 tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.ts delete mode 100644 tests/specs/npm_tests/types_ambient_module_import_map/__test__.jsonc delete mode 100644 tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/import_map.json delete mode 100644 tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.out delete mode 100644 tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.ts delete mode 100644 tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.out delete mode 100644 tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.ts delete mode 100644 tests/specs/npm_tests/types_d_ext/__test__.jsonc delete mode 100644 tests/specs/npm_tests/types_d_ext/d_ext/main.out delete mode 100644 tests/specs/npm_tests/types_d_ext/d_ext/main.ts delete mode 100644 tests/specs/npm_tests/types_entry_value_not_exists/__test__.jsonc delete mode 100644 tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.out delete mode 100644 tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.ts delete mode 100644 tests/specs/npm_tests/types_exports_import_types/__test__.jsonc delete mode 100644 tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.out delete mode 100644 tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.ts delete mode 100644 tests/specs/npm_tests/types_no_types_entry/__test__.jsonc delete mode 100644 tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.out delete mode 100644 tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.ts delete mode 100644 tests/specs/npm_tests/typescript_file_in_package/__test__.jsonc delete mode 100644 tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.out delete mode 100644 tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.ts create mode 100644 tests/specs/permission/allow_import/__test__.jsonc create mode 100644 tests/specs/permission/allow_import/builtin_host.ts create mode 100644 tests/specs/permission/allow_import/cache.out create mode 100644 tests/specs/permission/allow_import/check.out create mode 100644 tests/specs/permission/allow_import/compile.out create mode 100644 tests/specs/permission/allow_import/doc.out create mode 100644 tests/specs/permission/allow_import/doc.ts create mode 100644 tests/specs/permission/allow_import/doc_allowed.out create mode 100644 tests/specs/permission/allow_import/info.out create mode 100644 tests/specs/permission/allow_import/main.ts create mode 100644 tests/specs/permission/allow_import/run.out create mode 100644 tests/specs/permission/allow_import/serve.out create mode 100644 tests/specs/permission/allow_import_jsx/__test__.jsonc create mode 100644 tests/specs/permission/allow_import_jsx/deno.jsonc create mode 100644 tests/specs/permission/allow_import_jsx/main.out create mode 100644 tests/specs/permission/allow_import_jsx/main.tsx create mode 100644 tests/specs/permission/allow_import_main_module/__test__.jsonc create mode 100644 tests/specs/permission/allow_import_not_on_redirect/__test__.jsonc create mode 100644 tests/specs/permission/allow_import_not_on_redirect/main.js create mode 100644 tests/specs/permission/allow_import_not_on_redirect/main.out create mode 100644 tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts create mode 100644 tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts.out create mode 100644 tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts create mode 100644 tests/testdata/add.ts delete mode 100644 tests/testdata/workers/permissions_dynamic_remote.ts delete mode 100644 tests/testdata/workers/permissions_dynamic_remote.ts.out delete mode 100644 tests/testdata/workers/permissions_remote_remote.ts (limited to 'tests') diff --git a/tests/integration/cache_tests.rs b/tests/integration/cache_tests.rs index 9c6f1f7f1..d9fb8e38e 100644 --- a/tests/integration/cache_tests.rs +++ b/tests/integration/cache_tests.rs @@ -18,7 +18,7 @@ fn xdg_cache_home_dir() { .env_clear() .env("XDG_CACHE_HOME", &xdg_cache_home) .args( - "cache --reload --no-check http://localhost:4548/subdir/redirects/a.ts", + "cache --allow-import --reload --no-check http://localhost:4548/subdir/redirects/a.ts", ) .run() .skip_output_check() diff --git a/tests/integration/check_tests.rs b/tests/integration/check_tests.rs index 121dcb837..f30828a66 100644 --- a/tests/integration/check_tests.rs +++ b/tests/integration/check_tests.rs @@ -9,14 +9,14 @@ use util::TestContext; use util::TestContextBuilder; itest!(check_all { - args: "check --quiet --all check/all/check_all.ts", + args: "check --allow-import --quiet --all check/all/check_all.ts", output: "check/all/check_all.out", http_server: true, exit_code: 1, }); itest!(check_all_local { - args: "check --quiet check/all/check_all.ts", + args: "check --allow-import --quiet check/all/check_all.ts", output_str: Some(""), http_server: true, }); @@ -227,6 +227,7 @@ fn ts_no_recheck_on_redirect() { let test_context = TestContext::default(); let check_command = test_context.new_command().args_vec([ "run", + "--allow-import", "--check", "run/017_import_redirect.ts", ]); diff --git a/tests/integration/compile_tests.rs b/tests/integration/compile_tests.rs index 215b956fd..0a5916f6f 100644 --- a/tests/integration/compile_tests.rs +++ b/tests/integration/compile_tests.rs @@ -539,6 +539,7 @@ fn check_local_by_default() { .new_command() .args_vec([ "compile", + "--allow-import", "--output", &exe.to_string_lossy(), "./compile/check_local_by_default.ts", @@ -561,6 +562,7 @@ fn check_local_by_default2() { .new_command() .args_vec([ "compile", + "--allow-import", "--output", &exe.to_string_lossy(), "./compile/check_local_by_default2.ts" diff --git a/tests/integration/coverage_tests.rs b/tests/integration/coverage_tests.rs index 9509ddcb7..ab18ef76d 100644 --- a/tests/integration/coverage_tests.rs +++ b/tests/integration/coverage_tests.rs @@ -456,6 +456,7 @@ fn no_http_coverage_data() { .new_command() .args_vec(vec![ "test".to_string(), + "--allow-import".to_string(), "--quiet".to_string(), "--no-check".to_string(), format!("--coverage={}", tempdir), diff --git a/tests/integration/install_tests.rs b/tests/integration/install_tests.rs index 2c7725443..4dfd00146 100644 --- a/tests/integration/install_tests.rs +++ b/tests/integration/install_tests.rs @@ -294,7 +294,7 @@ fn check_local_by_default() { let script_path_str = script_path.to_string_lossy().to_string(); context .new_command() - .args_vec(["install", "-g", script_path_str.as_str()]) + .args_vec(["install", "-g", "--allow-import", script_path_str.as_str()]) .envs([ ("HOME", temp_dir_str.as_str()), ("USERPROFILE", temp_dir_str.as_str()), @@ -318,7 +318,7 @@ fn check_local_by_default2() { let script_path_str = script_path.to_string_lossy().to_string(); context .new_command() - .args_vec(["install", "-g", script_path_str.as_str()]) + .args_vec(["install", "-g", "--allow-import", script_path_str.as_str()]) .envs([ ("HOME", temp_dir_str.as_str()), ("NO_COLOR", "1"), diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index a0368d8d1..539e3cc7e 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -890,7 +890,7 @@ fn lsp_format_vendor_path() { // put this dependency in the global cache context .new_command() - .args("cache http://localhost:4545/run/002_hello.ts") + .args("cache --allow-import http://localhost:4545/run/002_hello.ts") .run() .skip_output_check(); diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index 6b0901e26..1e1d6ed61 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -73,7 +73,7 @@ itest!(_005_more_imports { }); itest!(_006_url_imports { - args: "run --quiet --reload run/006_url_imports.ts", + args: "run --quiet --reload --allow-import run/006_url_imports.ts", output: "run/006_url_imports.ts.out", http_server: true, }); @@ -105,24 +105,25 @@ itest!(_016_double_await { }); itest!(_017_import_redirect { - args: "run --quiet --reload run/017_import_redirect.ts", + args: "run --quiet --allow-import --reload run/017_import_redirect.ts", output: "run/017_import_redirect.ts.out", }); itest!(_017_import_redirect_check { - args: "run --quiet --reload --check run/017_import_redirect.ts", + args: + "run --quiet --allow-import --reload --check run/017_import_redirect.ts", output: "run/017_import_redirect.ts.out", }); itest!(_017_import_redirect_vendor_dir { args: - "run --quiet --reload --vendor --check $TESTDATA/run/017_import_redirect.ts", + "run --quiet --allow-import --reload --vendor --check $TESTDATA/run/017_import_redirect.ts", output: "run/017_import_redirect.ts.out", temp_cwd: true, }); itest!(_017_import_redirect_info { - args: "info --quiet --reload run/017_import_redirect.ts", + args: "info --quiet --allow-import --reload run/017_import_redirect.ts", output: "run/017_import_redirect_info.out", }); @@ -132,7 +133,7 @@ itest!(_018_async_catch { }); itest!(_019_media_types { - args: "run --reload run/019_media_types.ts", + args: "run --reload --allow-import run/019_media_types.ts", output: "run/019_media_types.ts.out", http_server: true, }); @@ -154,14 +155,14 @@ itest!(_025_reload_js_type_error { }); itest!(_027_redirect_typescript { - args: "run --quiet --reload run/027_redirect_typescript.ts", + args: "run --quiet --reload --allow-import run/027_redirect_typescript.ts", output: "run/027_redirect_typescript.ts.out", http_server: true, }); itest!(_027_redirect_typescript_vendor_dir { args: - "run --quiet --reload --vendor $TESTDATA/run/027_redirect_typescript.ts", + "run --quiet --reload --vendor --allow-import $TESTDATA/run/027_redirect_typescript.ts", output: "run/027_redirect_typescript.ts.out", http_server: true, temp_cwd: true, @@ -175,14 +176,14 @@ itest!(_028_args { itest!(_033_import_map_remote { args: - "run --quiet --reload --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json import_maps/test_remote.ts", + "run --quiet --reload --allow-import --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json import_maps/test_remote.ts", output: "run/033_import_map_remote.out", http_server: true, }); itest!(_033_import_map_vendor_dir_remote { args: - "run --quiet --reload --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json --vendor $TESTDATA/import_maps/test_remote.ts", + "run --quiet --reload --allow-import --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json --vendor $TESTDATA/import_maps/test_remote.ts", output: "run/033_import_map_remote.out", http_server: true, temp_cwd: true, @@ -190,7 +191,7 @@ itest!(_033_import_map_vendor_dir_remote { itest!(_033_import_map_data_uri { args: - "run --quiet --reload --import-map=data:application/json;charset=utf-8;base64,ewogICJpbXBvcnRzIjogewogICAgInRlc3Rfc2VydmVyLyI6ICJodHRwOi8vbG9jYWxob3N0OjQ1NDUvIgogIH0KfQ== run/import_maps/test_data.ts", + "run --quiet --reload --allow-import --import-map=data:application/json;charset=utf-8;base64,ewogICJpbXBvcnRzIjogewogICAgInRlc3Rfc2VydmVyLyI6ICJodHRwOi8vbG9jYWxob3N0OjQ1NDUvIgogIH0KfQ== run/import_maps/test_data.ts", output: "run/import_maps/test_data.ts.out", http_server: true, }); @@ -201,7 +202,7 @@ itest!(onload { }); itest!(_035_cached_only_flag { - args: "run --reload --check --cached-only http://127.0.0.1:4545/run/019_media_types.ts", + args: "run --reload --check --allow-import --cached-only http://127.0.0.1:4545/run/019_media_types.ts", output: "run/035_cached_only_flag.out", exit_code: 1, http_server: true, @@ -237,14 +238,14 @@ itest!(_047_jsx { }); itest!(_048_media_types_jsx { - args: "run --reload run/048_media_types_jsx.ts", + args: "run --reload --allow-import run/048_media_types_jsx.ts", output: "run/048_media_types_jsx.ts.out", http_server: true, }); itest!(_052_no_remote_flag { args: - "run --reload --check --no-remote http://127.0.0.1:4545/run/019_media_types.ts", + "run --reload --check --allow-import --no-remote http://127.0.0.1:4545/run/019_media_types.ts", output: "run/052_no_remote_flag.out", exit_code: 1, http_server: true, @@ -467,7 +468,7 @@ itest!(dynamic_import_already_rejected { }); itest!(dynamic_import_concurrent_non_statically_analyzable { - args: "run --allow-read --allow-net --quiet run/dynamic_import_concurrent_non_statically_analyzable/main.ts", + args: "run --allow-import --allow-read --allow-net --quiet run/dynamic_import_concurrent_non_statically_analyzable/main.ts", output: "run/dynamic_import_concurrent_non_statically_analyzable/main.out", http_server: true, }); @@ -802,7 +803,7 @@ itest!(private_field_presence_no_check { itest!(lock_write_fetch { args: - "run --quiet --allow-read --allow-write --allow-env --allow-run run/lock_write_fetch/main.ts", + "run --quiet --allow-import --allow-read --allow-write --allow-env --allow-run run/lock_write_fetch/main.ts", output: "run/lock_write_fetch/main.out", http_server: true, exit_code: 0, @@ -810,26 +811,27 @@ itest!(lock_write_fetch { itest!(lock_check_ok { args: - "run --quiet --lock=run/lock_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", + "run --quiet --allow-import --lock=run/lock_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", output: "run/003_relative_import.ts.out", http_server: true, }); itest!(lock_check_ok2 { - args: "run --lock=run/lock_check_ok2.json run/019_media_types.ts", + args: + "run --allow-import --lock=run/lock_check_ok2.json run/019_media_types.ts", output: "run/019_media_types.ts.out", http_server: true, }); itest!(lock_v2_check_ok { args: - "run --quiet --lock=run/lock_v2_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", + "run --allow-import --quiet --lock=run/lock_v2_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", output: "run/003_relative_import.ts.out", http_server: true, }); itest!(lock_v2_check_ok2 { - args: "run --lock=run/lock_v2_check_ok2.json run/019_media_types.ts", + args: "run --allow-import --lock=run/lock_v2_check_ok2.json run/019_media_types.ts", output: "run/019_media_types.ts.out", http_server: true, }); @@ -849,7 +851,7 @@ fn lock_redirects() { ); context .new_command() - .args("run main.ts") + .args("run --allow-import main.ts") .run() .skip_output_check(); let initial_lockfile_text = r#"{ @@ -865,7 +867,7 @@ fn lock_redirects() { assert_eq!(temp_dir.read_to_string("deno.lock"), initial_lockfile_text); context .new_command() - .args("run main.ts") + .args("run --allow-import main.ts") .run() .assert_matches_text("Hello World\n"); assert_eq!(temp_dir.read_to_string("deno.lock"), initial_lockfile_text); @@ -892,7 +894,7 @@ fn lock_redirects() { // it should use the echo script instead context .new_command() - .args("run main.ts Hi there") + .args("run --allow-import main.ts Hi there") .run() .assert_matches_text(concat!( "Download http://localhost:4545/echo.ts\n", @@ -1260,7 +1262,7 @@ itest!(config_types { itest!(config_types_remote { http_server: true, - args: "run --reload --quiet --check=all --config run/config_types/remote.tsconfig.json run/config_types/main.ts", + args: "run --allow-import --reload --quiet --check=all --config run/config_types/remote.tsconfig.json run/config_types/main.ts", output: "run/config_types/main.out", }); @@ -1365,9 +1367,10 @@ itest!(error_015_dynamic_import_permissions { http_server: true, }); -// We have an allow-net flag but not allow-read, it should still result in error. +// We have an allow-import flag but not allow-read, it should still result in error. itest!(error_016_dynamic_import_permissions2 { - args: "run --reload --allow-net run/error_016_dynamic_import_permissions2.js", + args: + "run --reload --allow-import run/error_016_dynamic_import_permissions2.js", output: "run/error_016_dynamic_import_permissions2.out", exit_code: 1, http_server: true, @@ -1428,7 +1431,7 @@ itest!(error_025_tab_indent { }); itest!(error_026_remote_import_error { - args: "run run/error_026_remote_import_error.ts", + args: "run --allow-import run/error_026_remote_import_error.ts", output: "run/error_026_remote_import_error.ts.out", exit_code: 1, http_server: true, @@ -1471,18 +1474,18 @@ itest!(error_type_definitions { }); itest!(error_local_static_import_from_remote_ts { - args: "run --reload http://localhost:4545/run/error_local_static_import_from_remote.ts", - exit_code: 1, - http_server: true, - output: "run/error_local_static_import_from_remote.ts.out", - }); + args: "run --allow-import --reload http://localhost:4545/run/error_local_static_import_from_remote.ts", + exit_code: 1, + http_server: true, + output: "run/error_local_static_import_from_remote.ts.out", +}); itest!(error_local_static_import_from_remote_js { - args: "run --reload http://localhost:4545/run/error_local_static_import_from_remote.js", - exit_code: 1, - http_server: true, - output: "run/error_local_static_import_from_remote.js.out", - }); + args: "run --allow-import --reload http://localhost:4545/run/error_local_static_import_from_remote.js", + exit_code: 1, + http_server: true, + output: "run/error_local_static_import_from_remote.js.out", +}); itest!(exit_error42 { exit_code: 42, @@ -1531,7 +1534,7 @@ itest!(finalization_registry { }); itest!(https_import { - args: "run --quiet --reload --cert tls/RootCA.pem run/https_import.ts", + args: "run --allow-import --quiet --reload --cert tls/RootCA.pem run/https_import.ts", output: "run/https_import.ts.out", http_server: true, }); @@ -1542,18 +1545,18 @@ itest!(if_main { }); itest!(import_meta { - args: "run --quiet --reload --import-map=run/import_meta/importmap.json run/import_meta/main.ts", + args: "run --allow-import --quiet --reload --import-map=run/import_meta/importmap.json run/import_meta/main.ts", output: "run/import_meta/main.out", http_server: true, }); itest!(main_module { - args: "run --quiet --reload run/main_module/main.ts", + args: "run --quiet --reload run/main_module/main.ts", output: "run/main_module/main.out", }); itest!(no_check { - args: "run --quiet --reload --no-check run/006_url_imports.ts", + args: "run --allow-import --quiet --reload --no-check run/006_url_imports.ts", output: "run/006_url_imports.ts.out", http_server: true, }); @@ -1569,14 +1572,15 @@ itest!(decorators_tc39_proposal { }); itest!(check_remote { - args: "run --quiet --reload --check=all run/no_check_remote.ts", + args: + "run --quiet --allow-import --reload --check=all run/no_check_remote.ts", output: "run/no_check_remote.ts.disabled.out", exit_code: 1, http_server: true, }); itest!(no_check_remote { - args: "run --quiet --reload --no-check=remote run/no_check_remote.ts", + args: "run --allow-import --quiet --reload --no-check=remote run/no_check_remote.ts", output: "run/no_check_remote.ts.enabled.out", http_server: true, }); @@ -1603,13 +1607,15 @@ itest!(type_definitions_for_export { }); itest!(type_directives_01 { - args: "run --reload --check=all -L debug run/type_directives_01.ts", + args: + "run --allow-import --reload --check=all -L debug run/type_directives_01.ts", output: "run/type_directives_01.ts.out", http_server: true, }); itest!(type_directives_02 { - args: "run --reload --check=all -L debug run/type_directives_02.ts", + args: + "run --allow-import --reload --check=all -L debug run/type_directives_02.ts", output: "run/type_directives_02.ts.out", }); @@ -1629,13 +1635,13 @@ fn type_directives_js_main() { } itest!(type_directives_redirect { - args: "run --reload --check run/type_directives_redirect.ts", + args: "run --allow-import --reload --check run/type_directives_redirect.ts", output: "run/type_directives_redirect.ts.out", http_server: true, }); itest!(type_headers_deno_types { - args: "run --reload --check run/type_headers_deno_types.ts", + args: "run --allow-import --reload --check run/type_headers_deno_types.ts", output: "run/type_headers_deno_types.ts.out", http_server: true, }); @@ -1839,20 +1845,20 @@ itest!(unstable_kv_enabled { }); itest!(import_compression { - args: "run --quiet --reload --allow-net run/import_compression/main.ts", + args: "run --allow-import --quiet --reload --allow-net run/import_compression/main.ts", output: "run/import_compression/main.out", http_server: true, }); itest!(disallow_http_from_https_js { - args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.js", + args: "run --allow-import --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.js", output: "run/disallow_http_from_https_js.out", http_server: true, exit_code: 1, }); itest!(disallow_http_from_https_ts { - args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.ts", + args: "run --allow-import --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.ts", output: "run/disallow_http_from_https_ts.out", http_server: true, exit_code: 1, @@ -1904,7 +1910,7 @@ itest!(es_private_fields { }); itest!(ts_import_from_js { - args: "run --quiet --reload run/ts_import_from_js/main.js", + args: "run --allow-import --quiet --reload run/ts_import_from_js/main.js", output: "run/ts_import_from_js/main.out", http_server: true, }); @@ -1915,100 +1921,101 @@ itest!(jsx_import_from_ts { }); itest!(jsx_import_source_pragma { - args: "run --reload run/jsx_import_source_pragma.tsx", + args: "run --reload --allow-import run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_config { args: - "run --reload --config jsx/deno-jsx.jsonc --no-lock run/jsx_import_source_pragma.tsx", + "run --reload --allow-import --config jsx/deno-jsx.jsonc --no-lock run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_dev_config { args: - "run --reload --config jsx/deno-jsxdev.jsonc --no-lock run/jsx_import_source_pragma.tsx", + "run --reload --allow-import --config jsx/deno-jsxdev.jsonc --no-lock run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source_dev.out", http_server: true, }); itest!(jsx_import_source_no_pragma { args: - "run --reload --config jsx/deno-jsx.jsonc --no-lock run/jsx_import_source_no_pragma.tsx", + "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_no_pragma_dev { - args: "run --reload --config jsx/deno-jsxdev.jsonc --no-lock run/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --config jsx/deno-jsxdev.jsonc --no-lock run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_dev.out", http_server: true, }); itest!(jsx_import_source_pragma_import_map { - args: "run --reload --import-map jsx/import-map.json run/jsx_import_source_pragma_import_map.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json run/jsx_import_source_pragma_import_map.tsx", output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_pragma_import_map_dev { - args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_pragma_import_map.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_pragma_import_map.tsx", output: "run/jsx_import_source_import_map_dev.out", http_server: true, }); itest!(jsx_import_source_precompile_import_map { - args: "run --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile.jsonc run/jsx_precompile/no_pragma.tsx", + args: "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile.jsonc run/jsx_precompile/no_pragma.tsx", output: "run/jsx_precompile/no_pragma.out", http_server: true, }); itest!(jsx_import_source_precompile_import_map_skip_element { - args: "run --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile-skip.jsonc run/jsx_precompile/skip.tsx", + args: "run --allow-import --reload --check --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-precompile-skip.jsonc run/jsx_precompile/skip.tsx", output: "run/jsx_precompile/skip.out", http_server: true, }); itest!(jsx_import_source_import_map { - args: "run --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc run/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_import_map_dev { - args: "run --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map_dev.out", http_server: true, }); itest!(jsx_import_source_import_map_scoped { - args: "run --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsx-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsx-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_import_map_scoped_dev { - args: "run --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --import-map jsx/import-map-scoped.json --no-lock --config jsx/deno-jsxdev-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map_dev.out", http_server: true, }); itest!(jsx_import_source_pragma_no_check { - args: "run --reload --no-check run/jsx_import_source_pragma.tsx", + args: + "run --allow-import --reload --no-check run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_config_no_check { - args: "run --reload --config jsx/deno-jsx.jsonc --no-lock --no-check run/jsx_import_source_pragma.tsx", + args: "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_config_vendor_dir { - args: "run --reload --config jsx/deno-jsx.jsonc --no-lock --vendor $TESTDATA/run/jsx_import_source_pragma.tsx", + args: "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --vendor $TESTDATA/run/jsx_import_source_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, temp_cwd: true, @@ -2017,19 +2024,19 @@ itest!(jsx_import_source_pragma_with_config_vendor_dir { itest!(jsx_import_source_no_pragma_no_check { args: - "run --reload --config jsx/deno-jsx.jsonc --no-lock --no-check run/jsx_import_source_no_pragma.tsx", + "run --allow-import --reload --config jsx/deno-jsx.jsonc --no-lock --no-check run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_import_map_no_check { - args: "run --reload --import-map jsx/import-map.json --no-check run/jsx_import_source_pragma_import_map.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json --no-check run/jsx_import_source_pragma_import_map.tsx", output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_import_map_no_check { - args: "run --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc --no-check run/jsx_import_source_no_pragma.tsx", + args: "run --allow-import --reload --import-map jsx/import-map.json --no-lock --config jsx/deno-jsx-import-map.jsonc --no-check run/jsx_import_source_no_pragma.tsx", output: "run/jsx_import_source_import_map.out", http_server: true, }); @@ -2093,7 +2100,7 @@ itest!(import_data_url_import_relative { }); itest!(import_data_url_imports { - args: "run --quiet --reload run/import_data_url_imports.ts", + args: "run --allow-import --quiet --reload run/import_data_url_imports.ts", output: "run/import_data_url_imports.ts.out", http_server: true, }); @@ -2127,7 +2134,7 @@ itest!(import_blob_url_import_relative { itest!(import_blob_url_imports { args: - "run --quiet --reload --allow-net=localhost:4545 run/import_blob_url_imports.ts", + "run --allow-import --quiet --reload --allow-net=localhost:4545 run/import_blob_url_imports.ts", output: "run/import_blob_url_imports.ts.out", http_server: true, }); @@ -2143,13 +2150,13 @@ itest!(import_blob_url { }); itest!(import_file_with_colon { - args: "run --quiet --reload run/import_file_with_colon.ts", + args: "run --allow-import --quiet --reload run/import_file_with_colon.ts", output: "run/import_file_with_colon.ts.out", http_server: true, }); itest!(import_extensionless { - args: "run --quiet --reload run/import_extensionless.ts", + args: "run --allow-import --quiet --reload run/import_extensionless.ts", output: "run/import_extensionless.ts.out", http_server: true, }); @@ -2195,7 +2202,7 @@ itest!(inline_js_source_map_2_with_inline_contents { // was not commented out. The source line is remapped using source contents that // from the module graph. itest!(inline_js_source_map_with_contents_from_graph { - args: "run --quiet run/inline_js_source_map_with_contents_from_graph.js", + args: "run --allow-import --quiet run/inline_js_source_map_with_contents_from_graph.js", output: "run/inline_js_source_map_with_contents_from_graph.js.out", exit_code: 1, http_server: true, @@ -3031,14 +3038,14 @@ mod permissions { }); itest!(dynamic_import_permissions_remote_remote { - args: "run --quiet --reload --allow-net=localhost:4545 dynamic_import/permissions_remote_remote.ts", + args: "run --quiet --reload --allow-import=localhost:4545 dynamic_import/permissions_remote_remote.ts", output: "dynamic_import/permissions_remote_remote.ts.out", http_server: true, exit_code: 1, }); itest!(dynamic_import_permissions_data_remote { - args: "run --quiet --reload --allow-net=localhost:4545 dynamic_import/permissions_data_remote.ts", + args: "run --quiet --reload --allow-import=localhost:4545 dynamic_import/permissions_data_remote.ts", output: "dynamic_import/permissions_data_remote.ts.out", http_server: true, exit_code: 1, @@ -3329,7 +3336,7 @@ itest!(no_config_auto_discovery_for_local_script { }); itest!(config_not_auto_discovered_for_remote_script { - args: "run --quiet http://127.0.0.1:4545/run/with_config/server_side_work.ts", + args: "run --allow-import --quiet http://127.0.0.1:4545/run/with_config/server_side_work.ts", output_str: Some("ok\n"), http_server: true, }); @@ -3468,6 +3475,7 @@ fn check_local_then_remote() { let output = util::deno_cmd_with_deno_dir(&deno_dir) .current_dir(util::testdata_path()) .arg("run") + .arg("--allow-import") .arg("--check") .arg("run/remote_type_error/main.ts") .spawn() @@ -3478,6 +3486,7 @@ fn check_local_then_remote() { let output = util::deno_cmd_with_deno_dir(&deno_dir) .current_dir(util::testdata_path()) .arg("run") + .arg("--allow-import") .arg("--check=all") .arg("run/remote_type_error/main.ts") .env("NO_COLOR", "1") @@ -3655,6 +3664,7 @@ fn cache_test() { .env("DENO_DIR", deno_dir.path()) .current_dir(util::testdata_path()) .arg("cache") + .arg("--allow-import=localhost:4545") .arg("--check=all") .arg("-L") .arg("debug") @@ -3670,6 +3680,7 @@ fn cache_test() { .env("NO_COLOR", "1") .current_dir(util::testdata_path()) .arg("run") + .arg("--allow-import=localhost:4545") .arg(module_url.to_string()) .output() .expect("Failed to spawn script"); @@ -3819,6 +3830,7 @@ fn basic_auth_tokens() { let output = util::deno_cmd() .current_dir(util::root_path()) .arg("run") + .arg("--allow-import") .arg("http://127.0.0.1:4554/run/001_hello.js") .piped_output() .spawn() @@ -3840,6 +3852,7 @@ fn basic_auth_tokens() { let output = util::deno_cmd() .current_dir(util::root_path()) .arg("run") + .arg("--allow-import") .arg("http://127.0.0.1:4554/run/001_hello.js") .env("DENO_AUTH_TOKENS", "testuser123:testpassabc@127.0.0.1:4554") .piped_output() @@ -4404,7 +4417,7 @@ async fn websocket_server_idletimeout() { } itest!(no_lock_flag { - args: "run --no-lock run/no_lock_flag/main.ts", + args: "run --allow-import --no-lock run/no_lock_flag/main.ts", output: "run/no_lock_flag/main.out", http_server: true, exit_code: 0, @@ -4563,7 +4576,9 @@ pub fn vendor_dir_config_file() { console.log(returnsHi());"#, ); - let deno_run_cmd = test_context.new_command().args("run --quiet main.ts"); + let deno_run_cmd = test_context + .new_command() + .args("run --allow-import --quiet main.ts"); deno_run_cmd.run().assert_matches_text("Hi\n"); assert!(vendor_dir.exists()); @@ -4574,13 +4589,15 @@ console.log(returnsHi());"#, assert!(!vendor_dir.exists()); test_context .new_command() - .args("cache --quiet --vendor main.ts") + .args("cache --allow-import --quiet --vendor main.ts") .run(); assert!(vendor_dir.exists()); rm_vendor_dir(); temp_dir.write("deno.json", r#"{ "vendor": true }"#); - let cache_command = test_context.new_command().args("cache --quiet main.ts"); + let cache_command = test_context + .new_command() + .args("cache --allow-import --quiet main.ts"); cache_command.run(); assert!(vendor_dir.exists()); @@ -4608,7 +4625,7 @@ console.log(returnsHi());"#, test_context .new_command() // http_localhost_4545/subdir/#capitals_c75d7/main.js - .args("cache http://localhost:4545/subdir/CAPITALS/main.js") + .args("cache --allow-import http://localhost:4545/subdir/CAPITALS/main.js") .run() .skip_output_check(); assert_eq!( @@ -4625,7 +4642,7 @@ console.log(returnsHi());"#, test_context .new_command() // todo(dsherret): seems wrong that we don't auto-discover the config file to get the vendor directory for this - .args("run --vendor http://localhost:4545/subdir/CAPITALS/hello_there.ts") + .args("run --allow-import --vendor http://localhost:4545/subdir/CAPITALS/hello_there.ts") .run() .assert_matches_text("hello there\n"); @@ -5120,21 +5137,23 @@ fn emit_failed_readonly_file_system() { fn handle_invalid_path_error() { let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir()); let output = deno_cmd.arg("run").arg("file://asdf").output().unwrap(); - assert!( - String::from_utf8_lossy(&output.stderr).contains("Invalid file path.") + assert_contains!( + String::from_utf8_lossy(&output.stderr), + "Invalid file path." ); let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir()); let output = deno_cmd.arg("run").arg("/a/b").output().unwrap(); - assert!(String::from_utf8_lossy(&output.stderr).contains("Module not found")); + assert_contains!(String::from_utf8_lossy(&output.stderr), "Module not found"); let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir()); let output = deno_cmd.arg("run").arg("//a/b").output().unwrap(); - assert!( - String::from_utf8_lossy(&output.stderr).contains("Invalid file path.") + assert_contains!( + String::from_utf8_lossy(&output.stderr), + "Invalid file path." ); let deno_cmd = util::deno_cmd_with_deno_dir(&util::new_deno_dir()); let output = deno_cmd.arg("run").arg("///a/b").output().unwrap(); - assert!(String::from_utf8_lossy(&output.stderr).contains("Module not found")); + assert_contains!(String::from_utf8_lossy(&output.stderr), "Module not found"); } diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index 56686cd14..122353bba 100644 --- a/tests/integration/watcher_tests.rs +++ b/tests/integration/watcher_tests.rs @@ -1399,6 +1399,7 @@ async fn run_watch_reload_once() { let mut child = util::deno_cmd() .current_dir(t.path()) .arg("run") + .arg("--allow-import") .arg("--watch") .arg("--reload") .arg(&file_to_watch) diff --git a/tests/specs/bench/check_local_by_default/__test__.jsonc b/tests/specs/bench/check_local_by_default/__test__.jsonc index 76dd80b7b..42dbe57d3 100644 --- a/tests/specs/bench/check_local_by_default/__test__.jsonc +++ b/tests/specs/bench/check_local_by_default/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "bench --quiet check_local_by_default.ts", + "args": "bench --allow-import --quiet check_local_by_default.ts", "output": "check_local_by_default.out" } diff --git a/tests/specs/bench/check_local_by_default2/__test__.jsonc b/tests/specs/bench/check_local_by_default2/__test__.jsonc index 5f2366d1e..7f4ca0e39 100644 --- a/tests/specs/bench/check_local_by_default2/__test__.jsonc +++ b/tests/specs/bench/check_local_by_default2/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "bench --quiet check_local_by_default2.ts", + "args": "bench --allow-import --quiet check_local_by_default2.ts", "output": "check_local_by_default2.out", "exitCode": 1 } diff --git a/tests/specs/cache/check_local_by_default/__test__.jsonc b/tests/specs/cache/check_local_by_default/__test__.jsonc index e6d0829fd..e3ce115d8 100644 --- a/tests/specs/cache/check_local_by_default/__test__.jsonc +++ b/tests/specs/cache/check_local_by_default/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "cache --quiet check_local_by_default.ts", + "args": "cache --quiet --allow-import check_local_by_default.ts", "output": "check_local_by_default.out" } diff --git a/tests/specs/cache/check_local_by_default2/__test__.jsonc b/tests/specs/cache/check_local_by_default2/__test__.jsonc index a9e70dcd9..36bcd6ee6 100644 --- a/tests/specs/cache/check_local_by_default2/__test__.jsonc +++ b/tests/specs/cache/check_local_by_default2/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "cache --quiet check_local_by_default2.ts", + "args": "cache --quiet --allow-import check_local_by_default2.ts", "output": "check_local_by_default2.out" } diff --git a/tests/specs/cache/fetch_multiple/__test__.jsonc b/tests/specs/cache/fetch_multiple/__test__.jsonc index a5cf41113..934b65499 100644 --- a/tests/specs/cache/fetch_multiple/__test__.jsonc +++ b/tests/specs/cache/fetch_multiple/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "cache --reload --check=all test.ts other.ts", + "args": "cache --reload --allow-import --check=all test.ts other.ts", "output": "fetch_multiple.out" } diff --git a/tests/specs/cache/globbing/__test__.jsonc b/tests/specs/cache/globbing/__test__.jsonc index 9bf210bb4..2dfb49ffb 100644 --- a/tests/specs/cache/globbing/__test__.jsonc +++ b/tests/specs/cache/globbing/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "cache *.ts", + "args": "cache --allow-import *.ts", "output": "Download http://localhost:4545/echo.ts\n", "exitCode": 0 } diff --git a/tests/specs/cache/redirect/__test__.jsonc b/tests/specs/cache/redirect/__test__.jsonc index 251bc6174..6c0ab3c9f 100644 --- a/tests/specs/cache/redirect/__test__.jsonc +++ b/tests/specs/cache/redirect/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "cache --reload --check=all http://localhost:4548/subdir/redirects/a.ts", + "args": "cache --reload --allow-import --check=all http://localhost:4548/subdir/redirects/a.ts", "output": "redirect_cache.out" } diff --git a/tests/specs/cert/cafile_ts_fetch/__test__.jsonc b/tests/specs/cert/cafile_ts_fetch/__test__.jsonc index 8ace23f25..35573839c 100644 --- a/tests/specs/cert/cafile_ts_fetch/__test__.jsonc +++ b/tests/specs/cert/cafile_ts_fetch/__test__.jsonc @@ -1,6 +1,6 @@ { "steps": [{ - "args": "run --quiet --reload --allow-net --cert RootCA.pem cafile_ts_fetch.ts", + "args": "run --quiet --reload --allow-net --allow-import --cert RootCA.pem cafile_ts_fetch.ts", "flaky": true, "output": "cafile_ts_fetch.ts.out" }, { @@ -8,11 +8,11 @@ "flaky": true, "output": "cafile_ts_fetch.ts.out" }, { - "args": "info --quiet --cert RootCA.pem https://localhost:5545/cert/cafile_info.ts", + "args": "info --quiet --allow-import --cert RootCA.pem https://localhost:5545/cert/cafile_info.ts", "flaky": true, "output": "cafile_info.ts.out" }, { - "args": "cache --quiet --cert RootCA.pem http://localhost:4545/cert/cafile_url_imports.ts", + "args": "cache --quiet --allow-import --cert RootCA.pem http://localhost:4545/cert/cafile_url_imports.ts", "flaky": true, "output": "" }] diff --git a/tests/specs/cert/cafile_url_imports/__test__.jsonc b/tests/specs/cert/cafile_url_imports/__test__.jsonc index f52bb7068..4375f6027 100644 --- a/tests/specs/cert/cafile_url_imports/__test__.jsonc +++ b/tests/specs/cert/cafile_url_imports/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --quiet --reload --cert RootCA.pem cafile_url_imports.ts", + "args": "run --quiet --reload --allow-import --cert RootCA.pem cafile_url_imports.ts", "flaky": true, "output": "cafile_url_imports.ts.out" } diff --git a/tests/specs/cert/cafile_url_imports_unsafe_ssl/__test__.jsonc b/tests/specs/cert/cafile_url_imports_unsafe_ssl/__test__.jsonc index 526649aa1..67df193b6 100644 --- a/tests/specs/cert/cafile_url_imports_unsafe_ssl/__test__.jsonc +++ b/tests/specs/cert/cafile_url_imports_unsafe_ssl/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --quiet --reload --unsafely-ignore-certificate-errors=localhost cafile_url_imports.ts", + "args": "run --quiet --allow-import --reload --unsafely-ignore-certificate-errors=localhost cafile_url_imports.ts", "flaky": true, "output": "cafile_url_imports_unsafe_ssl.ts.out" } diff --git a/tests/specs/cert/localhost_unsafe_ssl/__test__.jsonc b/tests/specs/cert/localhost_unsafe_ssl/__test__.jsonc index 90ca827dc..f0c1895f4 100644 --- a/tests/specs/cert/localhost_unsafe_ssl/__test__.jsonc +++ b/tests/specs/cert/localhost_unsafe_ssl/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --quiet --reload --allow-net --unsafely-ignore-certificate-errors=deno.land cafile_url_imports.ts", + "args": "run --quiet --reload --allow-import --allow-net --unsafely-ignore-certificate-errors=deno.land cafile_url_imports.ts", "output": "localhost_unsafe_ssl.ts.out", "exitCode": 1 } diff --git a/tests/specs/check/jsx_import_source_types/__test__.jsonc b/tests/specs/check/jsx_import_source_types/__test__.jsonc index 4cd2aa423..18ff8cd07 100644 --- a/tests/specs/check/jsx_import_source_types/__test__.jsonc +++ b/tests/specs/check/jsx_import_source_types/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "check --all main.tsx", + "args": "check --allow-import --all main.tsx", "output": "main.out" } diff --git a/tests/specs/check/jsx_import_source_types_config/__test__.jsonc b/tests/specs/check/jsx_import_source_types_config/__test__.jsonc index 4cd2aa423..18ff8cd07 100644 --- a/tests/specs/check/jsx_import_source_types_config/__test__.jsonc +++ b/tests/specs/check/jsx_import_source_types_config/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "check --all main.tsx", + "args": "check --allow-import --all main.tsx", "output": "main.out" } diff --git a/tests/specs/check/remote_missing_override/__test__.jsonc b/tests/specs/check/remote_missing_override/__test__.jsonc index db79e3737..9eb58dcc5 100644 --- a/tests/specs/check/remote_missing_override/__test__.jsonc +++ b/tests/specs/check/remote_missing_override/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "check --all main.ts", + "args": "check --allow-import --all main.ts", "output": "Download [WILDLINE]\nCheck [WILDLINE]\n" } diff --git a/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc b/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc index 00d38bee6..3f6ea62e5 100644 --- a/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc +++ b/tests/specs/compile/repetitive_unstable_flag/__test__.jsonc @@ -1,4 +1,5 @@ { + "tempDir": true, "steps": [ { "args": "compile --unstable-kv -A --output out main.ts", diff --git a/tests/specs/doc/types_header/__test__.jsonc b/tests/specs/doc/types_header/__test__.jsonc index 586fca28b..2fa4c3381 100644 --- a/tests/specs/doc/types_header/__test__.jsonc +++ b/tests/specs/doc/types_header/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "doc --reload types_header.ts", + "args": "doc --allow-import --reload types_header.ts", "output": "types_header.out" } diff --git a/tests/specs/doc/types_header_direct/__test__.jsonc b/tests/specs/doc/types_header_direct/__test__.jsonc index 1dc5b8069..25418655a 100644 --- a/tests/specs/doc/types_header_direct/__test__.jsonc +++ b/tests/specs/doc/types_header_direct/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "doc --reload http://127.0.0.1:4545/xTypeScriptTypes.js", + "args": "doc --allow-import --reload http://127.0.0.1:4545/xTypeScriptTypes.js", "output": "types_header.out" } diff --git a/tests/specs/info/_054_info_local_imports/005_more_imports.ts b/tests/specs/info/_054_info_local_imports/005_more_imports.ts new file mode 100644 index 000000000..c69556be1 --- /dev/null +++ b/tests/specs/info/_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/_054_info_local_imports/054_info_local_imports.out b/tests/specs/info/_054_info_local_imports/054_info_local_imports.out new file mode 100644 index 000000000..388168a8b --- /dev/null +++ b/tests/specs/info/_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/_054_info_local_imports/__test__.jsonc b/tests/specs/info/_054_info_local_imports/__test__.jsonc new file mode 100644 index 000000000..4bfdfe155 --- /dev/null +++ b/tests/specs/info/_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/_054_info_local_imports/mod1.ts b/tests/specs/info/_054_info_local_imports/mod1.ts new file mode 100644 index 000000000..5e58f432e --- /dev/null +++ b/tests/specs/info/_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/_054_info_local_imports/mod2.ts b/tests/specs/info/_054_info_local_imports/mod2.ts new file mode 100644 index 000000000..ce1adc0e8 --- /dev/null +++ b/tests/specs/info/_054_info_local_imports/mod2.ts @@ -0,0 +1 @@ +export { printHello } from "./print_hello.ts"; diff --git a/tests/specs/info/_054_info_local_imports/print_hello.ts b/tests/specs/info/_054_info_local_imports/print_hello.ts new file mode 100644 index 000000000..b9c0ad527 --- /dev/null +++ b/tests/specs/info/_054_info_local_imports/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/info/_054_info_local_imports/subdir2/dynamic_import.ts b/tests/specs/info/_054_info_local_imports/subdir2/dynamic_import.ts new file mode 100644 index 000000000..59beb64c3 --- /dev/null +++ b/tests/specs/info/_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/_054_info_local_imports/subdir2/mod2.ts b/tests/specs/info/_054_info_local_imports/subdir2/mod2.ts new file mode 100644 index 000000000..9071d0aeb --- /dev/null +++ b/tests/specs/info/_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/data_null_error/__test__.jsonc b/tests/specs/info/data_null_error/__test__.jsonc new file mode 100644 index 000000000..782cca43d --- /dev/null +++ b/tests/specs/info/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/data_null_error/data_null_error/data_null_error.out b/tests/specs/info/data_null_error/data_null_error/data_null_error.out new file mode 100644 index 000000000..065396f18 --- /dev/null +++ b/tests/specs/info/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/data_null_error/data_null_error/mod.ts b/tests/specs/info/data_null_error/data_null_error/mod.ts new file mode 100644 index 000000000..6e3e99bd4 --- /dev/null +++ b/tests/specs/info/data_null_error/data_null_error/mod.ts @@ -0,0 +1 @@ +/// diff --git a/tests/specs/info/data_null_error/data_null_error/types.d.ts b/tests/specs/info/data_null_error/data_null_error/types.d.ts new file mode 100644 index 000000000..6ecc85676 --- /dev/null +++ b/tests/specs/info/data_null_error/data_null_error/types.d.ts @@ -0,0 +1 @@ +declare class Test {} diff --git a/tests/specs/info/dynamic_imports_tmpl_lit/__test__.jsonc b/tests/specs/info/dynamic_imports_tmpl_lit/__test__.jsonc new file mode 100644 index 000000000..71f823a46 --- /dev/null +++ b/tests/specs/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/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out b/tests/specs/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/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/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js b/tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js new file mode 100644 index 000000000..3bda59772 --- /dev/null +++ b/tests/specs/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/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json b/tests/specs/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/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json @@ -0,0 +1,3 @@ +{ + "data": 5 +} diff --git a/tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json b/tests/specs/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/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json @@ -0,0 +1,3 @@ +{ + "data": 1 +} diff --git a/tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js b/tests/specs/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/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js @@ -0,0 +1 @@ +console.log("a"); diff --git a/tests/specs/info/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts b/tests/specs/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/dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts @@ -0,0 +1 @@ +console.log("b"); diff --git a/tests/specs/info/flag/041_info_flag.out b/tests/specs/info/flag/041_info_flag.out new file mode 100644 index 000000000..3506a29e4 --- /dev/null +++ b/tests/specs/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/flag/__test__.jsonc b/tests/specs/info/flag/__test__.jsonc new file mode 100644 index 000000000..39b50c960 --- /dev/null +++ b/tests/specs/info/flag/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info", + "output": "041_info_flag.out" +} diff --git a/tests/specs/info/flag_location/041_info_flag_location.out b/tests/specs/info/flag_location/041_info_flag_location.out new file mode 100644 index 000000000..b9e72f659 --- /dev/null +++ b/tests/specs/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/flag_location/__test__.jsonc b/tests/specs/info/flag_location/__test__.jsonc new file mode 100644 index 000000000..436e7cd9a --- /dev/null +++ b/tests/specs/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/flag_script_jsx/049_info_flag_script_jsx.out b/tests/specs/info/flag_script_jsx/049_info_flag_script_jsx.out new file mode 100644 index 000000000..f49fc2356 --- /dev/null +++ b/tests/specs/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/flag_script_jsx/__test__.jsonc b/tests/specs/info/flag_script_jsx/__test__.jsonc new file mode 100644 index 000000000..6b6cdc4e1 --- /dev/null +++ b/tests/specs/info/flag_script_jsx/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --allow-import 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/import_map/__test__.jsonc b/tests/specs/info/import_map/__test__.jsonc new file mode 100644 index 000000000..725276925 --- /dev/null +++ b/tests/specs/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/import_map/deno.json b/tests/specs/info/import_map/deno.json new file mode 100644 index 000000000..aaf7260c6 --- /dev/null +++ b/tests/specs/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/import_map/deno.lock b/tests/specs/info/import_map/deno.lock new file mode 100644 index 000000000..cb5c6ca45 --- /dev/null +++ b/tests/specs/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/import_map/main.tsx b/tests/specs/info/import_map/main.tsx new file mode 100644 index 000000000..e38f14a58 --- /dev/null +++ b/tests/specs/info/import_map/main.tsx @@ -0,0 +1,2 @@ +import { render } from "preact"; +console.log(render); diff --git a/tests/specs/info/import_map/with_import_map.out b/tests/specs/info/import_map/with_import_map.out new file mode 100644 index 000000000..29dc17737 --- /dev/null +++ b/tests/specs/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/json/__test__.jsonc b/tests/specs/info/json/__test__.jsonc new file mode 100644 index 000000000..4b50dc32b --- /dev/null +++ b/tests/specs/info/json/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --json", + "output": "info_json.out" +} diff --git a/tests/specs/info/json/info_json.out b/tests/specs/info/json/info_json.out new file mode 100644 index 000000000..607489ca3 --- /dev/null +++ b/tests/specs/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/json_deps_order/076_info_json_deps_order.out b/tests/specs/info/json_deps_order/076_info_json_deps_order.out new file mode 100644 index 000000000..33d58da16 --- /dev/null +++ b/tests/specs/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/json_deps_order/076_info_json_deps_order.ts b/tests/specs/info/json_deps_order/076_info_json_deps_order.ts new file mode 100644 index 000000000..b1ae75e68 --- /dev/null +++ b/tests/specs/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/json_deps_order/__test__.jsonc b/tests/specs/info/json_deps_order/__test__.jsonc new file mode 100644 index 000000000..f474f4d38 --- /dev/null +++ b/tests/specs/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/json_deps_order/recursive_imports/A.ts b/tests/specs/info/json_deps_order/recursive_imports/A.ts new file mode 100644 index 000000000..43ecdbe5e --- /dev/null +++ b/tests/specs/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/json_deps_order/recursive_imports/B.ts b/tests/specs/info/json_deps_order/recursive_imports/B.ts new file mode 100644 index 000000000..9fff0fdc9 --- /dev/null +++ b/tests/specs/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/json_deps_order/recursive_imports/C.ts b/tests/specs/info/json_deps_order/recursive_imports/C.ts new file mode 100644 index 000000000..e47e77b41 --- /dev/null +++ b/tests/specs/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/json_deps_order/recursive_imports/common.ts b/tests/specs/info/json_deps_order/recursive_imports/common.ts new file mode 100644 index 000000000..2b16a7bf1 --- /dev/null +++ b/tests/specs/info/json_deps_order/recursive_imports/common.ts @@ -0,0 +1,2 @@ +export function thing() { +} diff --git a/tests/specs/info/json_file/__test__.jsonc b/tests/specs/info/json_file/__test__.jsonc new file mode 100644 index 000000000..61289da94 --- /dev/null +++ b/tests/specs/info/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/json_file/json_output/main.out b/tests/specs/info/json_file/json_output/main.out new file mode 100644 index 000000000..d4c2f234d --- /dev/null +++ b/tests/specs/info/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/json_file/json_output/main.ts b/tests/specs/info/json_file/json_output/main.ts new file mode 100644 index 000000000..d9029af8a --- /dev/null +++ b/tests/specs/info/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/json_file/mod1.ts b/tests/specs/info/json_file/mod1.ts new file mode 100644 index 000000000..5e58f432e --- /dev/null +++ b/tests/specs/info/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/json_file/mod2.ts b/tests/specs/info/json_file/mod2.ts new file mode 100644 index 000000000..ce1adc0e8 --- /dev/null +++ b/tests/specs/info/json_file/mod2.ts @@ -0,0 +1 @@ +export { printHello } from "./print_hello.ts"; diff --git a/tests/specs/info/json_file/print_hello.ts b/tests/specs/info/json_file/print_hello.ts new file mode 100644 index 000000000..b9c0ad527 --- /dev/null +++ b/tests/specs/info/json_file/print_hello.ts @@ -0,0 +1,3 @@ +export function printHello() { + console.log("Hello"); +} diff --git a/tests/specs/info/json_file/subdir2/dynamic_import.ts b/tests/specs/info/json_file/subdir2/dynamic_import.ts new file mode 100644 index 000000000..59beb64c3 --- /dev/null +++ b/tests/specs/info/json_file/subdir2/dynamic_import.ts @@ -0,0 +1,4 @@ +(async () => { + const { printHello } = await import("../mod2.ts"); + printHello(); +})(); diff --git a/tests/specs/info/json_file/subdir2/mod2.ts b/tests/specs/info/json_file/subdir2/mod2.ts new file mode 100644 index 000000000..9071d0aeb --- /dev/null +++ b/tests/specs/info/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/json_location/__test__.jsonc b/tests/specs/info/json_location/__test__.jsonc new file mode 100644 index 000000000..0c1acc3d9 --- /dev/null +++ b/tests/specs/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/json_location/info_json_location.out b/tests/specs/info/json_location/info_json_location.out new file mode 100644 index 000000000..004bf03db --- /dev/null +++ b/tests/specs/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/missing_module/__test__.jsonc b/tests/specs/info/missing_module/__test__.jsonc new file mode 100644 index 000000000..edc151972 --- /dev/null +++ b/tests/specs/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/missing_module/error_009_missing_js_module.js b/tests/specs/info/missing_module/error_009_missing_js_module.js new file mode 100644 index 000000000..e6ca88934 --- /dev/null +++ b/tests/specs/info/missing_module/error_009_missing_js_module.js @@ -0,0 +1 @@ +import "./bad-module.js"; diff --git a/tests/specs/info/missing_module/info_missing_module.out b/tests/specs/info/missing_module/info_missing_module.out new file mode 100644 index 000000000..c62d690c1 --- /dev/null +++ b/tests/specs/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/multiple_imports/__test__.jsonc b/tests/specs/info/multiple_imports/__test__.jsonc new file mode 100644 index 000000000..32d72bcb3 --- /dev/null +++ b/tests/specs/info/multiple_imports/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --allow-import http://127.0.0.1:4545/run/019_media_types.ts", + "output": "multiple_imports.out" +} diff --git a/tests/specs/info/multiple_imports/multiple_imports.out b/tests/specs/info/multiple_imports/multiple_imports.out new file mode 100644 index 000000000..cb13318ca --- /dev/null +++ b/tests/specs/info/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/multiple_redirects/__test__.jsonc b/tests/specs/info/multiple_redirects/__test__.jsonc index 0e1808e0a..205d21c13 100644 --- a/tests/specs/info/multiple_redirects/__test__.jsonc +++ b/tests/specs/info/multiple_redirects/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "info --json main.ts", + "args": "info --allow-import --json main.ts", "output": "main.out" } diff --git a/tests/specs/info/recursive_modules/__test__.jsonc b/tests/specs/info/recursive_modules/__test__.jsonc new file mode 100644 index 000000000..c4313a2fb --- /dev/null +++ b/tests/specs/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/recursive_modules/info_recursive_imports_test.out b/tests/specs/info/recursive_modules/info_recursive_imports_test.out new file mode 100644 index 000000000..3340f3859 --- /dev/null +++ b/tests/specs/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/recursive_modules/info_recursive_imports_test.ts b/tests/specs/info/recursive_modules/info_recursive_imports_test.ts new file mode 100644 index 000000000..c9ba44755 --- /dev/null +++ b/tests/specs/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/recursive_modules/recursive_imports/A.ts b/tests/specs/info/recursive_modules/recursive_imports/A.ts new file mode 100644 index 000000000..43ecdbe5e --- /dev/null +++ b/tests/specs/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/recursive_modules/recursive_imports/B.ts b/tests/specs/info/recursive_modules/recursive_imports/B.ts new file mode 100644 index 000000000..9fff0fdc9 --- /dev/null +++ b/tests/specs/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/recursive_modules/recursive_imports/C.ts b/tests/specs/info/recursive_modules/recursive_imports/C.ts new file mode 100644 index 000000000..e47e77b41 --- /dev/null +++ b/tests/specs/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/recursive_modules/recursive_imports/common.ts b/tests/specs/info/recursive_modules/recursive_imports/common.ts new file mode 100644 index 000000000..2b16a7bf1 --- /dev/null +++ b/tests/specs/info/recursive_modules/recursive_imports/common.ts @@ -0,0 +1,2 @@ +export function thing() { +} diff --git a/tests/specs/info/type_import/__test__.jsonc b/tests/specs/info/type_import/__test__.jsonc new file mode 100644 index 000000000..2092ecf08 --- /dev/null +++ b/tests/specs/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/type_import/info_type_import.out b/tests/specs/info/type_import/info_type_import.out new file mode 100644 index 000000000..0423efe82 --- /dev/null +++ b/tests/specs/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/type_import/info_type_import.ts b/tests/specs/info/type_import/info_type_import.ts new file mode 100644 index 000000000..5d8ca21ce --- /dev/null +++ b/tests/specs/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/type_import/type_and_code.ts b/tests/specs/info/type_import/type_and_code.ts new file mode 100644 index 000000000..b14713419 --- /dev/null +++ b/tests/specs/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/types_header_direct/__test__.jsonc b/tests/specs/info/types_header_direct/__test__.jsonc new file mode 100644 index 000000000..df0c1e573 --- /dev/null +++ b/tests/specs/info/types_header_direct/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "info --allow-import --reload type_directives_01.ts", + "output": "types_header.out" +} diff --git a/tests/specs/info/types_header_direct/type_directives_01.ts b/tests/specs/info/types_header_direct/type_directives_01.ts new file mode 100644 index 000000000..71305824c --- /dev/null +++ b/tests/specs/info/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/types_header_direct/types_header.out b/tests/specs/info/types_header_direct/types_header.out new file mode 100644 index 000000000..722e02f77 --- /dev/null +++ b/tests/specs/info/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/with_config_override/__test__.jsonc b/tests/specs/info/with_config_override/__test__.jsonc new file mode 100644 index 000000000..02c7d2a78 --- /dev/null +++ b/tests/specs/info/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/with_config_override/with_config/deno-override.json b/tests/specs/info/with_config_override/with_config/deno-override.json new file mode 100644 index 000000000..ee44ba947 --- /dev/null +++ b/tests/specs/info/with_config_override/with_config/deno-override.json @@ -0,0 +1,3 @@ +{ + "importMap": "import_map.json" +} diff --git a/tests/specs/info/with_config_override/with_config/deno.json b/tests/specs/info/with_config_override/with_config/deno.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/tests/specs/info/with_config_override/with_config/deno.json @@ -0,0 +1 @@ +{} diff --git a/tests/specs/info/with_config_override/with_config/import_map.json b/tests/specs/info/with_config_override/with_config/import_map.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/tests/specs/info/with_config_override/with_config/import_map.json @@ -0,0 +1 @@ +{} diff --git a/tests/specs/info/with_config_override/with_config/test.ts b/tests/specs/info/with_config_override/with_config/test.ts new file mode 100644 index 000000000..85ce559e8 --- /dev/null +++ b/tests/specs/info/with_config_override/with_config/test.ts @@ -0,0 +1 @@ +console.log("foo"); diff --git a/tests/specs/info/with_config_override/with_config/with_config.out b/tests/specs/info/with_config_override/with_config/with_config.out new file mode 100644 index 000000000..95a1f30bc --- /dev/null +++ b/tests/specs/info/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/specs/info_tests/_054_info_local_imports/005_more_imports.ts b/tests/specs/info_tests/_054_info_local_imports/005_more_imports.ts deleted file mode 100644 index c69556be1..000000000 --- a/tests/specs/info_tests/_054_info_local_imports/005_more_imports.ts +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 388168a8b..000000000 --- a/tests/specs/info_tests/_054_info_local_imports/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]/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 deleted file mode 100644 index 4bfdfe155..000000000 --- a/tests/specs/info_tests/_054_info_local_imports/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "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 deleted file mode 100644 index 5e58f432e..000000000 --- a/tests/specs/info_tests/_054_info_local_imports/mod1.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index ce1adc0e8..000000000 --- a/tests/specs/info_tests/_054_info_local_imports/mod2.ts +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b9c0ad527..000000000 --- a/tests/specs/info_tests/_054_info_local_imports/print_hello.ts +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 59beb64c3..000000000 --- a/tests/specs/info_tests/_054_info_local_imports/subdir2/dynamic_import.ts +++ /dev/null @@ -1,4 +0,0 @@ -(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 deleted file mode 100644 index 9071d0aeb..000000000 --- a/tests/specs/info_tests/_054_info_local_imports/subdir2/mod2.ts +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 782cca43d..000000000 --- a/tests/specs/info_tests/data_null_error/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index 065396f18..000000000 --- a/tests/specs/info_tests/data_null_error/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/specs/info_tests/data_null_error/data_null_error/mod.ts b/tests/specs/info_tests/data_null_error/data_null_error/mod.ts deleted file mode 100644 index 6e3e99bd4..000000000 --- a/tests/specs/info_tests/data_null_error/data_null_error/mod.ts +++ /dev/null @@ -1 +0,0 @@ -/// 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 deleted file mode 100644 index 6ecc85676..000000000 --- a/tests/specs/info_tests/data_null_error/data_null_error/types.d.ts +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 71f823a46..000000000 --- a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "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 deleted file mode 100644 index 57d730a64..000000000 --- a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.info.out +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 3bda59772..000000000 --- a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/main.js +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index 0131e01e4..000000000 --- a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/data.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 858a13cdd..000000000 --- a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/other/sub/data2.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 7b2a34601..000000000 --- a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/a.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 6d012e7f1..000000000 --- a/tests/specs/info_tests/info_dynamic_imports_tmpl_lit/dynamic_imports_tmp_lit/sub/b.ts +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 3506a29e4..000000000 --- a/tests/specs/info_tests/info_flag/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/specs/info_tests/info_flag/__test__.jsonc b/tests/specs/info_tests/info_flag/__test__.jsonc deleted file mode 100644 index 39b50c960..000000000 --- a/tests/specs/info_tests/info_flag/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index b9e72f659..000000000 --- a/tests/specs/info_tests/info_flag_location/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/specs/info_tests/info_flag_location/__test__.jsonc b/tests/specs/info_tests/info_flag_location/__test__.jsonc deleted file mode 100644 index 436e7cd9a..000000000 --- a/tests/specs/info_tests/info_flag_location/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index f49fc2356..000000000 --- a/tests/specs/info_tests/info_flag_script_jsx/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/specs/info_tests/info_flag_script_jsx/__test__.jsonc b/tests/specs/info_tests/info_flag_script_jsx/__test__.jsonc deleted file mode 100644 index b8dc305ae..000000000 --- a/tests/specs/info_tests/info_flag_script_jsx/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index 725276925..000000000 --- a/tests/specs/info_tests/info_import_map/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "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 deleted file mode 100644 index aaf7260c6..000000000 --- a/tests/specs/info_tests/info_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/specs/info_tests/info_import_map/deno.lock b/tests/specs/info_tests/info_import_map/deno.lock deleted file mode 100644 index cb5c6ca45..000000000 --- a/tests/specs/info_tests/info_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/specs/info_tests/info_import_map/main.tsx b/tests/specs/info_tests/info_import_map/main.tsx deleted file mode 100644 index e38f14a58..000000000 --- a/tests/specs/info_tests/info_import_map/main.tsx +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 29dc17737..000000000 --- a/tests/specs/info_tests/info_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/tests/specs/info_tests/info_json/__test__.jsonc b/tests/specs/info_tests/info_json/__test__.jsonc deleted file mode 100644 index 4b50dc32b..000000000 --- a/tests/specs/info_tests/info_json/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index 607489ca3..000000000 --- a/tests/specs/info_tests/info_json/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/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 deleted file mode 100644 index 33d58da16..000000000 --- a/tests/specs/info_tests/info_json_deps_order/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/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 deleted file mode 100644 index b1ae75e68..000000000 --- a/tests/specs/info_tests/info_json_deps_order/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/specs/info_tests/info_json_deps_order/__test__.jsonc b/tests/specs/info_tests/info_json_deps_order/__test__.jsonc deleted file mode 100644 index f474f4d38..000000000 --- a/tests/specs/info_tests/info_json_deps_order/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index 43ecdbe5e..000000000 --- a/tests/specs/info_tests/info_json_deps_order/recursive_imports/A.ts +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index 9fff0fdc9..000000000 --- a/tests/specs/info_tests/info_json_deps_order/recursive_imports/B.ts +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index e47e77b41..000000000 --- a/tests/specs/info_tests/info_json_deps_order/recursive_imports/C.ts +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 2b16a7bf1..000000000 --- a/tests/specs/info_tests/info_json_deps_order/recursive_imports/common.ts +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 0c1acc3d9..000000000 --- a/tests/specs/info_tests/info_json_location/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index 004bf03db..000000000 --- a/tests/specs/info_tests/info_json_location/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/specs/info_tests/info_missing_module/__test__.jsonc b/tests/specs/info_tests/info_missing_module/__test__.jsonc deleted file mode 100644 index edc151972..000000000 --- a/tests/specs/info_tests/info_missing_module/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index e6ca88934..000000000 --- a/tests/specs/info_tests/info_missing_module/error_009_missing_js_module.js +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index c62d690c1..000000000 --- a/tests/specs/info_tests/info_missing_module/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/specs/info_tests/info_recursive_modules/__test__.jsonc b/tests/specs/info_tests/info_recursive_modules/__test__.jsonc deleted file mode 100644 index c4313a2fb..000000000 --- a/tests/specs/info_tests/info_recursive_modules/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "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 deleted file mode 100644 index 3340f3859..000000000 --- a/tests/specs/info_tests/info_recursive_modules/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/specs/info_tests/info_recursive_modules/info_recursive_imports_test.ts b/tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.ts deleted file mode 100644 index c9ba44755..000000000 --- a/tests/specs/info_tests/info_recursive_modules/info_recursive_imports_test.ts +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 43ecdbe5e..000000000 --- a/tests/specs/info_tests/info_recursive_modules/recursive_imports/A.ts +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index 9fff0fdc9..000000000 --- a/tests/specs/info_tests/info_recursive_modules/recursive_imports/B.ts +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index e47e77b41..000000000 --- a/tests/specs/info_tests/info_recursive_modules/recursive_imports/C.ts +++ /dev/null @@ -1,8 +0,0 @@ -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 deleted file mode 100644 index 2b16a7bf1..000000000 --- a/tests/specs/info_tests/info_recursive_modules/recursive_imports/common.ts +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 2092ecf08..000000000 --- a/tests/specs/info_tests/info_type_import/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index 0423efe82..000000000 --- a/tests/specs/info_tests/info_type_import/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/specs/info_tests/info_type_import/info_type_import.ts b/tests/specs/info_tests/info_type_import/info_type_import.ts deleted file mode 100644 index 5d8ca21ce..000000000 --- a/tests/specs/info_tests/info_type_import/info_type_import.ts +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index b14713419..000000000 --- a/tests/specs/info_tests/info_type_import/type_and_code.ts +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index 61289da94..000000000 --- a/tests/specs/info_tests/json_file/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "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 deleted file mode 100644 index d4c2f234d..000000000 --- a/tests/specs/info_tests/json_file/json_output/main.out +++ /dev/null @@ -1,92 +0,0 @@ -{ - "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 deleted file mode 100644 index d9029af8a..000000000 --- a/tests/specs/info_tests/json_file/json_output/main.ts +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index 5e58f432e..000000000 --- a/tests/specs/info_tests/json_file/mod1.ts +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index ce1adc0e8..000000000 --- a/tests/specs/info_tests/json_file/mod2.ts +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index b9c0ad527..000000000 --- a/tests/specs/info_tests/json_file/print_hello.ts +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 59beb64c3..000000000 --- a/tests/specs/info_tests/json_file/subdir2/dynamic_import.ts +++ /dev/null @@ -1,4 +0,0 @@ -(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 deleted file mode 100644 index 9071d0aeb..000000000 --- a/tests/specs/info_tests/json_file/subdir2/mod2.ts +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index b110b2d4c..000000000 --- a/tests/specs/info_tests/multiple_imports/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index cb13318ca..000000000 --- a/tests/specs/info_tests/multiple_imports/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/specs/info_tests/types_header_direct/__test__.jsonc b/tests/specs/info_tests/types_header_direct/__test__.jsonc deleted file mode 100644 index 7f9b462ef..000000000 --- a/tests/specs/info_tests/types_header_direct/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index 71305824c..000000000 --- a/tests/specs/info_tests/types_header_direct/type_directives_01.ts +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 722e02f77..000000000 --- a/tests/specs/info_tests/types_header_direct/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/specs/info_tests/with_config_override/__test__.jsonc b/tests/specs/info_tests/with_config_override/__test__.jsonc deleted file mode 100644 index 02c7d2a78..000000000 --- a/tests/specs/info_tests/with_config_override/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "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 deleted file mode 100644 index ee44ba947..000000000 --- a/tests/specs/info_tests/with_config_override/with_config/deno-override.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 0967ef424..000000000 --- a/tests/specs/info_tests/with_config_override/with_config/deno.json +++ /dev/null @@ -1 +0,0 @@ -{} 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 deleted file mode 100644 index 0967ef424..000000000 --- a/tests/specs/info_tests/with_config_override/with_config/import_map.json +++ /dev/null @@ -1 +0,0 @@ -{} 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 deleted file mode 100644 index 85ce559e8..000000000 --- a/tests/specs/info_tests/with_config_override/with_config/test.ts +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 95a1f30bc..000000000 --- a/tests/specs/info_tests/with_config_override/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/specs/install/future_install_local_deno/__test__.jsonc b/tests/specs/install/future_install_local_deno/__test__.jsonc index bbfee2d9d..d257fbc1f 100644 --- a/tests/specs/install/future_install_local_deno/__test__.jsonc +++ b/tests/specs/install/future_install_local_deno/__test__.jsonc @@ -2,12 +2,12 @@ "tempDir": true, "steps": [ { - "args": "install", + "args": "install --allow-import", "output": "install.out" }, { // ensure deps are actually cached - "args": "run --cached-only main.js", + "args": "run --cached-only --allow-import main.js", "output": "" }, { diff --git a/tests/specs/lockfile/adding_redirect/__test__.jsonc b/tests/specs/lockfile/adding_redirect/__test__.jsonc index d53beedbd..75933a6b4 100644 --- a/tests/specs/lockfile/adding_redirect/__test__.jsonc +++ b/tests/specs/lockfile/adding_redirect/__test__.jsonc @@ -1,13 +1,13 @@ { "tempDir": true, "steps": [{ - "args": "run 1.ts", + "args": "run --allow-import 1.ts", "output": "[WILDCARD]" }, { "args": "task --quiet cat deno.lock", "output": "lock01.out" }, { - "args": "run 2.ts", + "args": "run --allow-import 2.ts", "output": "[WILDCARD]" }, { "args": "task --quiet cat deno.lock", diff --git a/tests/specs/lockfile/auto_discover_lockfile/__test__.jsonc b/tests/specs/lockfile/auto_discover_lockfile/__test__.jsonc index 50213381a..27f6d9787 100644 --- a/tests/specs/lockfile/auto_discover_lockfile/__test__.jsonc +++ b/tests/specs/lockfile/auto_discover_lockfile/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run main.ts", + "args": "run --allow-import main.ts", "output": "main.out", "exitCode": 10 } diff --git a/tests/specs/lockfile/config_file_lock_boolean/__test__.jsonc b/tests/specs/lockfile/config_file_lock_boolean/__test__.jsonc index 65679a1c8..651ed113d 100644 --- a/tests/specs/lockfile/config_file_lock_boolean/__test__.jsonc +++ b/tests/specs/lockfile/config_file_lock_boolean/__test__.jsonc @@ -1,12 +1,12 @@ { "tests": { "true": { - "args": "run --config=true.json main.ts", + "args": "run --allow-import --config=true.json main.ts", "output": "true.main.out", "exitCode": 10 }, "false": { - "args": "run --config=false.json main.ts", + "args": "run --allow-import --config=false.json main.ts", "output": "false.main.out" } } diff --git a/tests/specs/lockfile/config_file_lock_path/__test__.jsonc b/tests/specs/lockfile/config_file_lock_path/__test__.jsonc index defb113b3..5c901e709 100644 --- a/tests/specs/lockfile/config_file_lock_path/__test__.jsonc +++ b/tests/specs/lockfile/config_file_lock_path/__test__.jsonc @@ -1,12 +1,12 @@ { "tests": { "error_bad_checksum": { - "args": "run --config=config_file_lock_path.json http://localhost:4545/run/019_media_types.ts", + "args": "run --allow-import --config=config_file_lock_path.json http://localhost:4545/run/019_media_types.ts", "output": "config_file_lock_path.out", "exitCode": 10 }, "lock_flag_override": { - "args": "run --lock=run/lock_check_ok2.json --config=config_file_lock_path.json http://localhost:4545/run/019_media_types.ts", + "args": "run --allow-import --lock=run/lock_check_ok2.json --config=config_file_lock_path.json http://localhost:4545/run/019_media_types.ts", "output": "019_media_types.ts.out" } } diff --git a/tests/specs/lockfile/frozen_lockfile/__test__.jsonc b/tests/specs/lockfile/frozen_lockfile/__test__.jsonc index 36a1fc71e..8179052e1 100644 --- a/tests/specs/lockfile/frozen_lockfile/__test__.jsonc +++ b/tests/specs/lockfile/frozen_lockfile/__test__.jsonc @@ -180,7 +180,7 @@ "output": "[WILDCARD]" }, { - "args": "run --frozen --allow-net http-dynamic.ts", + "args": "run --frozen --allow-import http-dynamic.ts", "output": "frozen_new_dep_dynamic_http.out", "exitCode": 1 } diff --git a/tests/specs/lockfile/no_declaration_files/__test__.jsonc b/tests/specs/lockfile/no_declaration_files/__test__.jsonc index 3238416b0..3c8282825 100644 --- a/tests/specs/lockfile/no_declaration_files/__test__.jsonc +++ b/tests/specs/lockfile/no_declaration_files/__test__.jsonc @@ -1,7 +1,7 @@ { "tempDir": true, "steps": [{ - "args": "cache --lock --frozen=false main.ts", + "args": "cache --allow-import --lock --frozen=false main.ts", "output": "main.cache.out" }, { "args": [ diff --git a/tests/specs/lockfile/no_lock/__test__.jsonc b/tests/specs/lockfile/no_lock/__test__.jsonc index 75821ac64..d8172a7ca 100644 --- a/tests/specs/lockfile/no_lock/__test__.jsonc +++ b/tests/specs/lockfile/no_lock/__test__.jsonc @@ -1,39 +1,39 @@ { "tests": { "info": { - "args": "info main.ts", + "args": "info --allow-import main.ts", "output": "fail.out", "exitCode": 10 }, "info_no_lock": { - "args": "info --no-lock main.ts", + "args": "info --allow-import --no-lock main.ts", "output": "info.nolock.out" }, "bench": { - "args": "bench", + "args": "bench --allow-import", "output": "fail.out", "exitCode": 10 }, "bench_no_lock": { - "args": "bench --no-lock", + "args": "bench --allow-import --no-lock", "output": "bench.nolock.out" }, "doc": { - "args": "doc main.ts", + "args": "doc --allow-import main.ts", "exitCode": 10, "output": "fail.out" }, "doc_no_lock": { - "args": "doc --no-lock main.ts", + "args": "doc --allow-import --no-lock main.ts", "output": "doc.nolock.out" }, "test": { - "args": "test", + "args": "test --allow-import", "exitCode": 10, "output": "fail.out" }, "test_no_lock": { - "args": "test --no-lock", + "args": "test --allow-import --no-lock", "output": "test.nolock.out" } } diff --git a/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc b/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc new file mode 100644 index 000000000..0f3b33300 --- /dev/null +++ b/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run process_beforeexit_exit_events.ts", + "output": "process_beforeexit_exit_events.out", + "exitCode": 0 +} diff --git a/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out b/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out new file mode 100644 index 000000000..740ef6ffb --- /dev/null +++ b/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out @@ -0,0 +1,2 @@ +beforeExit emitted from processEmit +exit emitted from processEmit diff --git a/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts b/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts new file mode 100644 index 000000000..a4c87f27e --- /dev/null +++ b/tests/specs/node/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts @@ -0,0 +1,9 @@ +import process from "node:process"; + +const originalEmit = process.emit; +process.emit = function (event, ...args) { + if (event === "exit" || event === "beforeExit") { + console.log(`${event} emitted from processEmit`); + } + return originalEmit.call(this, event, ...args); +}; diff --git a/tests/specs/node/node_test_module/__test__.jsonc b/tests/specs/node/node_test_module/__test__.jsonc new file mode 100644 index 000000000..ef93b6673 --- /dev/null +++ b/tests/specs/node/node_test_module/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "test test.js", + "output": "test.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/node/node_test_module/test.js b/tests/specs/node/node_test_module/test.js new file mode 100644 index 000000000..0f0f9b6b6 --- /dev/null +++ b/tests/specs/node/node_test_module/test.js @@ -0,0 +1,390 @@ +// Copyright Joyent, Inc. and other Node contributors. + +// Ported from https://github.com/nodejs/node/blob/d396a041f71cc055ad60b0abc63ad81c0ee6a574/test/fixtures/test-runner/output/output.js + +// deno-lint-ignore-file + +import assert from "node:assert"; +import test from "node:test"; +import util from "node:util"; +import { setImmediate } from "node:timers"; + +test("sync pass todo", (t) => { + t.todo(); +}); + +test("sync pass todo with message", (t) => { + t.todo("this is a passing todo"); +}); + +test("sync fail todo", (t) => { + t.todo(); + throw new Error("thrown from sync fail todo"); +}); + +test("sync fail todo with message", (t) => { + t.todo("this is a failing todo"); + throw new Error("thrown from sync fail todo with message"); +}); + +test("sync skip pass", (t) => { + t.skip(); +}); + +test("sync skip pass with message", (t) => { + t.skip("this is skipped"); +}); + +test("sync pass", (t) => { + t.diagnostic("this test should pass"); +}); + +test("sync throw fail", () => { + throw new Error("thrown from sync throw fail"); +}); + +test("async skip pass", async (t) => { + t.skip(); +}); + +test("async pass", async () => { +}); + +test("async throw fail", async () => { + throw new Error("thrown from async throw fail"); +}); + +test("nested test", async (t) => { + await t.test("nested 1", async (t) => { + await t.test("nested 2", () => { + }); + }); +}); + +test("async skip fail", async (t) => { + t.skip(); + throw new Error("thrown from async throw fail"); +}); + +test("async assertion fail", async () => { + // Make sure the assert module is handled. + assert.strictEqual(true, false); +}); + +test("resolve pass", () => { + return Promise.resolve(); +}); + +test("reject fail", () => { + return Promise.reject(new Error("rejected from reject fail")); +}); + +test("unhandled rejection - passes but warns", () => { + Promise.reject(new Error("rejected from unhandled rejection fail")); +}); + +test("async unhandled rejection - passes but warns", async () => { + Promise.reject(new Error("rejected from async unhandled rejection fail")); +}); + +test("immediate throw - passes but warns", () => { + setImmediate(() => { + throw new Error("thrown from immediate throw fail"); + }); +}); + +test("immediate reject - passes but warns", () => { + setImmediate(() => { + Promise.reject(new Error("rejected from immediate reject fail")); + }); +}); + +test("immediate resolve pass", () => { + return new Promise((resolve) => { + setImmediate(() => { + resolve(); + }); + }); +}); + +test("subtest sync throw fail", async (t) => { + await t.test("+sync throw fail", (t) => { + t.diagnostic("this subtest should make its parent test fail"); + throw new Error("thrown from subtest sync throw fail"); + }); +}); + +test("sync throw non-error fail", async (t) => { + throw Symbol("thrown symbol from sync throw non-error fail"); +}); + +test("level 0a", { concurrency: 4 }, async (t) => { + t.test("level 1a", async (t) => { + const p1a = new Promise((resolve) => { + setTimeout(() => { + resolve(); + }, 100); + }); + + return p1a; + }); + + test("level 1b", async (t) => { + const p1b = new Promise((resolve) => { + resolve(); + }); + + return p1b; + }); + + t.test("level 1c", async (t) => { + const p1c = new Promise((resolve) => { + setTimeout(() => { + resolve(); + }, 200); + }); + + return p1c; + }); + + t.test("level 1d", async (t) => { + const p1c = new Promise((resolve) => { + setTimeout(() => { + resolve(); + }, 150); + }); + + return p1c; + }); + + const p0a = new Promise((resolve) => { + setTimeout(() => { + resolve(); + }, 300); + }); + + return p0a; +}); + +test("top level", { concurrency: 2 }, async (t) => { + t.test("+long running", async (t) => { + return new Promise((resolve, reject) => { + setTimeout(resolve, 300).unref(); + }); + }); + + t.test("+short running", async (t) => { + t.test("++short running", async (t) => {}); + }); +}); + +test("invalid subtest - pass but subtest fails", (t) => { + setImmediate(() => { + t.test("invalid subtest fail", () => { + throw new Error("this should not be thrown"); + }); + }); +}); + +test("sync skip option", { skip: true }, (t) => { + throw new Error("this should not be executed"); +}); + +test("sync skip option with message", { skip: "this is skipped" }, (t) => { + throw new Error("this should not be executed"); +}); + +test("sync skip option is false fail", { skip: false }, (t) => { + throw new Error("this should be executed"); +}); + +// A test with no arguments provided. +test(); + +// A test with only a named function provided. +test(function functionOnly() {}); + +// A test with only an anonymous function provided. +test(() => {}); + +// A test with only a name provided. +test("test with only a name provided"); + +// A test with an empty string name. +test(""); + +// A test with only options provided. +test({ skip: true }); + +// A test with only a name and options provided. +test("test with a name and options provided", { skip: true }); + +// A test with only options and a function provided. +test({ skip: true }, function functionAndOptions() {}); + +// A test whose description needs to be escaped. +// test("escaped description \\ # \\#\\ \n \t \f \v \b \r"); + +// A test whose skip message needs to be escaped. +test("escaped skip message", { skip: "#skip" }); + +// A test whose todo message needs to be escaped. +test("escaped todo message", { todo: "#todo" }); + +// A test with a diagnostic message that needs to be escaped. +test("escaped diagnostic", (t) => { + t.diagnostic("#diagnostic"); +}); + +test("callback pass", (t, done) => { + setImmediate(done); +}); + +test("callback fail", (t, done) => { + setImmediate(() => { + done(new Error("callback failure")); + }); +}); + +test("sync t is this in test", function (t) { + assert.strictEqual(this, t); +}); + +test("async t is this in test", async function (t) { + assert.strictEqual(this, t); +}); + +test("callback t is this in test", function (t, done) { + assert.strictEqual(this, t); + done(); +}); + +test("callback also returns a Promise", async (t, done) => { + throw new Error("thrown from callback also returns a Promise"); +}); + +test("callback throw", (t, done) => { + throw new Error("thrown from callback throw"); +}); + +test("callback called twice", (t, done) => { + done(); + done(); +}); + +test("callback called twice in different ticks", (t, done) => { + setImmediate(done); + done(); +}); + +test("callback called twice in future tick", (t, done) => { + setImmediate(() => { + done(); + done(); + }); +}); + +test("callback async throw", (t, done) => { + setImmediate(() => { + throw new Error("thrown from callback async throw"); + }); +}); + +test("callback async throw after done", (t, done) => { + setImmediate(() => { + throw new Error("thrown from callback async throw after done"); + }); + + done(); +}); + +test("custom inspect symbol fail", () => { + const obj = { + [util.inspect.custom]() { + return "customized"; + }, + foo: 1, + }; + + throw obj; +}); + +test("custom inspect symbol that throws fail", () => { + const obj = { + [util.inspect.custom]() { + throw new Error("bad-inspect"); + }, + foo: 1, + }; + + throw obj; +}); + +test("subtest sync throw fails", async (t) => { + await t.test("sync throw fails at first", (t) => { + throw new Error("thrown from subtest sync throw fails at first"); + }); + await t.test("sync throw fails at second", (t) => { + throw new Error("thrown from subtest sync throw fails at second"); + }); +}); + +test("timed out async test", { timeout: 5 }, async (t) => { + return new Promise((resolve) => { + setTimeout(resolve, 100); + }); +}); + +test("timed out callback test", { timeout: 5 }, (t, done) => { + setTimeout(done, 100); +}); + +test("large timeout async test is ok", { timeout: 30_000_000 }, async (t) => { + return new Promise((resolve) => { + setTimeout(resolve, 10); + }); +}); + +test( + "large timeout callback test is ok", + { timeout: 30_000_000 }, + (t, done) => { + setTimeout(done, 10); + }, +); + +test("successful thenable", () => { + let thenCalled = false; + return { + get then() { + if (thenCalled) throw new Error(); + thenCalled = true; + return (successHandler) => successHandler(); + }, + }; +}); + +test("rejected thenable", () => { + let thenCalled = false; + return { + get then() { + if (thenCalled) throw new Error(); + thenCalled = true; + return (_, errorHandler) => errorHandler("custom error"); + }, + }; +}); + +test("unfinished test with uncaughtException", async () => { + await new Promise(() => { + setTimeout(() => { + throw new Error("foo"); + }); + }); +}); + +test("unfinished test with unhandledRejection", async () => { + await new Promise(() => { + setTimeout(() => Promise.reject(new Error("bar"))); + }); +}); diff --git a/tests/specs/node/node_test_module/test.out b/tests/specs/node/node_test_module/test.out new file mode 100644 index 000000000..c37fb355f --- /dev/null +++ b/tests/specs/node/node_test_module/test.out @@ -0,0 +1,175 @@ +[WILDCARD] +running 63 tests from ./test.js +sync pass todo ... +------- output ------- +Warning: Not implemented: test.TestContext.todo +----- output end ----- +sync pass todo ... ok [WILDCARD] +sync pass todo with message ... +------- output ------- +Warning: Not implemented: test.TestContext.todo +----- output end ----- +sync pass todo with message ... ok [WILDCARD] +sync fail todo ... +------- output ------- +Warning: Not implemented: test.TestContext.todo +----- output end ----- +sync fail todo ... FAILED [WILDCARD] +sync fail todo with message ... +------- output ------- +Warning: Not implemented: test.TestContext.todo +----- output end ----- +sync fail todo with message ... FAILED [WILDCARD] +sync skip pass ... +------- output ------- +Warning: Not implemented: test.TestContext.skip +----- output end ----- +sync skip pass ... ok [WILDCARD] +sync skip pass with message ... +------- output ------- +Warning: Not implemented: test.TestContext.skip +----- output end ----- +sync skip pass with message ... ok [WILDCARD] +sync pass ... +------- output ------- +DIAGNOSTIC: this test should pass +----- output end ----- +sync pass ... ok [WILDCARD] +sync throw fail ... FAILED [WILDCARD] +async skip pass ... +------- output ------- +Warning: Not implemented: test.TestContext.skip +----- output end ----- +async skip pass ... ok [WILDCARD] +async pass ... ok [WILDCARD] +async throw fail ... FAILED [WILDCARD] +nested test ... + nested 1 ... + nested 2 ... ok [WILDCARD] + nested 1 ... ok [WILDCARD] +nested test ... ok [WILDCARD] +async skip fail ... +------- output ------- +Warning: Not implemented: test.TestContext.skip +----- output end ----- +async skip fail ... FAILED [WILDCARD] +async assertion fail ... FAILED [WILDCARD] +resolve pass ... ok [WILDCARD] +reject fail ... FAILED [WILDCARD] +unhandled rejection - passes but warns ... +Uncaught error from ./test.js FAILED +unhandled rejection - passes but warns ... cancelled ([WILDCARD]) +async unhandled rejection - passes but warns ... cancelled ([WILDCARD]) +immediate throw - passes but warns ... cancelled ([WILDCARD]) +immediate reject - passes but warns ... cancelled ([WILDCARD]) +immediate resolve pass ... cancelled ([WILDCARD]) +subtest sync throw fail ... cancelled ([WILDCARD]) +sync throw non-error fail ... cancelled ([WILDCARD]) +level 0a ... cancelled ([WILDCARD]) +top level ... cancelled ([WILDCARD]) +invalid subtest - pass but subtest fails ... cancelled ([WILDCARD]) +sync skip option ... ignored ([WILDCARD]) +sync skip option with message ... cancelled ([WILDCARD]) +sync skip option is false fail ... cancelled ([WILDCARD]) +noop ... cancelled ([WILDCARD]) +functionOnly ... cancelled ([WILDCARD]) + ... cancelled ([WILDCARD]) +test with only a name provided ... cancelled ([WILDCARD]) +noop ... cancelled ([WILDCARD]) +noop ... ignored ([WILDCARD]) +test with a name and options provided ... ignored ([WILDCARD]) +functionAndOptions ... ignored ([WILDCARD]) +escaped skip message ... cancelled ([WILDCARD]) +escaped todo message ... cancelled ([WILDCARD]) +escaped diagnostic ... cancelled ([WILDCARD]) +callback pass ... cancelled ([WILDCARD]) +callback fail ... cancelled ([WILDCARD]) +sync t is this in test ... cancelled ([WILDCARD]) +async t is this in test ... cancelled ([WILDCARD]) +callback t is this in test ... cancelled ([WILDCARD]) +callback also returns a Promise ... cancelled ([WILDCARD]) +callback throw ... cancelled ([WILDCARD]) +callback called twice ... cancelled ([WILDCARD]) +callback called twice in different ticks ... cancelled ([WILDCARD]) +callback called twice in future tick ... cancelled ([WILDCARD]) +callback async throw ... cancelled ([WILDCARD]) +callback async throw after done ... cancelled ([WILDCARD]) +custom inspect symbol fail ... cancelled ([WILDCARD]) +custom inspect symbol that throws fail ... cancelled ([WILDCARD]) +subtest sync throw fails ... cancelled ([WILDCARD]) +timed out async test ... cancelled ([WILDCARD]) +timed out callback test ... cancelled ([WILDCARD]) +large timeout async test is ok ... cancelled ([WILDCARD]) +large timeout callback test is ok ... cancelled ([WILDCARD]) +successful thenable ... cancelled ([WILDCARD]) +rejected thenable ... cancelled ([WILDCARD]) +unfinished test with uncaughtException ... cancelled ([WILDCARD]) +unfinished test with unhandledRejection ... cancelled ([WILDCARD]) + + ERRORS + +sync fail todo => ./test.js:20:1 +error: Error: thrown from sync fail todo + throw new Error("thrown from sync fail todo"); +[WILDCARD] + +sync fail todo with message => ./test.js:25:1 +error: Error: thrown from sync fail todo with message + throw new Error("thrown from sync fail todo with message"); +[WILDCARD] + +sync throw fail => ./test.js:42:1 +error: Error: thrown from sync throw fail + throw new Error("thrown from sync throw fail"); +[WILDCARD] + +async throw fail => ./test.js:53:1 +error: Error: thrown from async throw fail + throw new Error("thrown from async throw fail"); +[WILDCARD] + +async skip fail => ./test.js:64:1 +error: Error: thrown from async throw fail + throw new Error("thrown from async throw fail"); +[WILDCARD] + +async assertion fail => ./test.js:69:1 +error: AssertionError: Values are not strictly equal: + + + [Diff] Actual / Expected + + +- true ++ false + + at [WILDCARD] + +reject fail => ./test.js:78:1 +error: Error: rejected from reject fail + return Promise.reject(new Error("rejected from reject fail")); + ^ + at [WILDCARD] + +./test.js (uncaught error) +error: (in promise) Error: rejected from unhandled rejection fail + Promise.reject(new Error("rejected from unhandled rejection fail")); + ^ + at [WILDCARD] +This error was not caught from a test and caused the test runner to fail on the referenced module. +It most likely originated from a dangling promise, event/timeout handler or top-level code. + + FAILURES + +sync fail todo => ./test.js:20:1 +sync fail todo with message => ./test.js:25:1 +sync throw fail => ./test.js:42:1 +async throw fail => ./test.js:53:1 +async skip fail => ./test.js:64:1 +async assertion fail => ./test.js:69:1 +reject fail => ./test.js:78:1 +./test.js (uncaught error) + +FAILED | 9 passed (2 steps) | 51 failed | 4 ignored [WILDCARD] + +error: Test failed diff --git a/tests/specs/node/node_test_module_no_sanitizers/__test__.jsonc b/tests/specs/node/node_test_module_no_sanitizers/__test__.jsonc new file mode 100644 index 000000000..0a9a9524b --- /dev/null +++ b/tests/specs/node/node_test_module_no_sanitizers/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "test -A --no-check test_no_sanitizers/test.js", + "output": "test_no_sanitizers/test.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 0 +} diff --git a/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts new file mode 100644 index 000000000..62c82ebca --- /dev/null +++ b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts @@ -0,0 +1,4 @@ +const filename = Deno.args[0]; +using file = await Deno.open(filename); + +await file.readable.pipeTo(Deno.stdout.writable); diff --git a/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.js b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.js new file mode 100644 index 000000000..52d0f1325 --- /dev/null +++ b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.js @@ -0,0 +1,28 @@ +import test from "node:test"; +test("should not complain about resource and op sanitizers", async (t) => { + // resource + const _file1 = Deno.open("test_no_sanitizers/welcome.ts"); + + await t.test("nested test", () => { + // resource + const _file2 = Deno.open("test_no_sanitizers/cat.ts"); + + // op + crypto.subtle.digest( + "SHA-256", + new TextEncoder().encode("a".repeat(1_000_000)), + ); + }); + + // op + crypto.subtle.digest( + "SHA-256", + new TextEncoder().encode("a".repeat(1_000_000)), + ); +}); + +// TODO(mmastrac): This works, but we don't reliably flush stdout/stderr here, making this test flake +// test("should allow exit", () => { +// // no exit sanitizers +// Deno.exit(123); +// }); diff --git a/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.out b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.out new file mode 100644 index 000000000..dc5ab7cfd --- /dev/null +++ b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/test.out @@ -0,0 +1,7 @@ +running 1 test from ./test_no_sanitizers/test.js +should not complain about resource and op sanitizers ... + nested test ... ok ([WILDCARD]) +should not complain about resource and op sanitizers ... ok ([WILDCARD]) + +ok | 1 passed (1 step) | 0 failed ([WILDCARD]) + diff --git a/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts new file mode 100644 index 000000000..f983ca89b --- /dev/null +++ b/tests/specs/node/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts @@ -0,0 +1 @@ +console.log("Welcome to Deno!"); diff --git a/tests/specs/node/web_node_events_dispatched_in_correct_order/__test__.jsonc b/tests/specs/node/web_node_events_dispatched_in_correct_order/__test__.jsonc new file mode 100644 index 000000000..cb5e48878 --- /dev/null +++ b/tests/specs/node/web_node_events_dispatched_in_correct_order/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run events_order.ts", + "output": "events_order.out", + "exitCode": 0 +} diff --git a/tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.out b/tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.out new file mode 100644 index 000000000..270384d8d --- /dev/null +++ b/tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.out @@ -0,0 +1,12 @@ +beforeunload emitted from addEventListener +beforeunload emitted from addEventListener +beforeunload emitted from addEventListener +beforeExit emitted from process.on +more work done! 1 +beforeunload emitted from addEventListener +beforeExit emitted from process.on +more work done! 2 +beforeunload emitted from addEventListener +beforeExit emitted from process.on +unload emitted from addEventListener +exit emitted from process.on diff --git a/tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.ts b/tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.ts new file mode 100644 index 000000000..263f46b4c --- /dev/null +++ b/tests/specs/node/web_node_events_dispatched_in_correct_order/events_order.ts @@ -0,0 +1,25 @@ +import process from "node:process"; + +let count = 0; +process.on("beforeExit", () => { + if (count === 0 || count === 1) { + setTimeout(() => console.log("more work done!", count), 10); + } + count++; + console.log("beforeExit emitted from process.on"); +}); +process.on("exit", () => console.log("exit emitted from process.on")); + +let countWeb = 0; +addEventListener("beforeunload", (event) => { + if (countWeb == 0 || countWeb == 1) { + event.preventDefault(); + } + countWeb++; + console.log("beforeunload emitted from addEventListener"); +}); + +addEventListener( + "unload", + () => console.log("unload emitted from addEventListener"), +); diff --git a/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc b/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc deleted file mode 100644 index 0f3b33300..000000000 --- a/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "run process_beforeexit_exit_events.ts", - "output": "process_beforeexit_exit_events.out", - "exitCode": 0 -} diff --git a/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out b/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out deleted file mode 100644 index 740ef6ffb..000000000 --- a/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.out +++ /dev/null @@ -1,2 +0,0 @@ -beforeExit emitted from processEmit -exit emitted from processEmit diff --git a/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts b/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts deleted file mode 100644 index a4c87f27e..000000000 --- a/tests/specs/node_compat_tests/node_process_beforeexit_exit_events_emitted_without_listeners/process_beforeexit_exit_events.ts +++ /dev/null @@ -1,9 +0,0 @@ -import process from "node:process"; - -const originalEmit = process.emit; -process.emit = function (event, ...args) { - if (event === "exit" || event === "beforeExit") { - console.log(`${event} emitted from processEmit`); - } - return originalEmit.call(this, event, ...args); -}; diff --git a/tests/specs/node_compat_tests/node_test_module/__test__.jsonc b/tests/specs/node_compat_tests/node_test_module/__test__.jsonc deleted file mode 100644 index ef93b6673..000000000 --- a/tests/specs/node_compat_tests/node_test_module/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "test test.js", - "output": "test.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/node_compat_tests/node_test_module/test.js b/tests/specs/node_compat_tests/node_test_module/test.js deleted file mode 100644 index 0f0f9b6b6..000000000 --- a/tests/specs/node_compat_tests/node_test_module/test.js +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. - -// Ported from https://github.com/nodejs/node/blob/d396a041f71cc055ad60b0abc63ad81c0ee6a574/test/fixtures/test-runner/output/output.js - -// deno-lint-ignore-file - -import assert from "node:assert"; -import test from "node:test"; -import util from "node:util"; -import { setImmediate } from "node:timers"; - -test("sync pass todo", (t) => { - t.todo(); -}); - -test("sync pass todo with message", (t) => { - t.todo("this is a passing todo"); -}); - -test("sync fail todo", (t) => { - t.todo(); - throw new Error("thrown from sync fail todo"); -}); - -test("sync fail todo with message", (t) => { - t.todo("this is a failing todo"); - throw new Error("thrown from sync fail todo with message"); -}); - -test("sync skip pass", (t) => { - t.skip(); -}); - -test("sync skip pass with message", (t) => { - t.skip("this is skipped"); -}); - -test("sync pass", (t) => { - t.diagnostic("this test should pass"); -}); - -test("sync throw fail", () => { - throw new Error("thrown from sync throw fail"); -}); - -test("async skip pass", async (t) => { - t.skip(); -}); - -test("async pass", async () => { -}); - -test("async throw fail", async () => { - throw new Error("thrown from async throw fail"); -}); - -test("nested test", async (t) => { - await t.test("nested 1", async (t) => { - await t.test("nested 2", () => { - }); - }); -}); - -test("async skip fail", async (t) => { - t.skip(); - throw new Error("thrown from async throw fail"); -}); - -test("async assertion fail", async () => { - // Make sure the assert module is handled. - assert.strictEqual(true, false); -}); - -test("resolve pass", () => { - return Promise.resolve(); -}); - -test("reject fail", () => { - return Promise.reject(new Error("rejected from reject fail")); -}); - -test("unhandled rejection - passes but warns", () => { - Promise.reject(new Error("rejected from unhandled rejection fail")); -}); - -test("async unhandled rejection - passes but warns", async () => { - Promise.reject(new Error("rejected from async unhandled rejection fail")); -}); - -test("immediate throw - passes but warns", () => { - setImmediate(() => { - throw new Error("thrown from immediate throw fail"); - }); -}); - -test("immediate reject - passes but warns", () => { - setImmediate(() => { - Promise.reject(new Error("rejected from immediate reject fail")); - }); -}); - -test("immediate resolve pass", () => { - return new Promise((resolve) => { - setImmediate(() => { - resolve(); - }); - }); -}); - -test("subtest sync throw fail", async (t) => { - await t.test("+sync throw fail", (t) => { - t.diagnostic("this subtest should make its parent test fail"); - throw new Error("thrown from subtest sync throw fail"); - }); -}); - -test("sync throw non-error fail", async (t) => { - throw Symbol("thrown symbol from sync throw non-error fail"); -}); - -test("level 0a", { concurrency: 4 }, async (t) => { - t.test("level 1a", async (t) => { - const p1a = new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, 100); - }); - - return p1a; - }); - - test("level 1b", async (t) => { - const p1b = new Promise((resolve) => { - resolve(); - }); - - return p1b; - }); - - t.test("level 1c", async (t) => { - const p1c = new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, 200); - }); - - return p1c; - }); - - t.test("level 1d", async (t) => { - const p1c = new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, 150); - }); - - return p1c; - }); - - const p0a = new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, 300); - }); - - return p0a; -}); - -test("top level", { concurrency: 2 }, async (t) => { - t.test("+long running", async (t) => { - return new Promise((resolve, reject) => { - setTimeout(resolve, 300).unref(); - }); - }); - - t.test("+short running", async (t) => { - t.test("++short running", async (t) => {}); - }); -}); - -test("invalid subtest - pass but subtest fails", (t) => { - setImmediate(() => { - t.test("invalid subtest fail", () => { - throw new Error("this should not be thrown"); - }); - }); -}); - -test("sync skip option", { skip: true }, (t) => { - throw new Error("this should not be executed"); -}); - -test("sync skip option with message", { skip: "this is skipped" }, (t) => { - throw new Error("this should not be executed"); -}); - -test("sync skip option is false fail", { skip: false }, (t) => { - throw new Error("this should be executed"); -}); - -// A test with no arguments provided. -test(); - -// A test with only a named function provided. -test(function functionOnly() {}); - -// A test with only an anonymous function provided. -test(() => {}); - -// A test with only a name provided. -test("test with only a name provided"); - -// A test with an empty string name. -test(""); - -// A test with only options provided. -test({ skip: true }); - -// A test with only a name and options provided. -test("test with a name and options provided", { skip: true }); - -// A test with only options and a function provided. -test({ skip: true }, function functionAndOptions() {}); - -// A test whose description needs to be escaped. -// test("escaped description \\ # \\#\\ \n \t \f \v \b \r"); - -// A test whose skip message needs to be escaped. -test("escaped skip message", { skip: "#skip" }); - -// A test whose todo message needs to be escaped. -test("escaped todo message", { todo: "#todo" }); - -// A test with a diagnostic message that needs to be escaped. -test("escaped diagnostic", (t) => { - t.diagnostic("#diagnostic"); -}); - -test("callback pass", (t, done) => { - setImmediate(done); -}); - -test("callback fail", (t, done) => { - setImmediate(() => { - done(new Error("callback failure")); - }); -}); - -test("sync t is this in test", function (t) { - assert.strictEqual(this, t); -}); - -test("async t is this in test", async function (t) { - assert.strictEqual(this, t); -}); - -test("callback t is this in test", function (t, done) { - assert.strictEqual(this, t); - done(); -}); - -test("callback also returns a Promise", async (t, done) => { - throw new Error("thrown from callback also returns a Promise"); -}); - -test("callback throw", (t, done) => { - throw new Error("thrown from callback throw"); -}); - -test("callback called twice", (t, done) => { - done(); - done(); -}); - -test("callback called twice in different ticks", (t, done) => { - setImmediate(done); - done(); -}); - -test("callback called twice in future tick", (t, done) => { - setImmediate(() => { - done(); - done(); - }); -}); - -test("callback async throw", (t, done) => { - setImmediate(() => { - throw new Error("thrown from callback async throw"); - }); -}); - -test("callback async throw after done", (t, done) => { - setImmediate(() => { - throw new Error("thrown from callback async throw after done"); - }); - - done(); -}); - -test("custom inspect symbol fail", () => { - const obj = { - [util.inspect.custom]() { - return "customized"; - }, - foo: 1, - }; - - throw obj; -}); - -test("custom inspect symbol that throws fail", () => { - const obj = { - [util.inspect.custom]() { - throw new Error("bad-inspect"); - }, - foo: 1, - }; - - throw obj; -}); - -test("subtest sync throw fails", async (t) => { - await t.test("sync throw fails at first", (t) => { - throw new Error("thrown from subtest sync throw fails at first"); - }); - await t.test("sync throw fails at second", (t) => { - throw new Error("thrown from subtest sync throw fails at second"); - }); -}); - -test("timed out async test", { timeout: 5 }, async (t) => { - return new Promise((resolve) => { - setTimeout(resolve, 100); - }); -}); - -test("timed out callback test", { timeout: 5 }, (t, done) => { - setTimeout(done, 100); -}); - -test("large timeout async test is ok", { timeout: 30_000_000 }, async (t) => { - return new Promise((resolve) => { - setTimeout(resolve, 10); - }); -}); - -test( - "large timeout callback test is ok", - { timeout: 30_000_000 }, - (t, done) => { - setTimeout(done, 10); - }, -); - -test("successful thenable", () => { - let thenCalled = false; - return { - get then() { - if (thenCalled) throw new Error(); - thenCalled = true; - return (successHandler) => successHandler(); - }, - }; -}); - -test("rejected thenable", () => { - let thenCalled = false; - return { - get then() { - if (thenCalled) throw new Error(); - thenCalled = true; - return (_, errorHandler) => errorHandler("custom error"); - }, - }; -}); - -test("unfinished test with uncaughtException", async () => { - await new Promise(() => { - setTimeout(() => { - throw new Error("foo"); - }); - }); -}); - -test("unfinished test with unhandledRejection", async () => { - await new Promise(() => { - setTimeout(() => Promise.reject(new Error("bar"))); - }); -}); diff --git a/tests/specs/node_compat_tests/node_test_module/test.out b/tests/specs/node_compat_tests/node_test_module/test.out deleted file mode 100644 index c37fb355f..000000000 --- a/tests/specs/node_compat_tests/node_test_module/test.out +++ /dev/null @@ -1,175 +0,0 @@ -[WILDCARD] -running 63 tests from ./test.js -sync pass todo ... -------- output ------- -Warning: Not implemented: test.TestContext.todo ------ output end ----- -sync pass todo ... ok [WILDCARD] -sync pass todo with message ... -------- output ------- -Warning: Not implemented: test.TestContext.todo ------ output end ----- -sync pass todo with message ... ok [WILDCARD] -sync fail todo ... -------- output ------- -Warning: Not implemented: test.TestContext.todo ------ output end ----- -sync fail todo ... FAILED [WILDCARD] -sync fail todo with message ... -------- output ------- -Warning: Not implemented: test.TestContext.todo ------ output end ----- -sync fail todo with message ... FAILED [WILDCARD] -sync skip pass ... -------- output ------- -Warning: Not implemented: test.TestContext.skip ------ output end ----- -sync skip pass ... ok [WILDCARD] -sync skip pass with message ... -------- output ------- -Warning: Not implemented: test.TestContext.skip ------ output end ----- -sync skip pass with message ... ok [WILDCARD] -sync pass ... -------- output ------- -DIAGNOSTIC: this test should pass ------ output end ----- -sync pass ... ok [WILDCARD] -sync throw fail ... FAILED [WILDCARD] -async skip pass ... -------- output ------- -Warning: Not implemented: test.TestContext.skip ------ output end ----- -async skip pass ... ok [WILDCARD] -async pass ... ok [WILDCARD] -async throw fail ... FAILED [WILDCARD] -nested test ... - nested 1 ... - nested 2 ... ok [WILDCARD] - nested 1 ... ok [WILDCARD] -nested test ... ok [WILDCARD] -async skip fail ... -------- output ------- -Warning: Not implemented: test.TestContext.skip ------ output end ----- -async skip fail ... FAILED [WILDCARD] -async assertion fail ... FAILED [WILDCARD] -resolve pass ... ok [WILDCARD] -reject fail ... FAILED [WILDCARD] -unhandled rejection - passes but warns ... -Uncaught error from ./test.js FAILED -unhandled rejection - passes but warns ... cancelled ([WILDCARD]) -async unhandled rejection - passes but warns ... cancelled ([WILDCARD]) -immediate throw - passes but warns ... cancelled ([WILDCARD]) -immediate reject - passes but warns ... cancelled ([WILDCARD]) -immediate resolve pass ... cancelled ([WILDCARD]) -subtest sync throw fail ... cancelled ([WILDCARD]) -sync throw non-error fail ... cancelled ([WILDCARD]) -level 0a ... cancelled ([WILDCARD]) -top level ... cancelled ([WILDCARD]) -invalid subtest - pass but subtest fails ... cancelled ([WILDCARD]) -sync skip option ... ignored ([WILDCARD]) -sync skip option with message ... cancelled ([WILDCARD]) -sync skip option is false fail ... cancelled ([WILDCARD]) -noop ... cancelled ([WILDCARD]) -functionOnly ... cancelled ([WILDCARD]) - ... cancelled ([WILDCARD]) -test with only a name provided ... cancelled ([WILDCARD]) -noop ... cancelled ([WILDCARD]) -noop ... ignored ([WILDCARD]) -test with a name and options provided ... ignored ([WILDCARD]) -functionAndOptions ... ignored ([WILDCARD]) -escaped skip message ... cancelled ([WILDCARD]) -escaped todo message ... cancelled ([WILDCARD]) -escaped diagnostic ... cancelled ([WILDCARD]) -callback pass ... cancelled ([WILDCARD]) -callback fail ... cancelled ([WILDCARD]) -sync t is this in test ... cancelled ([WILDCARD]) -async t is this in test ... cancelled ([WILDCARD]) -callback t is this in test ... cancelled ([WILDCARD]) -callback also returns a Promise ... cancelled ([WILDCARD]) -callback throw ... cancelled ([WILDCARD]) -callback called twice ... cancelled ([WILDCARD]) -callback called twice in different ticks ... cancelled ([WILDCARD]) -callback called twice in future tick ... cancelled ([WILDCARD]) -callback async throw ... cancelled ([WILDCARD]) -callback async throw after done ... cancelled ([WILDCARD]) -custom inspect symbol fail ... cancelled ([WILDCARD]) -custom inspect symbol that throws fail ... cancelled ([WILDCARD]) -subtest sync throw fails ... cancelled ([WILDCARD]) -timed out async test ... cancelled ([WILDCARD]) -timed out callback test ... cancelled ([WILDCARD]) -large timeout async test is ok ... cancelled ([WILDCARD]) -large timeout callback test is ok ... cancelled ([WILDCARD]) -successful thenable ... cancelled ([WILDCARD]) -rejected thenable ... cancelled ([WILDCARD]) -unfinished test with uncaughtException ... cancelled ([WILDCARD]) -unfinished test with unhandledRejection ... cancelled ([WILDCARD]) - - ERRORS - -sync fail todo => ./test.js:20:1 -error: Error: thrown from sync fail todo - throw new Error("thrown from sync fail todo"); -[WILDCARD] - -sync fail todo with message => ./test.js:25:1 -error: Error: thrown from sync fail todo with message - throw new Error("thrown from sync fail todo with message"); -[WILDCARD] - -sync throw fail => ./test.js:42:1 -error: Error: thrown from sync throw fail - throw new Error("thrown from sync throw fail"); -[WILDCARD] - -async throw fail => ./test.js:53:1 -error: Error: thrown from async throw fail - throw new Error("thrown from async throw fail"); -[WILDCARD] - -async skip fail => ./test.js:64:1 -error: Error: thrown from async throw fail - throw new Error("thrown from async throw fail"); -[WILDCARD] - -async assertion fail => ./test.js:69:1 -error: AssertionError: Values are not strictly equal: - - - [Diff] Actual / Expected - - -- true -+ false - - at [WILDCARD] - -reject fail => ./test.js:78:1 -error: Error: rejected from reject fail - return Promise.reject(new Error("rejected from reject fail")); - ^ - at [WILDCARD] - -./test.js (uncaught error) -error: (in promise) Error: rejected from unhandled rejection fail - Promise.reject(new Error("rejected from unhandled rejection fail")); - ^ - at [WILDCARD] -This error was not caught from a test and caused the test runner to fail on the referenced module. -It most likely originated from a dangling promise, event/timeout handler or top-level code. - - FAILURES - -sync fail todo => ./test.js:20:1 -sync fail todo with message => ./test.js:25:1 -sync throw fail => ./test.js:42:1 -async throw fail => ./test.js:53:1 -async skip fail => ./test.js:64:1 -async assertion fail => ./test.js:69:1 -reject fail => ./test.js:78:1 -./test.js (uncaught error) - -FAILED | 9 passed (2 steps) | 51 failed | 4 ignored [WILDCARD] - -error: Test failed diff --git a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/__test__.jsonc b/tests/specs/node_compat_tests/node_test_module_no_sanitizers/__test__.jsonc deleted file mode 100644 index 0a9a9524b..000000000 --- a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "test -A --no-check test_no_sanitizers/test.js", - "output": "test_no_sanitizers/test.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 0 -} diff --git a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts b/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts deleted file mode 100644 index 62c82ebca..000000000 --- a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/cat.ts +++ /dev/null @@ -1,4 +0,0 @@ -const filename = Deno.args[0]; -using file = await Deno.open(filename); - -await file.readable.pipeTo(Deno.stdout.writable); diff --git a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.js b/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.js deleted file mode 100644 index 52d0f1325..000000000 --- a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.js +++ /dev/null @@ -1,28 +0,0 @@ -import test from "node:test"; -test("should not complain about resource and op sanitizers", async (t) => { - // resource - const _file1 = Deno.open("test_no_sanitizers/welcome.ts"); - - await t.test("nested test", () => { - // resource - const _file2 = Deno.open("test_no_sanitizers/cat.ts"); - - // op - crypto.subtle.digest( - "SHA-256", - new TextEncoder().encode("a".repeat(1_000_000)), - ); - }); - - // op - crypto.subtle.digest( - "SHA-256", - new TextEncoder().encode("a".repeat(1_000_000)), - ); -}); - -// TODO(mmastrac): This works, but we don't reliably flush stdout/stderr here, making this test flake -// test("should allow exit", () => { -// // no exit sanitizers -// Deno.exit(123); -// }); diff --git a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.out b/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.out deleted file mode 100644 index dc5ab7cfd..000000000 --- a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/test.out +++ /dev/null @@ -1,7 +0,0 @@ -running 1 test from ./test_no_sanitizers/test.js -should not complain about resource and op sanitizers ... - nested test ... ok ([WILDCARD]) -should not complain about resource and op sanitizers ... ok ([WILDCARD]) - -ok | 1 passed (1 step) | 0 failed ([WILDCARD]) - diff --git a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts b/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts deleted file mode 100644 index f983ca89b..000000000 --- a/tests/specs/node_compat_tests/node_test_module_no_sanitizers/test_no_sanitizers/welcome.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Welcome to Deno!"); diff --git a/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/__test__.jsonc b/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/__test__.jsonc deleted file mode 100644 index cb5e48878..000000000 --- a/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/__test__.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "args": "run events_order.ts", - "output": "events_order.out", - "exitCode": 0 -} diff --git a/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.out b/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.out deleted file mode 100644 index 270384d8d..000000000 --- a/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.out +++ /dev/null @@ -1,12 +0,0 @@ -beforeunload emitted from addEventListener -beforeunload emitted from addEventListener -beforeunload emitted from addEventListener -beforeExit emitted from process.on -more work done! 1 -beforeunload emitted from addEventListener -beforeExit emitted from process.on -more work done! 2 -beforeunload emitted from addEventListener -beforeExit emitted from process.on -unload emitted from addEventListener -exit emitted from process.on diff --git a/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.ts b/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.ts deleted file mode 100644 index 263f46b4c..000000000 --- a/tests/specs/node_compat_tests/web_node_events_dispatched_in_correct_order/events_order.ts +++ /dev/null @@ -1,25 +0,0 @@ -import process from "node:process"; - -let count = 0; -process.on("beforeExit", () => { - if (count === 0 || count === 1) { - setTimeout(() => console.log("more work done!", count), 10); - } - count++; - console.log("beforeExit emitted from process.on"); -}); -process.on("exit", () => console.log("exit emitted from process.on")); - -let countWeb = 0; -addEventListener("beforeunload", (event) => { - if (countWeb == 0 || countWeb == 1) { - event.preventDefault(); - } - countWeb++; - console.log("beforeunload emitted from addEventListener"); -}); - -addEventListener( - "unload", - () => console.log("unload emitted from addEventListener"), -); diff --git a/tests/specs/npm/builtin_module_module/__test__.jsonc b/tests/specs/npm/builtin_module_module/__test__.jsonc new file mode 100644 index 000000000..2f26a95d4 --- /dev/null +++ b/tests/specs/npm/builtin_module_module/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read --quiet builtin_module_module/main.js", + "output": "builtin_module_module/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/builtin_module_module/builtin_module_module/main.js b/tests/specs/npm/builtin_module_module/builtin_module_module/main.js new file mode 100644 index 000000000..9a036791b --- /dev/null +++ b/tests/specs/npm/builtin_module_module/builtin_module_module/main.js @@ -0,0 +1 @@ +import "npm:@denotest/builtin-module-module"; diff --git a/tests/specs/npm/builtin_module_module/builtin_module_module/main.out b/tests/specs/npm/builtin_module_module/builtin_module_module/main.out new file mode 100644 index 000000000..160ba6503 --- /dev/null +++ b/tests/specs/npm/builtin_module_module/builtin_module_module/main.out @@ -0,0 +1,4 @@ +function +function +function +true diff --git a/tests/specs/npm/cached_only/__test__.jsonc b/tests/specs/npm/cached_only/__test__.jsonc new file mode 100644 index 000000000..764f702d2 --- /dev/null +++ b/tests/specs/npm/cached_only/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run --cached-only cached_only/main.ts", + "output": "cached_only/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/cached_only/cached_only/main.out b/tests/specs/npm/cached_only/cached_only/main.out new file mode 100644 index 000000000..0d0cdad09 --- /dev/null +++ b/tests/specs/npm/cached_only/cached_only/main.out @@ -0,0 +1,2 @@ +error: Error getting response at http://localhost:4260/chalk for package "chalk": An npm specifier not found in cache: "chalk", --cached-only is specified. + at file:///[WILDCARD]/main.ts:1:19 diff --git a/tests/specs/npm/cached_only/cached_only/main.ts b/tests/specs/npm/cached_only/cached_only/main.ts new file mode 100644 index 000000000..1ccc441a1 --- /dev/null +++ b/tests/specs/npm/cached_only/cached_only/main.ts @@ -0,0 +1,3 @@ +import chalk from "npm:chalk@5"; + +console.log(chalk); diff --git a/tests/specs/npm/check_all/__test__.jsonc b/tests/specs/npm/check_all/__test__.jsonc new file mode 100644 index 000000000..427524305 --- /dev/null +++ b/tests/specs/npm/check_all/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "check --all check_errors/main.ts", + "output": "check_errors/main_all.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/check_all/check_errors/main.ts b/tests/specs/npm/check_all/check_errors/main.ts new file mode 100644 index 000000000..4b8684195 --- /dev/null +++ b/tests/specs/npm/check_all/check_errors/main.ts @@ -0,0 +1,3 @@ +import * as test from "npm:@denotest/check-error"; + +console.log(test.Asdf); // should error diff --git a/tests/specs/npm/check_all/check_errors/main_all.out b/tests/specs/npm/check_all/check_errors/main_all.out new file mode 100644 index 000000000..4c624c0ea --- /dev/null +++ b/tests/specs/npm/check_all/check_errors/main_all.out @@ -0,0 +1,19 @@ +Download http://localhost:4260/@denotest/check-error +Download http://localhost:4260/@denotest/check-error/1.0.0.tgz +Check file:///[WILDCARD]/check_errors/main.ts +error: TS2506 [ERROR]: 'Class1' is referenced directly or indirectly in its own base expression. +export class Class1 extends Class2 { + ~~~~~~ + at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:2:14 + +TS2506 [ERROR]: 'Class2' is referenced directly or indirectly in its own base expression. +export class Class2 extends Class1 { + ~~~~~~ + at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:5:14 + +TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. +console.log(test.Asdf); // should error + ~~~~ + at file:///[WILDCARD]/check_errors/main.ts:3:18 + +Found 3 errors. diff --git a/tests/specs/npm/check_all/check_errors/main_local.out b/tests/specs/npm/check_all/check_errors/main_local.out new file mode 100644 index 000000000..4d3a892e7 --- /dev/null +++ b/tests/specs/npm/check_all/check_errors/main_local.out @@ -0,0 +1,7 @@ +Download http://localhost:4260/@denotest/check-error +Download http://localhost:4260/@denotest/check-error/1.0.0.tgz +Check file:///[WILDCARD]/check_errors/main.ts +error: TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. +console.log(test.Asdf); // should error + ~~~~ + at file:///[WILDCARD]/npm/check_errors/main.ts:3:18 diff --git a/tests/specs/npm/check_local/__test__.jsonc b/tests/specs/npm/check_local/__test__.jsonc new file mode 100644 index 000000000..1bffa5eed --- /dev/null +++ b/tests/specs/npm/check_local/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "check check_errors/main.ts", + "output": "check_errors/main_local.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/check_local/check_errors/main.ts b/tests/specs/npm/check_local/check_errors/main.ts new file mode 100644 index 000000000..4b8684195 --- /dev/null +++ b/tests/specs/npm/check_local/check_errors/main.ts @@ -0,0 +1,3 @@ +import * as test from "npm:@denotest/check-error"; + +console.log(test.Asdf); // should error diff --git a/tests/specs/npm/check_local/check_errors/main_all.out b/tests/specs/npm/check_local/check_errors/main_all.out new file mode 100644 index 000000000..4c624c0ea --- /dev/null +++ b/tests/specs/npm/check_local/check_errors/main_all.out @@ -0,0 +1,19 @@ +Download http://localhost:4260/@denotest/check-error +Download http://localhost:4260/@denotest/check-error/1.0.0.tgz +Check file:///[WILDCARD]/check_errors/main.ts +error: TS2506 [ERROR]: 'Class1' is referenced directly or indirectly in its own base expression. +export class Class1 extends Class2 { + ~~~~~~ + at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:2:14 + +TS2506 [ERROR]: 'Class2' is referenced directly or indirectly in its own base expression. +export class Class2 extends Class1 { + ~~~~~~ + at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:5:14 + +TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. +console.log(test.Asdf); // should error + ~~~~ + at file:///[WILDCARD]/check_errors/main.ts:3:18 + +Found 3 errors. diff --git a/tests/specs/npm/check_local/check_errors/main_local.out b/tests/specs/npm/check_local/check_errors/main_local.out new file mode 100644 index 000000000..1a150b5e6 --- /dev/null +++ b/tests/specs/npm/check_local/check_errors/main_local.out @@ -0,0 +1,7 @@ +Download http://localhost:4260/@denotest/check-error +Download http://localhost:4260/@denotest/check-error/1.0.0.tgz +Check file:///[WILDCARD]/check_errors/main.ts +error: TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. +console.log(test.Asdf); // should error + ~~~~ + at file:///[WILDCARD]/check_errors/main.ts:3:18 diff --git a/tests/specs/npm/check_package_file_dts_dmts_dcts/__test__.jsonc b/tests/specs/npm/check_package_file_dts_dmts_dcts/__test__.jsonc new file mode 100644 index 000000000..675051a69 --- /dev/null +++ b/tests/specs/npm/check_package_file_dts_dmts_dcts/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "check file_dts_dmts_dcts/main.ts", + "output": "file_dts_dmts_dcts/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out b/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out new file mode 100644 index 000000000..507d2c2f7 --- /dev/null +++ b/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out @@ -0,0 +1,24 @@ +Download http://localhost:4260/@denotest/file-dts-dmts-dcts +Download http://localhost:4260/@denotest/file-dts-dmts-dcts/1.0.0.tgz +Check file:///[WILDCARD]/main.ts +error: TS2322 [ERROR]: Type '5' is not assignable to type '"dts"'. +const value1: Dts1 = 5; + ~~~~~~ + at file:///[WILDCARD] + +TS2322 [ERROR]: Type '5' is not assignable to type '"mts"'. +const value2: Mts1 = 5; + ~~~~~~ + at file:///[WILDCARD] + +TS2322 [ERROR]: Type '5' is not assignable to type '"mts"'. +const value3: Mts2 = 5; + ~~~~~~ + at file:///[WILDCARD] + +TS2322 [ERROR]: Type '5' is not assignable to type '"cts"'. +const value4: Cts1 = 5; + ~~~~~~ + at file:///[WILDCARD] + +Found 4 errors. diff --git a/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts b/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts new file mode 100644 index 000000000..63686e2d3 --- /dev/null +++ b/tests/specs/npm/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts @@ -0,0 +1,9 @@ +import { Value as Dts1 } from "npm:@denotest/file-dts-dmts-dcts/js"; +import { Value as Mts1 } from "npm:@denotest/file-dts-dmts-dcts"; +import { Value as Mts2 } from "npm:@denotest/file-dts-dmts-dcts/mjs"; +import { Value as Cts1 } from "npm:@denotest/file-dts-dmts-dcts/cjs"; + +const value1: Dts1 = 5; +const value2: Mts1 = 5; +const value3: Mts2 = 5; +const value4: Cts1 = 5; diff --git a/tests/specs/npm/child_process_fork_test/__test__.jsonc b/tests/specs/npm/child_process_fork_test/__test__.jsonc new file mode 100644 index 000000000..f83cb051e --- /dev/null +++ b/tests/specs/npm/child_process_fork_test/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet child_process_fork_test/main.ts", + "output": "child_process_fork_test/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/child_process_fork_test/child_process_fork_test/main.out b/tests/specs/npm/child_process_fork_test/child_process_fork_test/main.out new file mode 100644 index 000000000..d5bc57741 --- /dev/null +++ b/tests/specs/npm/child_process_fork_test/child_process_fork_test/main.out @@ -0,0 +1,2 @@ +function +Done. diff --git a/tests/specs/npm/child_process_fork_test/child_process_fork_test/main.ts b/tests/specs/npm/child_process_fork_test/child_process_fork_test/main.ts new file mode 100644 index 000000000..e560edb7e --- /dev/null +++ b/tests/specs/npm/child_process_fork_test/child_process_fork_test/main.ts @@ -0,0 +1,4 @@ +import "npm:chalk@4"; +import { run } from "npm:@denotest/child-process-fork"; + +run(); diff --git a/tests/specs/npm/cjs_invalid_name_exports/__test__.jsonc b/tests/specs/npm/cjs_invalid_name_exports/__test__.jsonc new file mode 100644 index 000000000..a38b8d035 --- /dev/null +++ b/tests/specs/npm/cjs_invalid_name_exports/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read --quiet cjs-invalid-name-exports/main.ts", + "output": "cjs-invalid-name-exports/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out b/tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out new file mode 100644 index 000000000..45ec15d0e --- /dev/null +++ b/tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out @@ -0,0 +1,13 @@ +[Module: null prototype] { + "a \\ b": "a \\ b", + "another 'case'": "example", + default: { + 'wow "double quotes"': "double quotes", + "another 'case'": "example", + "a \\ b": "a \\ b", + "name variable": "a", + "foo - bar": "foo - bar" + }, + "foo - bar": "foo - bar", + 'wow "double quotes"': "double quotes" +} diff --git a/tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts b/tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts new file mode 100644 index 000000000..9bdf0e43b --- /dev/null +++ b/tests/specs/npm/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts @@ -0,0 +1,3 @@ +import * as foo from "npm:@denotest/cjs-invalid-name-exports"; + +console.log(foo); diff --git a/tests/specs/npm/cjs_local_global_decls/__test__.jsonc b/tests/specs/npm/cjs_local_global_decls/__test__.jsonc new file mode 100644 index 000000000..8bf847873 --- /dev/null +++ b/tests/specs/npm/cjs_local_global_decls/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read cjs_local_global_decls/main.ts", + "output": "cjs_local_global_decls/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out b/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out new file mode 100644 index 000000000..5e7a36c8d --- /dev/null +++ b/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/cjs-local-global-decls +Download http://localhost:4260/@denotest/cjs-local-global-decls/1.0.0.tgz +Loaded. diff --git a/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.ts b/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.ts new file mode 100644 index 000000000..04074057b --- /dev/null +++ b/tests/specs/npm/cjs_local_global_decls/cjs_local_global_decls/main.ts @@ -0,0 +1 @@ +import "npm:@denotest/cjs-local-global-decls@1.0.0"; diff --git a/tests/specs/npm/cjs_module_export_assignment/__test__.jsonc b/tests/specs/npm/cjs_module_export_assignment/__test__.jsonc new file mode 100644 index 000000000..e9be6361a --- /dev/null +++ b/tests/specs/npm/cjs_module_export_assignment/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet --check=all cjs_module_export_assignment/main.ts", + "output": "cjs_module_export_assignment/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.out b/tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.out new file mode 100644 index 000000000..dea185e38 --- /dev/null +++ b/tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.out @@ -0,0 +1,6 @@ +{ func: [Function: func] } +[Module: null prototype] { + default: { func: [Function: func] }, + func: [Function: func] +} +5 diff --git a/tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.ts b/tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.ts new file mode 100644 index 000000000..93d3db1c3 --- /dev/null +++ b/tests/specs/npm/cjs_module_export_assignment/cjs_module_export_assignment/main.ts @@ -0,0 +1,6 @@ +import defaultImport, * as namespaceImport from "npm:@denotest/cjs-module-export-assignment"; +import { func } from "npm:@denotest/cjs-module-export-assignment"; + +console.log(defaultImport); +console.log(namespaceImport); +console.log(func()); diff --git a/tests/specs/npm/cjs_module_export_assignment_number/__test__.jsonc b/tests/specs/npm/cjs_module_export_assignment_number/__test__.jsonc new file mode 100644 index 000000000..d70f82e50 --- /dev/null +++ b/tests/specs/npm/cjs_module_export_assignment_number/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet --check=all cjs_module_export_assignment_number/main.ts", + "output": "cjs_module_export_assignment_number/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out b/tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out new file mode 100644 index 000000000..e559775cf --- /dev/null +++ b/tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out @@ -0,0 +1,3 @@ +5 +5 +[Module: null prototype] { default: 5 } diff --git a/tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts b/tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts new file mode 100644 index 000000000..aee24bf19 --- /dev/null +++ b/tests/specs/npm/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts @@ -0,0 +1,7 @@ +import defaultImport, * as namespaceImport from "npm:@denotest/cjs-module-export-assignment-number"; + +const testDefault: 5 = defaultImport; +console.log(testDefault); +const testNamespace: 5 = namespaceImport.default; +console.log(testNamespace); +console.log(namespaceImport); diff --git a/tests/specs/npm/cjs_pkg_imports/__test__.jsonc b/tests/specs/npm/cjs_pkg_imports/__test__.jsonc new file mode 100644 index 000000000..c51f14b56 --- /dev/null +++ b/tests/specs/npm/cjs_pkg_imports/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A cjs_pkg_imports/main.ts", + "output": "cjs_pkg_imports/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out b/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out new file mode 100644 index 000000000..661146bd0 --- /dev/null +++ b/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/cjs-pkg-imports +Download http://localhost:4260/@denotest/cjs-pkg-imports/1.0.0.tgz +{ crypto: Crypto { subtle: SubtleCrypto {} }, number: 5 } diff --git a/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.ts b/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.ts new file mode 100644 index 000000000..b30a3f85c --- /dev/null +++ b/tests/specs/npm/cjs_pkg_imports/cjs_pkg_imports/main.ts @@ -0,0 +1,3 @@ +import crypto from "npm:@denotest/cjs-pkg-imports"; + +console.log(crypto); diff --git a/tests/specs/npm/cjs_reexport_collision/__test__.jsonc b/tests/specs/npm/cjs_reexport_collision/__test__.jsonc new file mode 100644 index 000000000..0b9d1e621 --- /dev/null +++ b/tests/specs/npm/cjs_reexport_collision/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet cjs_reexport_collision/main.ts", + "output": "cjs_reexport_collision/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.out b/tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.out new file mode 100644 index 000000000..ed3193f8d --- /dev/null +++ b/tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.out @@ -0,0 +1 @@ +Hi. diff --git a/tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.ts b/tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.ts new file mode 100644 index 000000000..4bfcd89b1 --- /dev/null +++ b/tests/specs/npm/cjs_reexport_collision/cjs_reexport_collision/main.ts @@ -0,0 +1,2 @@ +import ReExportCollision from "npm:@denotest/cjs-reexport-collision"; +ReExportCollision.default.sayHello(); diff --git a/tests/specs/npm/cjs_require_esm/__test__.jsonc b/tests/specs/npm/cjs_require_esm/__test__.jsonc new file mode 100644 index 000000000..172f1ca65 --- /dev/null +++ b/tests/specs/npm/cjs_require_esm/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read --quiet cjs_require_esm/main.ts", + "output": "cjs_require_esm/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/cjs_require_esm/cjs_require_esm/main.out b/tests/specs/npm/cjs_require_esm/cjs_require_esm/main.out new file mode 100644 index 000000000..4afceccc9 --- /dev/null +++ b/tests/specs/npm/cjs_require_esm/cjs_require_esm/main.out @@ -0,0 +1,4 @@ +[Module: null prototype] { + Test: [Module: null prototype] { Test: [class Test] }, + default: { Test: [Module: null prototype] { Test: [class Test] } } +} diff --git a/tests/specs/npm/cjs_require_esm/cjs_require_esm/main.ts b/tests/specs/npm/cjs_require_esm/cjs_require_esm/main.ts new file mode 100644 index 000000000..069d4b60e --- /dev/null +++ b/tests/specs/npm/cjs_require_esm/cjs_require_esm/main.ts @@ -0,0 +1,2 @@ +import * as ns from "npm:@denotest/cjs-require-esm"; +console.log(ns); diff --git a/tests/specs/npm/cjs_require_esm_mjs/__test__.jsonc b/tests/specs/npm/cjs_require_esm_mjs/__test__.jsonc new file mode 100644 index 000000000..3a1323127 --- /dev/null +++ b/tests/specs/npm/cjs_require_esm_mjs/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read --quiet cjs_require_esm_mjs/main.ts", + "output": "cjs_require_esm_mjs/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out b/tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out new file mode 100644 index 000000000..4afceccc9 --- /dev/null +++ b/tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out @@ -0,0 +1,4 @@ +[Module: null prototype] { + Test: [Module: null prototype] { Test: [class Test] }, + default: { Test: [Module: null prototype] { Test: [class Test] } } +} diff --git a/tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts b/tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts new file mode 100644 index 000000000..d753c2a83 --- /dev/null +++ b/tests/specs/npm/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts @@ -0,0 +1,2 @@ +import * as ns from "npm:@denotest/cjs-require-esm/require_mjs.js"; +console.log(ns); diff --git a/tests/specs/npm/cjs_sub_path/__test__.jsonc b/tests/specs/npm/cjs_sub_path/__test__.jsonc new file mode 100644 index 000000000..dbec76a13 --- /dev/null +++ b/tests/specs/npm/cjs_sub_path/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read cjs_sub_path/main.js", + "output": "cjs_sub_path/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/cjs_sub_path/cjs_sub_path/main.js b/tests/specs/npm/cjs_sub_path/cjs_sub_path/main.js new file mode 100644 index 000000000..b71360959 --- /dev/null +++ b/tests/specs/npm/cjs_sub_path/cjs_sub_path/main.js @@ -0,0 +1,21 @@ +// this package will require a subpath like "ajv/dist/compile/codegen" +// and also get the parent directory index.js file using require("..") +import Ajv from "npm:ajv@~8.11"; +import addFormats from "npm:ajv-formats@2.1.1"; +import { expect } from "npm:chai@4.3"; + +const ajv = new Ajv(); +addFormats(ajv); + +const schema = { + type: "string", + format: "date", + formatMinimum: "2016-02-06", + formatExclusiveMaximum: "2016-12-27", +}; +const validate = ajv.compile(schema); + +expect(validate("2016-02-06")).to.be.true; +expect(validate("2016-02-05")).to.be.false; + +console.log("Fini"); diff --git a/tests/specs/npm/cjs_sub_path/cjs_sub_path/main.out b/tests/specs/npm/cjs_sub_path/cjs_sub_path/main.out new file mode 100644 index 000000000..868733775 --- /dev/null +++ b/tests/specs/npm/cjs_sub_path/cjs_sub_path/main.out @@ -0,0 +1,35 @@ +[UNORDERED_START] +Download http://localhost:4260/ajv +Download http://localhost:4260/ajv-formats +Download http://localhost:4260/chai +Download http://localhost:4260/fast-deep-equal +Download http://localhost:4260/json-schema-traverse +Download http://localhost:4260/require-from-string +Download http://localhost:4260/uri-js +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/punycode +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ajv/ajv-8.11.0.tgz +Download http://localhost:4260/ajv-formats/ajv-formats-2.1.1.tgz +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Download http://localhost:4260/chai/chai-4.3.6.tgz +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Download http://localhost:4260/fast-deep-equal/fast-deep-equal-3.1.3.tgz +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Download http://localhost:4260/json-schema-traverse/json-schema-traverse-1.0.0.tgz +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Download http://localhost:4260/punycode/punycode-2.1.1.tgz +Download http://localhost:4260/require-from-string/require-from-string-2.0.2.tgz +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +Download http://localhost:4260/uri-js/uri-js-4.4.1.tgz +[UNORDERED_END] +Fini diff --git a/tests/specs/npm/cjs_this_in_exports/__test__.jsonc b/tests/specs/npm/cjs_this_in_exports/__test__.jsonc new file mode 100644 index 000000000..251691ca8 --- /dev/null +++ b/tests/specs/npm/cjs_this_in_exports/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run --allow-read --quiet cjs_this_in_exports/main.js", + "output": "cjs_this_in_exports/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.js b/tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.js new file mode 100644 index 000000000..03aaabe05 --- /dev/null +++ b/tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.js @@ -0,0 +1,11 @@ +import defaultImport, { getValue } from "npm:@denotest/cjs-this-in-exports"; +import * as namespaceImport from "npm:@denotest/cjs-this-in-exports"; + +console.log(defaultImport.getValue()); +// In Node this actually fails, but it seems to work in Deno +// so I guess there's no harm in that. +console.log(namespaceImport.getValue()); + +// This will throw because it's lost its context. +// (same thing occurs with Node's cjs -> esm translation) +getValue(); diff --git a/tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.out b/tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.out new file mode 100644 index 000000000..88c18dbe4 --- /dev/null +++ b/tests/specs/npm/cjs_this_in_exports/cjs_this_in_exports/main.out @@ -0,0 +1,5 @@ +1 +1 +error: Uncaught (in promise) TypeError: this.otherMethod is not a function + at getValue (file://[WILDCARD]/@denotest/cjs-this-in-exports/1.0.0/index.js:3:17) + at file://[WILDCARD]/main.js:11:1 diff --git a/tests/specs/npm/cjs_with_deps/__test__.jsonc b/tests/specs/npm/cjs_with_deps/__test__.jsonc new file mode 100644 index 000000000..d9014f102 --- /dev/null +++ b/tests/specs/npm/cjs_with_deps/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read --allow-env cjs_with_deps/main.js", + "output": "cjs_with_deps/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main.js b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main.js new file mode 100644 index 000000000..568726874 --- /dev/null +++ b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main.js @@ -0,0 +1,12 @@ +import chalk from "npm:chalk@4"; +import { expect } from "npm:chai@4.3"; + +console.log(chalk.green("chalk cjs loads")); + +const timeout = setTimeout(() => {}, 0); +expect(timeout).to.be.a("number"); +clearTimeout(timeout); + +const interval = setInterval(() => {}, 100); +expect(interval).to.be.a("number"); +clearInterval(interval); diff --git a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main.out b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main.out new file mode 100644 index 000000000..7051c2395 --- /dev/null +++ b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main.out @@ -0,0 +1,33 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Download http://localhost:4260/chai/chai-4.3.6.tgz +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info.out b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info.out new file mode 100644 index 000000000..8e37c88eb --- /dev/null +++ b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info.out @@ -0,0 +1,22 @@ +local: [WILDCARD]main.js +type: JavaScript +dependencies: 14 unique +size: [WILDCARD] + +file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) +├─┬ npm:/chalk@4.1.2 ([WILDCARD]) +│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) +│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) +│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) +│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) +│ └── npm:/has-flag@4.0.0 ([WILDCARD]) +└─┬ npm:/chai@4.3.6 ([WILDCARD]) + ├── npm:/assertion-error@1.1.0 ([WILDCARD]) + ├── npm:/check-error@1.0.2 ([WILDCARD]) + ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) + │ └── npm:/type-detect@4.0.8 ([WILDCARD]) + ├── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) + │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├── npm:/pathval@1.1.1 ([WILDCARD]) + └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info_json.out b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info_json.out new file mode 100644 index 000000000..af1ef1351 --- /dev/null +++ b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_info_json.out @@ -0,0 +1,148 @@ +{ + "roots": [ + "file://[WILDCARD]/main.js" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "npm:chalk@4", + "code": { + "specifier": "npm:chalk@4", + "span": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 31 + } + } + }, + "npmPackage": "chalk@4.1.2" + }, + { + "specifier": "npm:chai@4.3", + "code": { + "specifier": "npm:chai@4.3", + "span": { + "start": { + "line": 1, + "character": 23 + }, + "end": { + "line": 1, + "character": 37 + } + } + }, + "npmPackage": "chai@4.3.6" + } + ], + "local": "[WILDCARD]main.js", + "size": 325, + "mediaType": "JavaScript", + "specifier": "[WILDCARD]/main.js" + } + ], + "redirects": { + "npm:chai@4.3": "npm:/chai@4.3.6", + "npm:chalk@4": "npm:/chalk@4.1.2" + }, + "version": 1, + "npmPackages": { + "ansi-styles@4.3.0": { + "name": "ansi-styles", + "version": "4.3.0", + "dependencies": [ + "color-convert@2.0.1" + ] + }, + "assertion-error@1.1.0": { + "name": "assertion-error", + "version": "1.1.0", + "dependencies": [] + }, + "chai@4.3.6": { + "name": "chai", + "version": "4.3.6", + "dependencies": [ + "assertion-error@1.1.0", + "check-error@1.0.2", + "deep-eql@3.0.1", + "get-func-name@2.0.0", + "loupe@2.3.4", + "pathval@1.1.1", + "type-detect@4.0.8" + ] + }, + "chalk@4.1.2": { + "name": "chalk", + "version": "4.1.2", + "dependencies": [ + "ansi-styles@4.3.0", + "supports-color@7.2.0" + ] + }, + "check-error@1.0.2": { + "name": "check-error", + "version": "1.0.2", + "dependencies": [] + }, + "color-convert@2.0.1": { + "name": "color-convert", + "version": "2.0.1", + "dependencies": [ + "color-name@1.1.4" + ] + }, + "color-name@1.1.4": { + "name": "color-name", + "version": "1.1.4", + "dependencies": [] + }, + "deep-eql@3.0.1": { + "name": "deep-eql", + "version": "3.0.1", + "dependencies": [ + "type-detect@4.0.8" + ] + }, + "get-func-name@2.0.0": { + "name": "get-func-name", + "version": "2.0.0", + "dependencies": [] + }, + "has-flag@4.0.0": { + "name": "has-flag", + "version": "4.0.0", + "dependencies": [] + }, + "loupe@2.3.4": { + "name": "loupe", + "version": "2.3.4", + "dependencies": [ + "get-func-name@2.0.0" + ] + }, + "pathval@1.1.1": { + "name": "pathval", + "version": "1.1.1", + "dependencies": [] + }, + "supports-color@7.2.0": { + "name": "supports-color", + "version": "7.2.0", + "dependencies": [ + "has-flag@4.0.0" + ] + }, + "type-detect@4.0.8": { + "name": "type-detect", + "version": "4.0.8", + "dependencies": [] + } + } +} diff --git a/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_node_modules.out b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_node_modules.out new file mode 100644 index 000000000..1ab367952 --- /dev/null +++ b/tests/specs/npm/cjs_with_deps/cjs_with_deps/main_node_modules.out @@ -0,0 +1,47 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Initialize ansi-styles@4.3.0 +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Initialize assertion-error@1.1.0 +Download http://localhost:4260/chai/chai-4.3.6.tgz +Initialize chai@4.3.6 +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Initialize chalk@4.1.2 +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Initialize check-error@1.0.2 +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Initialize color-convert@2.0.1 +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Initialize color-name@1.1.4 +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Initialize deep-eql@3.0.1 +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Initialize get-func-name@2.0.0 +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Initialize has-flag@4.0.0 +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Initialize loupe@2.3.4 +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Initialize pathval@1.1.1 +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Initialize supports-color@7.2.0 +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +Initialize type-detect@4.0.8 +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/compare_globals/__test__.jsonc b/tests/specs/npm/compare_globals/__test__.jsonc new file mode 100644 index 000000000..d86a76dbc --- /dev/null +++ b/tests/specs/npm/compare_globals/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read --check=all compare_globals/main.ts", + "output": "compare_globals/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/compare_globals/compare_globals/main.out b/tests/specs/npm/compare_globals/compare_globals/main.out new file mode 100644 index 000000000..a1b0a566d --- /dev/null +++ b/tests/specs/npm/compare_globals/compare_globals/main.out @@ -0,0 +1,30 @@ +[UNORDERED_START] +Download http://localhost:4260/@types/node +Download http://localhost:4260/undici-types +Download http://localhost:4260/@denotest/globals +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/globals/1.0.0.tgz +Download http://localhost:4260/@types/node/node-22.5.4.tgz +Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz +[UNORDERED_END] +Check file:///[WILDCARD]/compare_globals/main.ts +true +true +[] +setTimeout 1 false +setTimeout 2 function +setTimeout 3 function +setTimeout 4 function +setTimeout 5 undefined +window 1 false +window 2 false +false +false +self 1 true +self 2 true +false +false +bar +bar +true diff --git a/tests/specs/npm/compare_globals/compare_globals/main.ts b/tests/specs/npm/compare_globals/compare_globals/main.ts new file mode 100644 index 000000000..9482798d8 --- /dev/null +++ b/tests/specs/npm/compare_globals/compare_globals/main.ts @@ -0,0 +1,54 @@ +/// + +import * as globals from "npm:@denotest/globals"; +console.log(globals.global === globals.globalThis); +// @ts-expect-error even though these are the same object, they have different types +console.log(globals.globalThis === globalThis); +console.log(globals.process.execArgv); + +type AssertTrue = never; +type _TestNoProcessGlobal = AssertTrue< + typeof globalThis extends { process: any } ? false : true +>; +type _TestHasNodeJsGlobal = NodeJS.Architecture; + +const controller = new AbortController(); +controller.abort("reason"); // in the NodeJS declaration it doesn't have a reason + +// Some globals are not the same between Node and Deno. +// @ts-expect-error incompatible types between Node and Deno +console.log("setTimeout 1", globalThis.setTimeout === globals.getSetTimeout()); + +// Super edge case where some Node code deletes a global where the +// Node code has its own global and the Deno code has the same global, +// but it's different. Basically if some Node code deletes +// one of these globals then we don't want it to suddenly inherit +// the Deno global (or touch the Deno global at all). +console.log("setTimeout 2", typeof globalThis.setTimeout); +console.log("setTimeout 3", typeof globals.getSetTimeout()); +globals.deleteSetTimeout(); +console.log("setTimeout 4", typeof globalThis.setTimeout); +console.log("setTimeout 5", typeof globals.getSetTimeout()); + +// In Deno 2 and Node.js, the window global is not defined. +console.log("window 1", "window" in globalThis); +console.log( + "window 2", + Object.getOwnPropertyDescriptor(globalThis, "window") !== undefined, +); +globals.checkWindowGlobal(); + +// In Deno 2 self global is defined, but in Node it is not. +console.log("self 1", "self" in globalThis); +console.log( + "self 2", + Object.getOwnPropertyDescriptor(globalThis, "self") !== undefined, +); +globals.checkSelfGlobal(); + +// "Non-managed" globals are shared between Node and Deno. +(globalThis as any).foo = "bar"; +console.log((globalThis as any).foo); +console.log(globals.getFoo()); + +console.log(Reflect.ownKeys(globalThis).includes("console")); // non-enumerable keys are included diff --git a/tests/specs/npm/create_require/__test__.jsonc b/tests/specs/npm/create_require/__test__.jsonc new file mode 100644 index 000000000..40d9ce066 --- /dev/null +++ b/tests/specs/npm/create_require/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run --reload --allow-read create_require/main.ts", + "output": "create_require/main.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/create_require/create_require/main.out b/tests/specs/npm/create_require/create_require/main.out new file mode 100644 index 000000000..70b0415b3 --- /dev/null +++ b/tests/specs/npm/create_require/create_require/main.out @@ -0,0 +1,12 @@ +[WILDCARD] +function +function +function +function +function +function +The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received https://example.com/ +The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received https://example.com/ +The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received 1 +The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received foo +The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ./foo diff --git a/tests/specs/npm/create_require/create_require/main.ts b/tests/specs/npm/create_require/create_require/main.ts new file mode 100644 index 000000000..625c734aa --- /dev/null +++ b/tests/specs/npm/create_require/create_require/main.ts @@ -0,0 +1 @@ +import "npm:@denotest/create-require@1.0.0"; diff --git a/tests/specs/npm/deno_cache/__test__.jsonc b/tests/specs/npm/deno_cache/__test__.jsonc new file mode 100644 index 000000000..93b204c03 --- /dev/null +++ b/tests/specs/npm/deno_cache/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "cache --reload npm:chalk npm:mkdirp", + "output": "deno_cache.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_cache/deno_cache.out b/tests/specs/npm/deno_cache/deno_cache.out new file mode 100644 index 000000000..d723293a8 --- /dev/null +++ b/tests/specs/npm/deno_cache/deno_cache.out @@ -0,0 +1,8 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/mkdirp +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/chalk/chalk-5.0.1.tgz +Download http://localhost:4260/mkdirp/mkdirp-1.0.4.tgz +[UNORDERED_END] diff --git a/tests/specs/npm/deno_run_bin_cjs/__test__.jsonc b/tests/specs/npm/deno_run_bin_cjs/__test__.jsonc new file mode 100644 index 000000000..9eb8e9bfe --- /dev/null +++ b/tests/specs/npm/deno_run_bin_cjs/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet npm:@denotest/bin/cli-cjs this is a test", + "output": "deno_run_cjs.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_run_bin_cjs/deno_run_cjs.out b/tests/specs/npm/deno_run_bin_cjs/deno_run_cjs.out new file mode 100644 index 000000000..ffe7cbd89 --- /dev/null +++ b/tests/specs/npm/deno_run_bin_cjs/deno_run_cjs.out @@ -0,0 +1,4 @@ +this +is +a +test diff --git a/tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc b/tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc new file mode 100644 index 000000000..6ee5a326b --- /dev/null +++ b/tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet npm:@denotest/bin@0.6.0/cli-cjs.js this is a test", + "output": "deno_run_cjs.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out b/tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out new file mode 100644 index 000000000..ffe7cbd89 --- /dev/null +++ b/tests/specs/npm/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out @@ -0,0 +1,4 @@ +this +is +a +test diff --git a/tests/specs/npm/deno_run_bin_esm/__test__.jsonc b/tests/specs/npm/deno_run_bin_esm/__test__.jsonc new file mode 100644 index 000000000..fc48451bb --- /dev/null +++ b/tests/specs/npm/deno_run_bin_esm/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet npm:@denotest/bin/cli-esm this is a test", + "output": "deno_run_esm.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_run_bin_esm/deno_run_esm.out b/tests/specs/npm/deno_run_bin_esm/deno_run_esm.out new file mode 100644 index 000000000..ffe7cbd89 --- /dev/null +++ b/tests/specs/npm/deno_run_bin_esm/deno_run_esm.out @@ -0,0 +1,4 @@ +this +is +a +test diff --git a/tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc b/tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc new file mode 100644 index 000000000..956755b30 --- /dev/null +++ b/tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet npm:@denotest/bin@0.6.0/cli.mjs this is a test", + "output": "deno_run_esm.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out b/tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out new file mode 100644 index 000000000..ffe7cbd89 --- /dev/null +++ b/tests/specs/npm/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out @@ -0,0 +1,4 @@ +this +is +a +test diff --git a/tests/specs/npm/deno_run_bin_no_ext/__test__.jsonc b/tests/specs/npm/deno_run_bin_no_ext/__test__.jsonc new file mode 100644 index 000000000..71877b399 --- /dev/null +++ b/tests/specs/npm/deno_run_bin_no_ext/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet npm:@denotest/bin/cli-no-ext this is a test", + "output": "deno_run_no_ext.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_run_bin_no_ext/deno_run_no_ext.out b/tests/specs/npm/deno_run_bin_no_ext/deno_run_no_ext.out new file mode 100644 index 000000000..ffe7cbd89 --- /dev/null +++ b/tests/specs/npm/deno_run_bin_no_ext/deno_run_no_ext.out @@ -0,0 +1,4 @@ +this +is +a +test diff --git a/tests/specs/npm/deno_run_bin_special_chars/__test__.jsonc b/tests/specs/npm/deno_run_bin_special_chars/__test__.jsonc new file mode 100644 index 000000000..c3e14c0b7 --- /dev/null +++ b/tests/specs/npm/deno_run_bin_special_chars/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet npm:@denotest/special-chars-in-bin-name/\\foo\" this is a test", + "output": "deno_run_special_chars_in_bin_name.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out b/tests/specs/npm/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out new file mode 100644 index 000000000..ffe7cbd89 --- /dev/null +++ b/tests/specs/npm/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out @@ -0,0 +1,4 @@ +this +is +a +test diff --git a/tests/specs/npm/deno_run_cowsay/__test__.jsonc b/tests/specs/npm/deno_run_cowsay/__test__.jsonc new file mode 100644 index 000000000..0015b88be --- /dev/null +++ b/tests/specs/npm/deno_run_cowsay/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet npm:cowsay@1.5.0 Hello", + "output": "deno_run_cowsay.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_run_cowsay/deno_run_cowsay.out b/tests/specs/npm/deno_run_cowsay/deno_run_cowsay.out new file mode 100644 index 000000000..46de82730 --- /dev/null +++ b/tests/specs/npm/deno_run_cowsay/deno_run_cowsay.out @@ -0,0 +1,8 @@ + _______ +< Hello > + ------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || diff --git a/tests/specs/npm/deno_run_cowsay_explicit/__test__.jsonc b/tests/specs/npm/deno_run_cowsay_explicit/__test__.jsonc new file mode 100644 index 000000000..1ecce925e --- /dev/null +++ b/tests/specs/npm/deno_run_cowsay_explicit/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet npm:cowsay@1.5.0/cowsay Hello", + "output": "deno_run_cowsay.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_run_cowsay_explicit/deno_run_cowsay.out b/tests/specs/npm/deno_run_cowsay_explicit/deno_run_cowsay.out new file mode 100644 index 000000000..46de82730 --- /dev/null +++ b/tests/specs/npm/deno_run_cowsay_explicit/deno_run_cowsay.out @@ -0,0 +1,8 @@ + _______ +< Hello > + ------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || diff --git a/tests/specs/npm/deno_run_cowsay_with_node_modules_dir/__test__.jsonc b/tests/specs/npm/deno_run_cowsay_with_node_modules_dir/__test__.jsonc new file mode 100644 index 000000000..d2c95f072 --- /dev/null +++ b/tests/specs/npm/deno_run_cowsay_with_node_modules_dir/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tempDir": true, + "args": "run -A --quiet --node-modules-dir npm:cowsay@1.5.0 Hello", + "output": "deno_run_cowsay.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out b/tests/specs/npm/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out new file mode 100644 index 000000000..46de82730 --- /dev/null +++ b/tests/specs/npm/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out @@ -0,0 +1,8 @@ + _______ +< Hello > + ------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || diff --git a/tests/specs/npm/deno_run_cowthink/__test__.jsonc b/tests/specs/npm/deno_run_cowthink/__test__.jsonc new file mode 100644 index 000000000..2acc84e7b --- /dev/null +++ b/tests/specs/npm/deno_run_cowthink/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet npm:cowsay@1.5.0/cowthink Hello", + "output": "deno_run_cowthink.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/deno_run_cowthink/deno_run_cowthink.out b/tests/specs/npm/deno_run_cowthink/deno_run_cowthink.out new file mode 100644 index 000000000..8dd990ed6 --- /dev/null +++ b/tests/specs/npm/deno_run_cowthink/deno_run_cowthink.out @@ -0,0 +1,8 @@ + _______ +( Hello ) + ------- + o ^__^ + o (oo)\_______ + (__)\ )\/\ + ||----w | + || || diff --git a/tests/specs/npm/deno_run_no_bin_entrypoint/__test__.jsonc b/tests/specs/npm/deno_run_no_bin_entrypoint/__test__.jsonc new file mode 100644 index 000000000..5331ec9c4 --- /dev/null +++ b/tests/specs/npm/deno_run_no_bin_entrypoint/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run -A --quiet npm:@denotest/esm-basic", + "output": "deno_run_no_bin_entrypoint.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out b/tests/specs/npm/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out new file mode 100644 index 000000000..2b885ed59 --- /dev/null +++ b/tests/specs/npm/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out @@ -0,0 +1 @@ +error: Failed resolving binary export. '[WILDCARD]@denotest[WILDCARD]esm-basic[WILDCARD]package.json' did not have a bin property diff --git a/tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc b/tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc new file mode 100644 index 000000000..3eaa8274c --- /dev/null +++ b/tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run -A --quiet npm:@denotest/esm-basic/non-existent.js", + "output": "deno_run_no_bin_entrypoint_non_existent_subpath.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out b/tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out new file mode 100644 index 000000000..525fe4b4f --- /dev/null +++ b/tests/specs/npm/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out @@ -0,0 +1,3 @@ +error: Failed resolving binary export. '[WILDCARD]@denotest[WILDCARD]esm-basic[WILDCARD]package.json' did not have a bin property + +Fallback failed: Cannot find module 'file:///[WILDCARD]/non-existent.js' diff --git a/tests/specs/npm/deno_run_non_existent/__test__.jsonc b/tests/specs/npm/deno_run_non_existent/__test__.jsonc new file mode 100644 index 000000000..72dc01450 --- /dev/null +++ b/tests/specs/npm/deno_run_non_existent/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run npm:mkdirp@0.5.125", + "output": "deno_run_non_existent.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/deno_run_non_existent/deno_run_non_existent.out b/tests/specs/npm/deno_run_non_existent/deno_run_non_existent.out new file mode 100644 index 000000000..247e650e6 --- /dev/null +++ b/tests/specs/npm/deno_run_non_existent/deno_run_non_existent.out @@ -0,0 +1,2 @@ +Download http://localhost:4260/mkdirp +error: Could not find npm package 'mkdirp' matching '0.5.125'. diff --git a/tests/specs/npm/different_nested_dep_node_modules_dir_false/__test__.jsonc b/tests/specs/npm/different_nested_dep_node_modules_dir_false/__test__.jsonc new file mode 100644 index 000000000..24587d928 --- /dev/null +++ b/tests/specs/npm/different_nested_dep_node_modules_dir_false/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run --quiet --no-lock --node-modules-dir=none different_nested_dep/main.js", + "output": "different_nested_dep/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 0 +} diff --git a/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js b/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js new file mode 100644 index 000000000..5677eb094 --- /dev/null +++ b/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js @@ -0,0 +1,5 @@ +import dep from "@denotest/different-nested-dep"; +import childDep from "@denotest/different-nested-dep-child"; + +console.log(dep); +console.log(childDep); diff --git a/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out b/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out new file mode 100644 index 000000000..1191247b6 --- /dev/null +++ b/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out @@ -0,0 +1,2 @@ +1 +2 diff --git a/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json b/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json new file mode 100644 index 000000000..c20425851 --- /dev/null +++ b/tests/specs/npm/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "@denotest/different-nested-dep": "1.0.0", + "@denotest/different-nested-dep-child": "2.0.0" + } +} diff --git a/tests/specs/npm/different_nested_dep_node_modules_dir_true/__test__.jsonc b/tests/specs/npm/different_nested_dep_node_modules_dir_true/__test__.jsonc new file mode 100644 index 000000000..a5c40cdd9 --- /dev/null +++ b/tests/specs/npm/different_nested_dep_node_modules_dir_true/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "args": "run --no-lock --quiet --node-modules-dir=auto different_nested_dep/main.js", + "output": "different_nested_dep/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 0 +} diff --git a/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js b/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js new file mode 100644 index 000000000..5677eb094 --- /dev/null +++ b/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js @@ -0,0 +1,5 @@ +import dep from "@denotest/different-nested-dep"; +import childDep from "@denotest/different-nested-dep-child"; + +console.log(dep); +console.log(childDep); diff --git a/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out b/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out new file mode 100644 index 000000000..1191247b6 --- /dev/null +++ b/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out @@ -0,0 +1,2 @@ +1 +2 diff --git a/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json b/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json new file mode 100644 index 000000000..c20425851 --- /dev/null +++ b/tests/specs/npm/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "@denotest/different-nested-dep": "1.0.0", + "@denotest/different-nested-dep-child": "2.0.0" + } +} diff --git a/tests/specs/npm/directory_import_folder_index_js/__test__.jsonc b/tests/specs/npm/directory_import_folder_index_js/__test__.jsonc new file mode 100644 index 000000000..8eb6226d6 --- /dev/null +++ b/tests/specs/npm/directory_import_folder_index_js/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run directory_import/folder_index_js.ts", + "output": "directory_import/folder_index_js.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out new file mode 100644 index 000000000..a700b8fdb --- /dev/null +++ b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.out @@ -0,0 +1,7 @@ +Download http://localhost:4260/@denotest/sub-folders +Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz +error: Directory import [WILDCARD]folder_index_js is not supported resolving import from file:///[WILDCARD]/directory_import/folder_index_js.ts +Did you mean to import index.js within the directory? + +Caused by: + [WILDCARD] diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.ts b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.ts new file mode 100644 index 000000000..b0d51fcd9 --- /dev/null +++ b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_index_js.ts @@ -0,0 +1,2 @@ +import test from "npm:@denotest/sub-folders/folder_index_js"; +console.log(test); diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out new file mode 100644 index 000000000..844419b4c --- /dev/null +++ b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.out @@ -0,0 +1,6 @@ +Download http://localhost:4260/@denotest/sub-folders +Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz +error: Directory import [WILDCARD]folder_no_index is not supported resolving import from file:///[WILDCARD]/folder_no_index.ts + +Caused by: + [WILDCARD] diff --git a/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.ts b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.ts new file mode 100644 index 000000000..4c5fb7ec0 --- /dev/null +++ b/tests/specs/npm/directory_import_folder_index_js/directory_import/folder_no_index.ts @@ -0,0 +1,2 @@ +import test from "npm:@denotest/sub-folders/folder_no_index"; +console.log(test); diff --git a/tests/specs/npm/directory_import_folder_no_index/__test__.jsonc b/tests/specs/npm/directory_import_folder_no_index/__test__.jsonc new file mode 100644 index 000000000..613747998 --- /dev/null +++ b/tests/specs/npm/directory_import_folder_no_index/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run directory_import/folder_no_index.ts", + "output": "directory_import/folder_no_index.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out new file mode 100644 index 000000000..a700b8fdb --- /dev/null +++ b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.out @@ -0,0 +1,7 @@ +Download http://localhost:4260/@denotest/sub-folders +Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz +error: Directory import [WILDCARD]folder_index_js is not supported resolving import from file:///[WILDCARD]/directory_import/folder_index_js.ts +Did you mean to import index.js within the directory? + +Caused by: + [WILDCARD] diff --git a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.ts b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.ts new file mode 100644 index 000000000..b0d51fcd9 --- /dev/null +++ b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_index_js.ts @@ -0,0 +1,2 @@ +import test from "npm:@denotest/sub-folders/folder_index_js"; +console.log(test); diff --git a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out new file mode 100644 index 000000000..844419b4c --- /dev/null +++ b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.out @@ -0,0 +1,6 @@ +Download http://localhost:4260/@denotest/sub-folders +Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz +error: Directory import [WILDCARD]folder_no_index is not supported resolving import from file:///[WILDCARD]/folder_no_index.ts + +Caused by: + [WILDCARD] diff --git a/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.ts b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.ts new file mode 100644 index 000000000..4c5fb7ec0 --- /dev/null +++ b/tests/specs/npm/directory_import_folder_no_index/directory_import/folder_no_index.ts @@ -0,0 +1,2 @@ +import test from "npm:@denotest/sub-folders/folder_no_index"; +console.log(test); diff --git a/tests/specs/npm/dual_cjs_esm/__test__.jsonc b/tests/specs/npm/dual_cjs_esm/__test__.jsonc new file mode 100644 index 000000000..5ace51cec --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet dual_cjs_esm/main.ts", + "output": "dual_cjs_esm/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.out b/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.out new file mode 100644 index 000000000..32e232f11 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.out @@ -0,0 +1,3 @@ +esm +cjs +cjs diff --git a/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.ts b/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.ts new file mode 100644 index 000000000..4f3b79667 --- /dev/null +++ b/tests/specs/npm/dual_cjs_esm/dual_cjs_esm/main.ts @@ -0,0 +1,6 @@ +import { getKind } from "npm:@denotest/dual-cjs-esm@latest"; // test out @latest dist tag +import * as cjs from "npm:@denotest/dual-cjs-esm@latest/cjs/main.cjs"; + +console.log(getKind()); +console.log(cjs.getKind()); +console.log(cjs.getSubPathKind()); diff --git a/tests/specs/npm/dynamic_import_deno_ts_from_npm/__test__.jsonc b/tests/specs/npm/dynamic_import_deno_ts_from_npm/__test__.jsonc new file mode 100644 index 000000000..8dbee51c7 --- /dev/null +++ b/tests/specs/npm/dynamic_import_deno_ts_from_npm/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read --quiet dynamic_import_deno_ts_from_npm/main.ts", + "output": "dynamic_import_deno_ts_from_npm/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts new file mode 100644 index 000000000..3b399665d --- /dev/null +++ b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number) { + return a + b; +} diff --git a/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out new file mode 100644 index 000000000..81d7aba8a --- /dev/null +++ b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out @@ -0,0 +1,2 @@ +3 +-1 diff --git a/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts new file mode 100644 index 000000000..4d5deec48 --- /dev/null +++ b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts @@ -0,0 +1,8 @@ +import { dynamicImport } from "npm:@denotest/dynamic-import"; + +const { add } = await dynamicImport(new URL("./add.ts", import.meta.url)); +console.log(add(1, 2)); +const { subtract } = await dynamicImport( + new URL("./subtract.mts", import.meta.url), +); +console.log(subtract(1, 2)); diff --git a/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts new file mode 100644 index 000000000..4bf634170 --- /dev/null +++ b/tests/specs/npm/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts @@ -0,0 +1,3 @@ +export function subtract(a: number, b: number) { + return a - b; +} diff --git a/tests/specs/npm/dynamic_import_invalid_package_name/__test__.jsonc b/tests/specs/npm/dynamic_import_invalid_package_name/__test__.jsonc new file mode 100644 index 000000000..a15cabf83 --- /dev/null +++ b/tests/specs/npm/dynamic_import_invalid_package_name/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --reload dynamic_import_invalid_package_name/main.ts", + "output": "dynamic_import_invalid_package_name/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out b/tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out new file mode 100644 index 000000000..414d08795 --- /dev/null +++ b/tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out @@ -0,0 +1,6 @@ +Download http://localhost:4260/ws%3A +FAILED +TypeError: npm package 'ws:' does not exist. + at async file:///[WILDCARD]/dynamic_import_invalid_package_name/main.ts:2:3 { + code: "ERR_MODULE_NOT_FOUND" +} diff --git a/tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts b/tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts new file mode 100644 index 000000000..368ccc282 --- /dev/null +++ b/tests/specs/npm/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts @@ -0,0 +1,6 @@ +try { + await import(`npm:${"ws:"}`); +} catch (err) { + console.log("FAILED"); + console.log(err); +} diff --git a/tests/specs/npm/dynamic_import_json/__test__.jsonc b/tests/specs/npm/dynamic_import_json/__test__.jsonc new file mode 100644 index 000000000..9b4f5a212 --- /dev/null +++ b/tests/specs/npm/dynamic_import_json/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet import_json/main.js", + "output": "import_json/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/dynamic_import_json/import_json/main.js b/tests/specs/npm/dynamic_import_json/import_json/main.js new file mode 100644 index 000000000..ac6cee9a8 --- /dev/null +++ b/tests/specs/npm/dynamic_import_json/import_json/main.js @@ -0,0 +1,4 @@ +import json from "npm:@denotest/binary-package@1/package.json" with { + type: "json", +}; +console.log(json); diff --git a/tests/specs/npm/dynamic_import_json/import_json/main.out b/tests/specs/npm/dynamic_import_json/import_json/main.out new file mode 100644 index 000000000..7db7ec4ea --- /dev/null +++ b/tests/specs/npm/dynamic_import_json/import_json/main.out @@ -0,0 +1,10 @@ +{ + name: "@denotest/binary-package", + version: "1.0.0", + main: "index.js", + optionalDependencies: { + "@denotest/binary-package-linux": "1.0.0", + "@denotest/binary-package-mac": "1.0.0", + "@denotest/binary-package-windows": "1.0.0" + } +} diff --git a/tests/specs/npm/dynamic_import_reload_same_package/__test__.jsonc b/tests/specs/npm/dynamic_import_reload_same_package/__test__.jsonc new file mode 100644 index 000000000..d255b9a87 --- /dev/null +++ b/tests/specs/npm/dynamic_import_reload_same_package/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --reload dynamic_import_reload_same_package/main.ts", + "output": "dynamic_import_reload_same_package/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out b/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out new file mode 100644 index 000000000..b2f99b465 --- /dev/null +++ b/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out @@ -0,0 +1,5 @@ +Download http://localhost:4260/chalk +Download http://localhost:4260/chalk/chalk-5.0.1.tgz +Starting... +Ran other. +Finished... diff --git a/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts b/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts new file mode 100644 index 000000000..7c7ee7d55 --- /dev/null +++ b/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts @@ -0,0 +1,7 @@ +import chalk from "npm:chalk@5"; + +console.log(chalk.green("Starting...")); +// non-analyzable +const importName = "./other.ts"; +await import(importName); +console.log(chalk.green("Finished...")); diff --git a/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts b/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts new file mode 100644 index 000000000..28e3da14f --- /dev/null +++ b/tests/specs/npm/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts @@ -0,0 +1,3 @@ +import chalk from "npm:chalk@5"; + +console.log(chalk.green("Ran other.")); diff --git a/tests/specs/npm/env_var_re_export_dev/__test__.jsonc b/tests/specs/npm/env_var_re_export_dev/__test__.jsonc new file mode 100644 index 000000000..e65ae0308 --- /dev/null +++ b/tests/specs/npm/env_var_re_export_dev/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read --allow-env --quiet env_var_re_export/main.js", + "output": "dev\n", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/env_var_re_export_dev/env_var_re_export/main.js b/tests/specs/npm/env_var_re_export_dev/env_var_re_export/main.js new file mode 100644 index 000000000..ed91487a0 --- /dev/null +++ b/tests/specs/npm/env_var_re_export_dev/env_var_re_export/main.js @@ -0,0 +1,3 @@ +import { getEnv } from "npm:@denotest/env-var-re-export"; + +console.log(getEnv()); diff --git a/tests/specs/npm/env_var_re_export_prod/__test__.jsonc b/tests/specs/npm/env_var_re_export_prod/__test__.jsonc new file mode 100644 index 000000000..6c206ba3e --- /dev/null +++ b/tests/specs/npm/env_var_re_export_prod/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run --allow-read --allow-env --quiet env_var_re_export/main.js", + "output": "prod\n", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/", + "NODE_ENV": "production" + } +} diff --git a/tests/specs/npm/env_var_re_export_prod/env_var_re_export/main.js b/tests/specs/npm/env_var_re_export_prod/env_var_re_export/main.js new file mode 100644 index 000000000..ed91487a0 --- /dev/null +++ b/tests/specs/npm/env_var_re_export_prod/env_var_re_export/main.js @@ -0,0 +1,3 @@ +import { getEnv } from "npm:@denotest/env-var-re-export"; + +console.log(getEnv()); diff --git a/tests/specs/npm/error_version_after_subpath/__test__.jsonc b/tests/specs/npm/error_version_after_subpath/__test__.jsonc new file mode 100644 index 000000000..157e238d8 --- /dev/null +++ b/tests/specs/npm/error_version_after_subpath/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run -A --quiet error_version_after_subpath/main.js", + "output": "error_version_after_subpath/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.js b/tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.js new file mode 100644 index 000000000..77c7a017c --- /dev/null +++ b/tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.js @@ -0,0 +1 @@ +import "npm:react-dom/server@18.2.0"; diff --git a/tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.out b/tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.out new file mode 100644 index 000000000..4e5f03e23 --- /dev/null +++ b/tests/specs/npm/error_version_after_subpath/error_version_after_subpath/main.out @@ -0,0 +1,2 @@ +error: Invalid package specifier 'npm:react-dom/server@18.2.0'. Did you mean to write 'npm:react-dom@18.2.0/server'? + at [WILDCARD]/error_version_after_subpath/main.js:1:8 diff --git a/tests/specs/npm/import_json/__test__.jsonc b/tests/specs/npm/import_json/__test__.jsonc new file mode 100644 index 000000000..9b4f5a212 --- /dev/null +++ b/tests/specs/npm/import_json/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet import_json/main.js", + "output": "import_json/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/import_json/import_json/main.js b/tests/specs/npm/import_json/import_json/main.js new file mode 100644 index 000000000..ac6cee9a8 --- /dev/null +++ b/tests/specs/npm/import_json/import_json/main.js @@ -0,0 +1,4 @@ +import json from "npm:@denotest/binary-package@1/package.json" with { + type: "json", +}; +console.log(json); diff --git a/tests/specs/npm/import_json/import_json/main.out b/tests/specs/npm/import_json/import_json/main.out new file mode 100644 index 000000000..7db7ec4ea --- /dev/null +++ b/tests/specs/npm/import_json/import_json/main.out @@ -0,0 +1,10 @@ +{ + name: "@denotest/binary-package", + version: "1.0.0", + main: "index.js", + optionalDependencies: { + "@denotest/binary-package-linux": "1.0.0", + "@denotest/binary-package-mac": "1.0.0", + "@denotest/binary-package-windows": "1.0.0" + } +} diff --git a/tests/specs/npm/import_map/__test__.jsonc b/tests/specs/npm/import_map/__test__.jsonc new file mode 100644 index 000000000..822acbbe4 --- /dev/null +++ b/tests/specs/npm/import_map/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read --allow-env --import-map import_map/import_map.json import_map/main.js", + "output": "import_map/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/import_map/import_map/import_map.json b/tests/specs/npm/import_map/import_map/import_map.json new file mode 100644 index 000000000..1c3baacd1 --- /dev/null +++ b/tests/specs/npm/import_map/import_map/import_map.json @@ -0,0 +1,6 @@ +{ + "imports": { + "chalk": "npm:chalk@5", + "@denotest/": "npm:/@denotest/dual-cjs-esm/" + } +} diff --git a/tests/specs/npm/import_map/import_map/main.js b/tests/specs/npm/import_map/import_map/main.js new file mode 100644 index 000000000..e354b7e92 --- /dev/null +++ b/tests/specs/npm/import_map/import_map/main.js @@ -0,0 +1,10 @@ +import chalk from "chalk"; +import { getSubPathKind } from "@denotest/subpath/main.mjs"; + +console.log(chalk.green("chalk import map loads")); + +export function test(value) { + return chalk.red(value); +} + +console.log(getSubPathKind()); diff --git a/tests/specs/npm/import_map/import_map/main.out b/tests/specs/npm/import_map/import_map/main.out new file mode 100644 index 000000000..05f313d4e --- /dev/null +++ b/tests/specs/npm/import_map/import_map/main.out @@ -0,0 +1,10 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/@denotest/dual-cjs-esm +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz +Download http://localhost:4260/chalk/chalk-5.0.1.tgz +[UNORDERED_END] +chalk import map loads +esm diff --git a/tests/specs/npm/imports_package_json/__test__.jsonc b/tests/specs/npm/imports_package_json/__test__.jsonc new file mode 100644 index 000000000..e11b92132 --- /dev/null +++ b/tests/specs/npm/imports_package_json/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --no-lock --node-modules-dir=none imports_package_json/main.js", + "output": "imports_package_json/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.js b/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.js new file mode 100644 index 000000000..dc4d2df16 --- /dev/null +++ b/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.js @@ -0,0 +1,3 @@ +import data from "@denotest/imports-package-json/import-not-defined"; + +console.log(data); diff --git a/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out new file mode 100644 index 000000000..70d1145a3 --- /dev/null +++ b/tests/specs/npm/imports_package_json/imports_package_json/import_not_defined.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz +error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json/imports_package_json/main.js b/tests/specs/npm/imports_package_json/imports_package_json/main.js new file mode 100644 index 000000000..53090dd94 --- /dev/null +++ b/tests/specs/npm/imports_package_json/imports_package_json/main.js @@ -0,0 +1,7 @@ +import data from "@denotest/imports-package-json"; + +console.log(data.hi); +console.log(data.bye); +console.log(typeof data.fs.readFile); +console.log(typeof data.path.join); +console.log(typeof data.fs2.writeFile); diff --git a/tests/specs/npm/imports_package_json/imports_package_json/main.out b/tests/specs/npm/imports_package_json/imports_package_json/main.out new file mode 100644 index 000000000..979e35576 --- /dev/null +++ b/tests/specs/npm/imports_package_json/imports_package_json/main.out @@ -0,0 +1,7 @@ +Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz +hi +bye +function +function +function diff --git a/tests/specs/npm/imports_package_json/imports_package_json/package.json b/tests/specs/npm/imports_package_json/imports_package_json/package.json new file mode 100644 index 000000000..cb6a08d1a --- /dev/null +++ b/tests/specs/npm/imports_package_json/imports_package_json/package.json @@ -0,0 +1,6 @@ +{ + "name": "my-test", + "dependencies": { + "@denotest/imports-package-json": "1.0.0" + } +} diff --git a/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.js new file mode 100644 index 000000000..f1097aa06 --- /dev/null +++ b/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.js @@ -0,0 +1,3 @@ +import data from "@denotest/imports-package-json/sub-path-import-not-defined"; + +console.log(data); diff --git a/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out new file mode 100644 index 000000000..7c803f2bf --- /dev/null +++ b/tests/specs/npm/imports_package_json/imports_package_json/sub_path_import_not_defined.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz +error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_import_not_defined/__test__.jsonc b/tests/specs/npm/imports_package_json_import_not_defined/__test__.jsonc new file mode 100644 index 000000000..0f094838c --- /dev/null +++ b/tests/specs/npm/imports_package_json_import_not_defined/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run --no-lock --node-modules-dir=none imports_package_json/import_not_defined.js", + "output": "imports_package_json/import_not_defined.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js new file mode 100644 index 000000000..dc4d2df16 --- /dev/null +++ b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js @@ -0,0 +1,3 @@ +import data from "@denotest/imports-package-json/import-not-defined"; + +console.log(data); diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out new file mode 100644 index 000000000..70d1145a3 --- /dev/null +++ b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz +error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.js b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.js new file mode 100644 index 000000000..53090dd94 --- /dev/null +++ b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.js @@ -0,0 +1,7 @@ +import data from "@denotest/imports-package-json"; + +console.log(data.hi); +console.log(data.bye); +console.log(typeof data.fs.readFile); +console.log(typeof data.path.join); +console.log(typeof data.fs2.writeFile); diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out new file mode 100644 index 000000000..979e35576 --- /dev/null +++ b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/main.out @@ -0,0 +1,7 @@ +Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz +hi +bye +function +function +function diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/package.json b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/package.json new file mode 100644 index 000000000..cb6a08d1a --- /dev/null +++ b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/package.json @@ -0,0 +1,6 @@ +{ + "name": "my-test", + "dependencies": { + "@denotest/imports-package-json": "1.0.0" + } +} diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js new file mode 100644 index 000000000..f1097aa06 --- /dev/null +++ b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js @@ -0,0 +1,3 @@ +import data from "@denotest/imports-package-json/sub-path-import-not-defined"; + +console.log(data); diff --git a/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out new file mode 100644 index 000000000..7c803f2bf --- /dev/null +++ b/tests/specs/npm/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz +error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/__test__.jsonc b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/__test__.jsonc new file mode 100644 index 000000000..f862dc58e --- /dev/null +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run --no-lock --node-modules-dir=none imports_package_json/sub_path_import_not_defined.js", + "output": "imports_package_json/sub_path_import_not_defined.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js new file mode 100644 index 000000000..dc4d2df16 --- /dev/null +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js @@ -0,0 +1,3 @@ +import data from "@denotest/imports-package-json/import-not-defined"; + +console.log(data); diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out new file mode 100644 index 000000000..70d1145a3 --- /dev/null +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz +error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js new file mode 100644 index 000000000..53090dd94 --- /dev/null +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js @@ -0,0 +1,7 @@ +import data from "@denotest/imports-package-json"; + +console.log(data.hi); +console.log(data.bye); +console.log(typeof data.fs.readFile); +console.log(typeof data.path.join); +console.log(typeof data.fs2.writeFile); diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out new file mode 100644 index 000000000..979e35576 --- /dev/null +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out @@ -0,0 +1,7 @@ +Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz +hi +bye +function +function +function diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json new file mode 100644 index 000000000..cb6a08d1a --- /dev/null +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json @@ -0,0 +1,6 @@ +{ + "name": "my-test", + "dependencies": { + "@denotest/imports-package-json": "1.0.0" + } +} diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js new file mode 100644 index 000000000..f1097aa06 --- /dev/null +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js @@ -0,0 +1,3 @@ +import data from "@denotest/imports-package-json/sub-path-import-not-defined"; + +console.log(data); diff --git a/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out new file mode 100644 index 000000000..7c803f2bf --- /dev/null +++ b/tests/specs/npm/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/imports-package-json +Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz +error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm/info_chalk_display/__test__.jsonc b/tests/specs/npm/info_chalk_display/__test__.jsonc new file mode 100644 index 000000000..998aa6f1d --- /dev/null +++ b/tests/specs/npm/info_chalk_display/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "info --quiet cjs_with_deps/main.js", + "output": "cjs_with_deps/main_info.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/info_chalk_display/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_display/cjs_with_deps/main.js new file mode 100644 index 000000000..568726874 --- /dev/null +++ b/tests/specs/npm/info_chalk_display/cjs_with_deps/main.js @@ -0,0 +1,12 @@ +import chalk from "npm:chalk@4"; +import { expect } from "npm:chai@4.3"; + +console.log(chalk.green("chalk cjs loads")); + +const timeout = setTimeout(() => {}, 0); +expect(timeout).to.be.a("number"); +clearTimeout(timeout); + +const interval = setInterval(() => {}, 100); +expect(interval).to.be.a("number"); +clearInterval(interval); diff --git a/tests/specs/npm/info_chalk_display/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main.out new file mode 100644 index 000000000..7051c2395 --- /dev/null +++ b/tests/specs/npm/info_chalk_display/cjs_with_deps/main.out @@ -0,0 +1,33 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Download http://localhost:4260/chai/chai-4.3.6.tgz +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info.out new file mode 100644 index 000000000..8e37c88eb --- /dev/null +++ b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info.out @@ -0,0 +1,22 @@ +local: [WILDCARD]main.js +type: JavaScript +dependencies: 14 unique +size: [WILDCARD] + +file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) +├─┬ npm:/chalk@4.1.2 ([WILDCARD]) +│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) +│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) +│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) +│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) +│ └── npm:/has-flag@4.0.0 ([WILDCARD]) +└─┬ npm:/chai@4.3.6 ([WILDCARD]) + ├── npm:/assertion-error@1.1.0 ([WILDCARD]) + ├── npm:/check-error@1.0.2 ([WILDCARD]) + ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) + │ └── npm:/type-detect@4.0.8 ([WILDCARD]) + ├── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) + │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├── npm:/pathval@1.1.1 ([WILDCARD]) + └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info_json.out new file mode 100644 index 000000000..af1ef1351 --- /dev/null +++ b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_info_json.out @@ -0,0 +1,148 @@ +{ + "roots": [ + "file://[WILDCARD]/main.js" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "npm:chalk@4", + "code": { + "specifier": "npm:chalk@4", + "span": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 31 + } + } + }, + "npmPackage": "chalk@4.1.2" + }, + { + "specifier": "npm:chai@4.3", + "code": { + "specifier": "npm:chai@4.3", + "span": { + "start": { + "line": 1, + "character": 23 + }, + "end": { + "line": 1, + "character": 37 + } + } + }, + "npmPackage": "chai@4.3.6" + } + ], + "local": "[WILDCARD]main.js", + "size": 325, + "mediaType": "JavaScript", + "specifier": "[WILDCARD]/main.js" + } + ], + "redirects": { + "npm:chai@4.3": "npm:/chai@4.3.6", + "npm:chalk@4": "npm:/chalk@4.1.2" + }, + "version": 1, + "npmPackages": { + "ansi-styles@4.3.0": { + "name": "ansi-styles", + "version": "4.3.0", + "dependencies": [ + "color-convert@2.0.1" + ] + }, + "assertion-error@1.1.0": { + "name": "assertion-error", + "version": "1.1.0", + "dependencies": [] + }, + "chai@4.3.6": { + "name": "chai", + "version": "4.3.6", + "dependencies": [ + "assertion-error@1.1.0", + "check-error@1.0.2", + "deep-eql@3.0.1", + "get-func-name@2.0.0", + "loupe@2.3.4", + "pathval@1.1.1", + "type-detect@4.0.8" + ] + }, + "chalk@4.1.2": { + "name": "chalk", + "version": "4.1.2", + "dependencies": [ + "ansi-styles@4.3.0", + "supports-color@7.2.0" + ] + }, + "check-error@1.0.2": { + "name": "check-error", + "version": "1.0.2", + "dependencies": [] + }, + "color-convert@2.0.1": { + "name": "color-convert", + "version": "2.0.1", + "dependencies": [ + "color-name@1.1.4" + ] + }, + "color-name@1.1.4": { + "name": "color-name", + "version": "1.1.4", + "dependencies": [] + }, + "deep-eql@3.0.1": { + "name": "deep-eql", + "version": "3.0.1", + "dependencies": [ + "type-detect@4.0.8" + ] + }, + "get-func-name@2.0.0": { + "name": "get-func-name", + "version": "2.0.0", + "dependencies": [] + }, + "has-flag@4.0.0": { + "name": "has-flag", + "version": "4.0.0", + "dependencies": [] + }, + "loupe@2.3.4": { + "name": "loupe", + "version": "2.3.4", + "dependencies": [ + "get-func-name@2.0.0" + ] + }, + "pathval@1.1.1": { + "name": "pathval", + "version": "1.1.1", + "dependencies": [] + }, + "supports-color@7.2.0": { + "name": "supports-color", + "version": "7.2.0", + "dependencies": [ + "has-flag@4.0.0" + ] + }, + "type-detect@4.0.8": { + "name": "type-detect", + "version": "4.0.8", + "dependencies": [] + } + } +} diff --git a/tests/specs/npm/info_chalk_display/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_node_modules.out new file mode 100644 index 000000000..1ab367952 --- /dev/null +++ b/tests/specs/npm/info_chalk_display/cjs_with_deps/main_node_modules.out @@ -0,0 +1,47 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Initialize ansi-styles@4.3.0 +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Initialize assertion-error@1.1.0 +Download http://localhost:4260/chai/chai-4.3.6.tgz +Initialize chai@4.3.6 +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Initialize chalk@4.1.2 +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Initialize check-error@1.0.2 +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Initialize color-convert@2.0.1 +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Initialize color-name@1.1.4 +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Initialize deep-eql@3.0.1 +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Initialize get-func-name@2.0.0 +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Initialize has-flag@4.0.0 +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Initialize loupe@2.3.4 +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Initialize pathval@1.1.1 +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Initialize supports-color@7.2.0 +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +Initialize type-detect@4.0.8 +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc b/tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc new file mode 100644 index 000000000..1e6ef8284 --- /dev/null +++ b/tests/specs/npm/info_chalk_display_node_modules_dir/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "args": "info --quiet --node-modules-dir cjs_with_deps/main.js", + "output": "cjs_with_deps/main_info.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.js new file mode 100644 index 000000000..568726874 --- /dev/null +++ b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.js @@ -0,0 +1,12 @@ +import chalk from "npm:chalk@4"; +import { expect } from "npm:chai@4.3"; + +console.log(chalk.green("chalk cjs loads")); + +const timeout = setTimeout(() => {}, 0); +expect(timeout).to.be.a("number"); +clearTimeout(timeout); + +const interval = setInterval(() => {}, 100); +expect(interval).to.be.a("number"); +clearInterval(interval); diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.out new file mode 100644 index 000000000..7051c2395 --- /dev/null +++ b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main.out @@ -0,0 +1,33 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Download http://localhost:4260/chai/chai-4.3.6.tgz +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out new file mode 100644 index 000000000..8e37c88eb --- /dev/null +++ b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out @@ -0,0 +1,22 @@ +local: [WILDCARD]main.js +type: JavaScript +dependencies: 14 unique +size: [WILDCARD] + +file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) +├─┬ npm:/chalk@4.1.2 ([WILDCARD]) +│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) +│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) +│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) +│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) +│ └── npm:/has-flag@4.0.0 ([WILDCARD]) +└─┬ npm:/chai@4.3.6 ([WILDCARD]) + ├── npm:/assertion-error@1.1.0 ([WILDCARD]) + ├── npm:/check-error@1.0.2 ([WILDCARD]) + ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) + │ └── npm:/type-detect@4.0.8 ([WILDCARD]) + ├── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) + │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├── npm:/pathval@1.1.1 ([WILDCARD]) + └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out new file mode 100644 index 000000000..af1ef1351 --- /dev/null +++ b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out @@ -0,0 +1,148 @@ +{ + "roots": [ + "file://[WILDCARD]/main.js" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "npm:chalk@4", + "code": { + "specifier": "npm:chalk@4", + "span": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 31 + } + } + }, + "npmPackage": "chalk@4.1.2" + }, + { + "specifier": "npm:chai@4.3", + "code": { + "specifier": "npm:chai@4.3", + "span": { + "start": { + "line": 1, + "character": 23 + }, + "end": { + "line": 1, + "character": 37 + } + } + }, + "npmPackage": "chai@4.3.6" + } + ], + "local": "[WILDCARD]main.js", + "size": 325, + "mediaType": "JavaScript", + "specifier": "[WILDCARD]/main.js" + } + ], + "redirects": { + "npm:chai@4.3": "npm:/chai@4.3.6", + "npm:chalk@4": "npm:/chalk@4.1.2" + }, + "version": 1, + "npmPackages": { + "ansi-styles@4.3.0": { + "name": "ansi-styles", + "version": "4.3.0", + "dependencies": [ + "color-convert@2.0.1" + ] + }, + "assertion-error@1.1.0": { + "name": "assertion-error", + "version": "1.1.0", + "dependencies": [] + }, + "chai@4.3.6": { + "name": "chai", + "version": "4.3.6", + "dependencies": [ + "assertion-error@1.1.0", + "check-error@1.0.2", + "deep-eql@3.0.1", + "get-func-name@2.0.0", + "loupe@2.3.4", + "pathval@1.1.1", + "type-detect@4.0.8" + ] + }, + "chalk@4.1.2": { + "name": "chalk", + "version": "4.1.2", + "dependencies": [ + "ansi-styles@4.3.0", + "supports-color@7.2.0" + ] + }, + "check-error@1.0.2": { + "name": "check-error", + "version": "1.0.2", + "dependencies": [] + }, + "color-convert@2.0.1": { + "name": "color-convert", + "version": "2.0.1", + "dependencies": [ + "color-name@1.1.4" + ] + }, + "color-name@1.1.4": { + "name": "color-name", + "version": "1.1.4", + "dependencies": [] + }, + "deep-eql@3.0.1": { + "name": "deep-eql", + "version": "3.0.1", + "dependencies": [ + "type-detect@4.0.8" + ] + }, + "get-func-name@2.0.0": { + "name": "get-func-name", + "version": "2.0.0", + "dependencies": [] + }, + "has-flag@4.0.0": { + "name": "has-flag", + "version": "4.0.0", + "dependencies": [] + }, + "loupe@2.3.4": { + "name": "loupe", + "version": "2.3.4", + "dependencies": [ + "get-func-name@2.0.0" + ] + }, + "pathval@1.1.1": { + "name": "pathval", + "version": "1.1.1", + "dependencies": [] + }, + "supports-color@7.2.0": { + "name": "supports-color", + "version": "7.2.0", + "dependencies": [ + "has-flag@4.0.0" + ] + }, + "type-detect@4.0.8": { + "name": "type-detect", + "version": "4.0.8", + "dependencies": [] + } + } +} diff --git a/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out new file mode 100644 index 000000000..1ab367952 --- /dev/null +++ b/tests/specs/npm/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out @@ -0,0 +1,47 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Initialize ansi-styles@4.3.0 +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Initialize assertion-error@1.1.0 +Download http://localhost:4260/chai/chai-4.3.6.tgz +Initialize chai@4.3.6 +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Initialize chalk@4.1.2 +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Initialize check-error@1.0.2 +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Initialize color-convert@2.0.1 +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Initialize color-name@1.1.4 +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Initialize deep-eql@3.0.1 +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Initialize get-func-name@2.0.0 +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Initialize has-flag@4.0.0 +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Initialize loupe@2.3.4 +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Initialize pathval@1.1.1 +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Initialize supports-color@7.2.0 +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +Initialize type-detect@4.0.8 +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/info_chalk_json/__test__.jsonc b/tests/specs/npm/info_chalk_json/__test__.jsonc new file mode 100644 index 000000000..12c8b9b61 --- /dev/null +++ b/tests/specs/npm/info_chalk_json/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "info --quiet --json cjs_with_deps/main.js", + "output": "cjs_with_deps/main_info_json.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_json/cjs_with_deps/main.js new file mode 100644 index 000000000..568726874 --- /dev/null +++ b/tests/specs/npm/info_chalk_json/cjs_with_deps/main.js @@ -0,0 +1,12 @@ +import chalk from "npm:chalk@4"; +import { expect } from "npm:chai@4.3"; + +console.log(chalk.green("chalk cjs loads")); + +const timeout = setTimeout(() => {}, 0); +expect(timeout).to.be.a("number"); +clearTimeout(timeout); + +const interval = setInterval(() => {}, 100); +expect(interval).to.be.a("number"); +clearInterval(interval); diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main.out new file mode 100644 index 000000000..7051c2395 --- /dev/null +++ b/tests/specs/npm/info_chalk_json/cjs_with_deps/main.out @@ -0,0 +1,33 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Download http://localhost:4260/chai/chai-4.3.6.tgz +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info.out new file mode 100644 index 000000000..8e37c88eb --- /dev/null +++ b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info.out @@ -0,0 +1,22 @@ +local: [WILDCARD]main.js +type: JavaScript +dependencies: 14 unique +size: [WILDCARD] + +file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) +├─┬ npm:/chalk@4.1.2 ([WILDCARD]) +│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) +│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) +│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) +│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) +│ └── npm:/has-flag@4.0.0 ([WILDCARD]) +└─┬ npm:/chai@4.3.6 ([WILDCARD]) + ├── npm:/assertion-error@1.1.0 ([WILDCARD]) + ├── npm:/check-error@1.0.2 ([WILDCARD]) + ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) + │ └── npm:/type-detect@4.0.8 ([WILDCARD]) + ├── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) + │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├── npm:/pathval@1.1.1 ([WILDCARD]) + └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out new file mode 100644 index 000000000..af1ef1351 --- /dev/null +++ b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_info_json.out @@ -0,0 +1,148 @@ +{ + "roots": [ + "file://[WILDCARD]/main.js" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "npm:chalk@4", + "code": { + "specifier": "npm:chalk@4", + "span": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 31 + } + } + }, + "npmPackage": "chalk@4.1.2" + }, + { + "specifier": "npm:chai@4.3", + "code": { + "specifier": "npm:chai@4.3", + "span": { + "start": { + "line": 1, + "character": 23 + }, + "end": { + "line": 1, + "character": 37 + } + } + }, + "npmPackage": "chai@4.3.6" + } + ], + "local": "[WILDCARD]main.js", + "size": 325, + "mediaType": "JavaScript", + "specifier": "[WILDCARD]/main.js" + } + ], + "redirects": { + "npm:chai@4.3": "npm:/chai@4.3.6", + "npm:chalk@4": "npm:/chalk@4.1.2" + }, + "version": 1, + "npmPackages": { + "ansi-styles@4.3.0": { + "name": "ansi-styles", + "version": "4.3.0", + "dependencies": [ + "color-convert@2.0.1" + ] + }, + "assertion-error@1.1.0": { + "name": "assertion-error", + "version": "1.1.0", + "dependencies": [] + }, + "chai@4.3.6": { + "name": "chai", + "version": "4.3.6", + "dependencies": [ + "assertion-error@1.1.0", + "check-error@1.0.2", + "deep-eql@3.0.1", + "get-func-name@2.0.0", + "loupe@2.3.4", + "pathval@1.1.1", + "type-detect@4.0.8" + ] + }, + "chalk@4.1.2": { + "name": "chalk", + "version": "4.1.2", + "dependencies": [ + "ansi-styles@4.3.0", + "supports-color@7.2.0" + ] + }, + "check-error@1.0.2": { + "name": "check-error", + "version": "1.0.2", + "dependencies": [] + }, + "color-convert@2.0.1": { + "name": "color-convert", + "version": "2.0.1", + "dependencies": [ + "color-name@1.1.4" + ] + }, + "color-name@1.1.4": { + "name": "color-name", + "version": "1.1.4", + "dependencies": [] + }, + "deep-eql@3.0.1": { + "name": "deep-eql", + "version": "3.0.1", + "dependencies": [ + "type-detect@4.0.8" + ] + }, + "get-func-name@2.0.0": { + "name": "get-func-name", + "version": "2.0.0", + "dependencies": [] + }, + "has-flag@4.0.0": { + "name": "has-flag", + "version": "4.0.0", + "dependencies": [] + }, + "loupe@2.3.4": { + "name": "loupe", + "version": "2.3.4", + "dependencies": [ + "get-func-name@2.0.0" + ] + }, + "pathval@1.1.1": { + "name": "pathval", + "version": "1.1.1", + "dependencies": [] + }, + "supports-color@7.2.0": { + "name": "supports-color", + "version": "7.2.0", + "dependencies": [ + "has-flag@4.0.0" + ] + }, + "type-detect@4.0.8": { + "name": "type-detect", + "version": "4.0.8", + "dependencies": [] + } + } +} diff --git a/tests/specs/npm/info_chalk_json/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_node_modules.out new file mode 100644 index 000000000..1ab367952 --- /dev/null +++ b/tests/specs/npm/info_chalk_json/cjs_with_deps/main_node_modules.out @@ -0,0 +1,47 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Initialize ansi-styles@4.3.0 +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Initialize assertion-error@1.1.0 +Download http://localhost:4260/chai/chai-4.3.6.tgz +Initialize chai@4.3.6 +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Initialize chalk@4.1.2 +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Initialize check-error@1.0.2 +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Initialize color-convert@2.0.1 +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Initialize color-name@1.1.4 +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Initialize deep-eql@3.0.1 +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Initialize get-func-name@2.0.0 +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Initialize has-flag@4.0.0 +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Initialize loupe@2.3.4 +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Initialize pathval@1.1.1 +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Initialize supports-color@7.2.0 +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +Initialize type-detect@4.0.8 +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc b/tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc new file mode 100644 index 000000000..37b510488 --- /dev/null +++ b/tests/specs/npm/info_chalk_json_node_modules_dir/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "args": "info --quiet --node-modules-dir --json cjs_with_deps/main.js", + "output": "cjs_with_deps/main_info_json.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.js b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.js new file mode 100644 index 000000000..568726874 --- /dev/null +++ b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.js @@ -0,0 +1,12 @@ +import chalk from "npm:chalk@4"; +import { expect } from "npm:chai@4.3"; + +console.log(chalk.green("chalk cjs loads")); + +const timeout = setTimeout(() => {}, 0); +expect(timeout).to.be.a("number"); +clearTimeout(timeout); + +const interval = setInterval(() => {}, 100); +expect(interval).to.be.a("number"); +clearInterval(interval); diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.out new file mode 100644 index 000000000..7051c2395 --- /dev/null +++ b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main.out @@ -0,0 +1,33 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Download http://localhost:4260/chai/chai-4.3.6.tgz +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out new file mode 100644 index 000000000..8e37c88eb --- /dev/null +++ b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out @@ -0,0 +1,22 @@ +local: [WILDCARD]main.js +type: JavaScript +dependencies: 14 unique +size: [WILDCARD] + +file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) +├─┬ npm:/chalk@4.1.2 ([WILDCARD]) +│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) +│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) +│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) +│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) +│ └── npm:/has-flag@4.0.0 ([WILDCARD]) +└─┬ npm:/chai@4.3.6 ([WILDCARD]) + ├── npm:/assertion-error@1.1.0 ([WILDCARD]) + ├── npm:/check-error@1.0.2 ([WILDCARD]) + ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) + │ └── npm:/type-detect@4.0.8 ([WILDCARD]) + ├── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) + │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├── npm:/pathval@1.1.1 ([WILDCARD]) + └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out new file mode 100644 index 000000000..af1ef1351 --- /dev/null +++ b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out @@ -0,0 +1,148 @@ +{ + "roots": [ + "file://[WILDCARD]/main.js" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "npm:chalk@4", + "code": { + "specifier": "npm:chalk@4", + "span": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 31 + } + } + }, + "npmPackage": "chalk@4.1.2" + }, + { + "specifier": "npm:chai@4.3", + "code": { + "specifier": "npm:chai@4.3", + "span": { + "start": { + "line": 1, + "character": 23 + }, + "end": { + "line": 1, + "character": 37 + } + } + }, + "npmPackage": "chai@4.3.6" + } + ], + "local": "[WILDCARD]main.js", + "size": 325, + "mediaType": "JavaScript", + "specifier": "[WILDCARD]/main.js" + } + ], + "redirects": { + "npm:chai@4.3": "npm:/chai@4.3.6", + "npm:chalk@4": "npm:/chalk@4.1.2" + }, + "version": 1, + "npmPackages": { + "ansi-styles@4.3.0": { + "name": "ansi-styles", + "version": "4.3.0", + "dependencies": [ + "color-convert@2.0.1" + ] + }, + "assertion-error@1.1.0": { + "name": "assertion-error", + "version": "1.1.0", + "dependencies": [] + }, + "chai@4.3.6": { + "name": "chai", + "version": "4.3.6", + "dependencies": [ + "assertion-error@1.1.0", + "check-error@1.0.2", + "deep-eql@3.0.1", + "get-func-name@2.0.0", + "loupe@2.3.4", + "pathval@1.1.1", + "type-detect@4.0.8" + ] + }, + "chalk@4.1.2": { + "name": "chalk", + "version": "4.1.2", + "dependencies": [ + "ansi-styles@4.3.0", + "supports-color@7.2.0" + ] + }, + "check-error@1.0.2": { + "name": "check-error", + "version": "1.0.2", + "dependencies": [] + }, + "color-convert@2.0.1": { + "name": "color-convert", + "version": "2.0.1", + "dependencies": [ + "color-name@1.1.4" + ] + }, + "color-name@1.1.4": { + "name": "color-name", + "version": "1.1.4", + "dependencies": [] + }, + "deep-eql@3.0.1": { + "name": "deep-eql", + "version": "3.0.1", + "dependencies": [ + "type-detect@4.0.8" + ] + }, + "get-func-name@2.0.0": { + "name": "get-func-name", + "version": "2.0.0", + "dependencies": [] + }, + "has-flag@4.0.0": { + "name": "has-flag", + "version": "4.0.0", + "dependencies": [] + }, + "loupe@2.3.4": { + "name": "loupe", + "version": "2.3.4", + "dependencies": [ + "get-func-name@2.0.0" + ] + }, + "pathval@1.1.1": { + "name": "pathval", + "version": "1.1.1", + "dependencies": [] + }, + "supports-color@7.2.0": { + "name": "supports-color", + "version": "7.2.0", + "dependencies": [ + "has-flag@4.0.0" + ] + }, + "type-detect@4.0.8": { + "name": "type-detect", + "version": "4.0.8", + "dependencies": [] + } + } +} diff --git a/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out new file mode 100644 index 000000000..1ab367952 --- /dev/null +++ b/tests/specs/npm/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out @@ -0,0 +1,47 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Initialize ansi-styles@4.3.0 +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Initialize assertion-error@1.1.0 +Download http://localhost:4260/chai/chai-4.3.6.tgz +Initialize chai@4.3.6 +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Initialize chalk@4.1.2 +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Initialize check-error@1.0.2 +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Initialize color-convert@2.0.1 +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Initialize color-name@1.1.4 +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Initialize deep-eql@3.0.1 +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Initialize get-func-name@2.0.0 +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Initialize has-flag@4.0.0 +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Initialize loupe@2.3.4 +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Initialize pathval@1.1.1 +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Initialize supports-color@7.2.0 +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +Initialize type-detect@4.0.8 +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/info_cli_chalk_display/__test__.jsonc b/tests/specs/npm/info_cli_chalk_display/__test__.jsonc new file mode 100644 index 000000000..7587fbcb6 --- /dev/null +++ b/tests/specs/npm/info_cli_chalk_display/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "info --quiet npm:chalk@4", + "output": "info/chalk.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/info_cli_chalk_display/info/chalk.out b/tests/specs/npm/info_cli_chalk_display/info/chalk.out new file mode 100644 index 000000000..63fa20da5 --- /dev/null +++ b/tests/specs/npm/info_cli_chalk_display/info/chalk.out @@ -0,0 +1,9 @@ +dependencies: 5 unique +size: [WILDCARD] + +npm:/chalk@4.1.2 ([WILDCARD]) +├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) +│ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) +│ └── npm:/color-name@1.1.4 ([WILDCARD]) +└─┬ npm:/supports-color@7.2.0 ([WILDCARD]) + └── npm:/has-flag@4.0.0 ([WILDCARD]) diff --git a/tests/specs/npm/info_cli_chalk_display/info/chalk_json.out b/tests/specs/npm/info_cli_chalk_display/info/chalk_json.out new file mode 100644 index 000000000..d54155270 --- /dev/null +++ b/tests/specs/npm/info_cli_chalk_display/info/chalk_json.out @@ -0,0 +1,57 @@ +{ + "roots": [ + "npm:chalk@4" + ], + "modules": [ + { + "kind": "npm", + "specifier": "npm:/chalk@4.1.2", + "npmPackage": "chalk@4.1.2" + } + ], + "redirects": { + "npm:chalk@4": "npm:/chalk@4.1.2" + }, + "version": 1, + "npmPackages": { + "ansi-styles@4.3.0": { + "name": "ansi-styles", + "version": "4.3.0", + "dependencies": [ + "color-convert@2.0.1" + ] + }, + "chalk@4.1.2": { + "name": "chalk", + "version": "4.1.2", + "dependencies": [ + "ansi-styles@4.3.0", + "supports-color@7.2.0" + ] + }, + "color-convert@2.0.1": { + "name": "color-convert", + "version": "2.0.1", + "dependencies": [ + "color-name@1.1.4" + ] + }, + "color-name@1.1.4": { + "name": "color-name", + "version": "1.1.4", + "dependencies": [] + }, + "has-flag@4.0.0": { + "name": "has-flag", + "version": "4.0.0", + "dependencies": [] + }, + "supports-color@7.2.0": { + "name": "supports-color", + "version": "7.2.0", + "dependencies": [ + "has-flag@4.0.0" + ] + } + } +} diff --git a/tests/specs/npm/info_cli_chalk_json/__test__.jsonc b/tests/specs/npm/info_cli_chalk_json/__test__.jsonc new file mode 100644 index 000000000..b5173fd93 --- /dev/null +++ b/tests/specs/npm/info_cli_chalk_json/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "info --quiet --json npm:chalk@4", + "output": "info/chalk_json.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/info_cli_chalk_json/info/chalk.out b/tests/specs/npm/info_cli_chalk_json/info/chalk.out new file mode 100644 index 000000000..63fa20da5 --- /dev/null +++ b/tests/specs/npm/info_cli_chalk_json/info/chalk.out @@ -0,0 +1,9 @@ +dependencies: 5 unique +size: [WILDCARD] + +npm:/chalk@4.1.2 ([WILDCARD]) +├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) +│ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) +│ └── npm:/color-name@1.1.4 ([WILDCARD]) +└─┬ npm:/supports-color@7.2.0 ([WILDCARD]) + └── npm:/has-flag@4.0.0 ([WILDCARD]) diff --git a/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out b/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out new file mode 100644 index 000000000..d54155270 --- /dev/null +++ b/tests/specs/npm/info_cli_chalk_json/info/chalk_json.out @@ -0,0 +1,57 @@ +{ + "roots": [ + "npm:chalk@4" + ], + "modules": [ + { + "kind": "npm", + "specifier": "npm:/chalk@4.1.2", + "npmPackage": "chalk@4.1.2" + } + ], + "redirects": { + "npm:chalk@4": "npm:/chalk@4.1.2" + }, + "version": 1, + "npmPackages": { + "ansi-styles@4.3.0": { + "name": "ansi-styles", + "version": "4.3.0", + "dependencies": [ + "color-convert@2.0.1" + ] + }, + "chalk@4.1.2": { + "name": "chalk", + "version": "4.1.2", + "dependencies": [ + "ansi-styles@4.3.0", + "supports-color@7.2.0" + ] + }, + "color-convert@2.0.1": { + "name": "color-convert", + "version": "2.0.1", + "dependencies": [ + "color-name@1.1.4" + ] + }, + "color-name@1.1.4": { + "name": "color-name", + "version": "1.1.4", + "dependencies": [] + }, + "has-flag@4.0.0": { + "name": "has-flag", + "version": "4.0.0", + "dependencies": [] + }, + "supports-color@7.2.0": { + "name": "supports-color", + "version": "7.2.0", + "dependencies": [ + "has-flag@4.0.0" + ] + } + } +} diff --git a/tests/specs/npm/info_peer_deps/__test__.jsonc b/tests/specs/npm/info_peer_deps/__test__.jsonc new file mode 100644 index 000000000..e505f3077 --- /dev/null +++ b/tests/specs/npm/info_peer_deps/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "info --quiet peer_deps_with_copied_folders/main.ts", + "output": "peer_deps_with_copied_folders/main_info.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out new file mode 100644 index 000000000..3c133bcde --- /dev/null +++ b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.out @@ -0,0 +1,14 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/peer-dep-test-child +Download http://localhost:4260/@denotest/peer-dep-test-grandchild +Download http://localhost:4260/@denotest/peer-dep-test-peer +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz +Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz +Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz +Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz +Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz +[UNORDERED_END] +1 +2 diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.ts b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.ts new file mode 100644 index 000000000..a8ea8104a --- /dev/null +++ b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main.ts @@ -0,0 +1,5 @@ +import version1 from "npm:@denotest/peer-dep-test-child@1"; +import version2 from "npm:@denotest/peer-dep-test-child@2"; + +console.error(version1); +console.error(version2); diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info.out new file mode 100644 index 000000000..e8b92399d --- /dev/null +++ b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info.out @@ -0,0 +1,14 @@ +local: [WILDCARD]main.ts +type: TypeScript +dependencies: 6 unique +size: [WILDCARD] + +file:///[WILDCARD]/peer_deps_with_copied_folders/main.ts (171B) +├─┬ npm:/@denotest/peer-dep-test-child@1.0.0 ([WILDCARD]) +│ ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0 ([WILDCARD]) +│ │ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) +│ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) +└─┬ npm:/@denotest/peer-dep-test-child@2.0.0 ([WILDCARD]) + ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0 ([WILDCARD]) + │ └── npm:/@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) + └── npm:/@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out new file mode 100644 index 000000000..1a5f07c97 --- /dev/null +++ b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out @@ -0,0 +1,97 @@ +{ + "roots": [ + "[WILDCARD]/peer_deps_with_copied_folders/main.ts" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "npm:@denotest/peer-dep-test-child@1", + "code": { + "specifier": "npm:@denotest/peer-dep-test-child@1", + "span": { + "start": { + "line": 0, + "character": 21 + }, + "end": { + "line": 0, + "character": 58 + } + } + }, + "npmPackage": "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0" + }, + { + "specifier": "npm:@denotest/peer-dep-test-child@2", + "code": { + "specifier": "npm:@denotest/peer-dep-test-child@2", + "span": { + "start": { + "line": 1, + "character": 21 + }, + "end": { + "line": 1, + "character": 58 + } + } + }, + "npmPackage": "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0" + } + ], + "local": "[WILDCARD]main.ts", + "size": 171, + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/main.ts" + } + ], + "redirects": { + "npm:@denotest/peer-dep-test-child@1": "npm:/@denotest/peer-dep-test-child@1.0.0", + "npm:@denotest/peer-dep-test-child@2": "npm:/@denotest/peer-dep-test-child@2.0.0" + }, + "version": 1, + "npmPackages": { + "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { + "name": "@denotest/peer-dep-test-child", + "version": "1.0.0", + "dependencies": [ + "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0", + "@denotest/peer-dep-test-peer@1.0.0" + ] + }, + "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0": { + "name": "@denotest/peer-dep-test-child", + "version": "2.0.0", + "dependencies": [ + "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0", + "@denotest/peer-dep-test-peer@2.0.0" + ] + }, + "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { + "name": "@denotest/peer-dep-test-grandchild", + "version": "1.0.0", + "dependencies": [ + "@denotest/peer-dep-test-peer@1.0.0" + ] + }, + "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0": { + "name": "@denotest/peer-dep-test-grandchild", + "version": "1.0.0", + "dependencies": [ + "@denotest/peer-dep-test-peer@2.0.0" + ] + }, + "@denotest/peer-dep-test-peer@1.0.0": { + "name": "@denotest/peer-dep-test-peer", + "version": "1.0.0", + "dependencies": [] + }, + "@denotest/peer-dep-test-peer@2.0.0": { + "name": "@denotest/peer-dep-test-peer", + "version": "2.0.0", + "dependencies": [] + } + } +} diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out new file mode 100644 index 000000000..02b5cbafd --- /dev/null +++ b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out @@ -0,0 +1,9 @@ +[UNORDERED_START] +Initialize @denotest/peer-dep-test-child@1.0.0 +Initialize @denotest/peer-dep-test-child@2.0.0 +Initialize @denotest/peer-dep-test-grandchild@1.0.0 +Initialize @denotest/peer-dep-test-peer@1.0.0 +Initialize @denotest/peer-dep-test-peer@2.0.0 +[UNORDERED_END] +1 +2 diff --git a/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out new file mode 100644 index 000000000..9c8145211 --- /dev/null +++ b/tests/specs/npm/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out @@ -0,0 +1,19 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/peer-dep-test-child +Download http://localhost:4260/@denotest/peer-dep-test-grandchild +Download http://localhost:4260/@denotest/peer-dep-test-peer +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz +Initialize @denotest/peer-dep-test-child@1.0.0 +Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz +Initialize @denotest/peer-dep-test-child@2.0.0 +Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz +Initialize @denotest/peer-dep-test-grandchild@1.0.0 +Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz +Initialize @denotest/peer-dep-test-peer@1.0.0 +Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz +Initialize @denotest/peer-dep-test-peer@2.0.0 +[UNORDERED_END] +1 +2 diff --git a/tests/specs/npm/info_peer_deps_json/__test__.jsonc b/tests/specs/npm/info_peer_deps_json/__test__.jsonc new file mode 100644 index 000000000..9a630add4 --- /dev/null +++ b/tests/specs/npm/info_peer_deps_json/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "info --quiet --json peer_deps_with_copied_folders/main.ts", + "output": "peer_deps_with_copied_folders/main_info_json.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out new file mode 100644 index 000000000..3c133bcde --- /dev/null +++ b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.out @@ -0,0 +1,14 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/peer-dep-test-child +Download http://localhost:4260/@denotest/peer-dep-test-grandchild +Download http://localhost:4260/@denotest/peer-dep-test-peer +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz +Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz +Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz +Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz +Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz +[UNORDERED_END] +1 +2 diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.ts b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.ts new file mode 100644 index 000000000..a8ea8104a --- /dev/null +++ b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main.ts @@ -0,0 +1,5 @@ +import version1 from "npm:@denotest/peer-dep-test-child@1"; +import version2 from "npm:@denotest/peer-dep-test-child@2"; + +console.error(version1); +console.error(version2); diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out new file mode 100644 index 000000000..e8b92399d --- /dev/null +++ b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out @@ -0,0 +1,14 @@ +local: [WILDCARD]main.ts +type: TypeScript +dependencies: 6 unique +size: [WILDCARD] + +file:///[WILDCARD]/peer_deps_with_copied_folders/main.ts (171B) +├─┬ npm:/@denotest/peer-dep-test-child@1.0.0 ([WILDCARD]) +│ ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0 ([WILDCARD]) +│ │ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) +│ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) +└─┬ npm:/@denotest/peer-dep-test-child@2.0.0 ([WILDCARD]) + ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0 ([WILDCARD]) + │ └── npm:/@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) + └── npm:/@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out new file mode 100644 index 000000000..1a5f07c97 --- /dev/null +++ b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out @@ -0,0 +1,97 @@ +{ + "roots": [ + "[WILDCARD]/peer_deps_with_copied_folders/main.ts" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "npm:@denotest/peer-dep-test-child@1", + "code": { + "specifier": "npm:@denotest/peer-dep-test-child@1", + "span": { + "start": { + "line": 0, + "character": 21 + }, + "end": { + "line": 0, + "character": 58 + } + } + }, + "npmPackage": "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0" + }, + { + "specifier": "npm:@denotest/peer-dep-test-child@2", + "code": { + "specifier": "npm:@denotest/peer-dep-test-child@2", + "span": { + "start": { + "line": 1, + "character": 21 + }, + "end": { + "line": 1, + "character": 58 + } + } + }, + "npmPackage": "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0" + } + ], + "local": "[WILDCARD]main.ts", + "size": 171, + "mediaType": "TypeScript", + "specifier": "file://[WILDCARD]/main.ts" + } + ], + "redirects": { + "npm:@denotest/peer-dep-test-child@1": "npm:/@denotest/peer-dep-test-child@1.0.0", + "npm:@denotest/peer-dep-test-child@2": "npm:/@denotest/peer-dep-test-child@2.0.0" + }, + "version": 1, + "npmPackages": { + "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { + "name": "@denotest/peer-dep-test-child", + "version": "1.0.0", + "dependencies": [ + "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0", + "@denotest/peer-dep-test-peer@1.0.0" + ] + }, + "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0": { + "name": "@denotest/peer-dep-test-child", + "version": "2.0.0", + "dependencies": [ + "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0", + "@denotest/peer-dep-test-peer@2.0.0" + ] + }, + "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { + "name": "@denotest/peer-dep-test-grandchild", + "version": "1.0.0", + "dependencies": [ + "@denotest/peer-dep-test-peer@1.0.0" + ] + }, + "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0": { + "name": "@denotest/peer-dep-test-grandchild", + "version": "1.0.0", + "dependencies": [ + "@denotest/peer-dep-test-peer@2.0.0" + ] + }, + "@denotest/peer-dep-test-peer@1.0.0": { + "name": "@denotest/peer-dep-test-peer", + "version": "1.0.0", + "dependencies": [] + }, + "@denotest/peer-dep-test-peer@2.0.0": { + "name": "@denotest/peer-dep-test-peer", + "version": "2.0.0", + "dependencies": [] + } + } +} diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out new file mode 100644 index 000000000..02b5cbafd --- /dev/null +++ b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out @@ -0,0 +1,9 @@ +[UNORDERED_START] +Initialize @denotest/peer-dep-test-child@1.0.0 +Initialize @denotest/peer-dep-test-child@2.0.0 +Initialize @denotest/peer-dep-test-grandchild@1.0.0 +Initialize @denotest/peer-dep-test-peer@1.0.0 +Initialize @denotest/peer-dep-test-peer@2.0.0 +[UNORDERED_END] +1 +2 diff --git a/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out new file mode 100644 index 000000000..9c8145211 --- /dev/null +++ b/tests/specs/npm/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out @@ -0,0 +1,19 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/peer-dep-test-child +Download http://localhost:4260/@denotest/peer-dep-test-grandchild +Download http://localhost:4260/@denotest/peer-dep-test-peer +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz +Initialize @denotest/peer-dep-test-child@1.0.0 +Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz +Initialize @denotest/peer-dep-test-child@2.0.0 +Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz +Initialize @denotest/peer-dep-test-grandchild@1.0.0 +Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz +Initialize @denotest/peer-dep-test-peer@1.0.0 +Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz +Initialize @denotest/peer-dep-test-peer@2.0.0 +[UNORDERED_END] +1 +2 diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/__test__.jsonc b/tests/specs/npm/mixed_case_package_name_global_dir/__test__.jsonc new file mode 100644 index 000000000..cc9359aab --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name_global_dir/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run mixed_case_package_name/global.ts", + "output": "mixed_case_package_name/global.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out new file mode 100644 index 000000000..fdacea385 --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.out @@ -0,0 +1,9 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/MixedCase +Download http://localhost:4260/@denotest/CAPITALS +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz +Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz +[UNORDERED_END] +5 diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts new file mode 100644 index 000000000..a721b3d78 --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts @@ -0,0 +1,2 @@ +import value from "npm:@denotest/MixedCase"; +console.log(value); diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out new file mode 100644 index 000000000..6ab989d80 --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.out @@ -0,0 +1,13 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/MixedCase +Download http://localhost:4260/@denotest/CAPITALS +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz +Initialize @denotest/CAPITALS@1.0.0 +Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz +Initialize @denotest/MixedCase@1.0.0 +[UNORDERED_END] +5 +true +true diff --git a/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts new file mode 100644 index 000000000..6ca6cb581 --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts @@ -0,0 +1,18 @@ +import value from "npm:@denotest/MixedCase"; +console.log(value); +console.log(pathExists("./node_modules/.deno")); +console.log( + pathExists("./node_modules/.deno/_ibsgk3tporsxg5bpinavaskuifgfg@1.0.0"), +); + +function pathExists(filePath: string) { + try { + Deno.lstatSync(filePath); + return true; + } catch (error) { + if (error instanceof Deno.errors.NotFound) { + return false; + } + throw error; + } +} diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc b/tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc new file mode 100644 index 000000000..1f568e286 --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name_local_dir/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "args": "run --node-modules-dir=auto -A mixed_case_package_name/local.ts", + "output": "mixed_case_package_name/local.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out new file mode 100644 index 000000000..fdacea385 --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.out @@ -0,0 +1,9 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/MixedCase +Download http://localhost:4260/@denotest/CAPITALS +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz +Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz +[UNORDERED_END] +5 diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts new file mode 100644 index 000000000..a721b3d78 --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts @@ -0,0 +1,2 @@ +import value from "npm:@denotest/MixedCase"; +console.log(value); diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out new file mode 100644 index 000000000..6ab989d80 --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.out @@ -0,0 +1,13 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/MixedCase +Download http://localhost:4260/@denotest/CAPITALS +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz +Initialize @denotest/CAPITALS@1.0.0 +Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz +Initialize @denotest/MixedCase@1.0.0 +[UNORDERED_END] +5 +true +true diff --git a/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts new file mode 100644 index 000000000..6ca6cb581 --- /dev/null +++ b/tests/specs/npm/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts @@ -0,0 +1,18 @@ +import value from "npm:@denotest/MixedCase"; +console.log(value); +console.log(pathExists("./node_modules/.deno")); +console.log( + pathExists("./node_modules/.deno/_ibsgk3tporsxg5bpinavaskuifgfg@1.0.0"), +); + +function pathExists(filePath: string) { + try { + Deno.lstatSync(filePath); + return true; + } catch (error) { + if (error instanceof Deno.errors.NotFound) { + return false; + } + throw error; + } +} diff --git a/tests/specs/npm/node_modules_deno_node_modules/__test__.jsonc b/tests/specs/npm/node_modules_deno_node_modules/__test__.jsonc new file mode 100644 index 000000000..377fd05ea --- /dev/null +++ b/tests/specs/npm/node_modules_deno_node_modules/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run --quiet node_modules_deno_node_modules/main.ts", + "output": "node_modules_deno_node_modules/main.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out b/tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out new file mode 100644 index 000000000..1ebdb2dd5 --- /dev/null +++ b/tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out @@ -0,0 +1,2 @@ +esm +esm diff --git a/tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts b/tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts new file mode 100644 index 000000000..6e4a32d8e --- /dev/null +++ b/tests/specs/npm/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts @@ -0,0 +1,7 @@ +import { getKind as getKind1 } from "npm:@denotest/dual-cjs-esm-dep"; +// this should still be able to be resolved even though it's missing the +// "@denotest/dual-cjs-esm" package because the above import will resolve it +import { getKind as getKind2 } from "npm:@denotest/dual-cjs-esm-dep-missing"; + +console.log(getKind1()); +console.log(getKind2()); diff --git a/tests/specs/npm/node_modules_deno_node_modules_local/__test__.jsonc b/tests/specs/npm/node_modules_deno_node_modules_local/__test__.jsonc new file mode 100644 index 000000000..caa34f67c --- /dev/null +++ b/tests/specs/npm/node_modules_deno_node_modules_local/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "args": "run --quiet --node-modules-dir node_modules_deno_node_modules/main.ts", + "output": "node_modules_deno_node_modules/main.out", + "exitCode": 0, + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out b/tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out new file mode 100644 index 000000000..1ebdb2dd5 --- /dev/null +++ b/tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out @@ -0,0 +1,2 @@ +esm +esm diff --git a/tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts b/tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts new file mode 100644 index 000000000..6e4a32d8e --- /dev/null +++ b/tests/specs/npm/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts @@ -0,0 +1,7 @@ +import { getKind as getKind1 } from "npm:@denotest/dual-cjs-esm-dep"; +// this should still be able to be resolved even though it's missing the +// "@denotest/dual-cjs-esm" package because the above import will resolve it +import { getKind as getKind2 } from "npm:@denotest/dual-cjs-esm-dep-missing"; + +console.log(getKind1()); +console.log(getKind2()); diff --git a/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/__test__.jsonc b/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/__test__.jsonc new file mode 100644 index 000000000..c20c92924 --- /dev/null +++ b/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "args": "run --node-modules-dir=auto -A --quiet require_added_nm_folder/main.js", + "output": "require_added_nm_folder/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 0 +} diff --git a/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js b/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js new file mode 100644 index 000000000..723b2023a --- /dev/null +++ b/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js @@ -0,0 +1,10 @@ +import { getValue } from "npm:@denotest/require-added-nm-folder"; + +Deno.mkdirSync("./node_modules/.other-package"); +Deno.writeTextFileSync("./node_modules/.other-package/package.json", "{}"); +Deno.writeTextFileSync( + "./node_modules/.other-package/index.js", + "exports.get = () => 5;", +); + +console.log(getValue()); diff --git a/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out b/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out new file mode 100644 index 000000000..7ed6ff82d --- /dev/null +++ b/tests/specs/npm/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out @@ -0,0 +1 @@ +5 diff --git a/tests/specs/npm/node_modules_dir_require_main_entry/__test__.jsonc b/tests/specs/npm/node_modules_dir_require_main_entry/__test__.jsonc new file mode 100644 index 000000000..1a0dfba32 --- /dev/null +++ b/tests/specs/npm/node_modules_dir_require_main_entry/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "args": "run --node-modules-dir -A --quiet require_main/main.js", + "output": "require_main/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 0 +} diff --git a/tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.js b/tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.js new file mode 100644 index 000000000..ddecd4fdb --- /dev/null +++ b/tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.js @@ -0,0 +1,2 @@ +import fraction from "npm:autoprefixer"; +console.log(typeof fraction); diff --git a/tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.out b/tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.out new file mode 100644 index 000000000..e2dbde096 --- /dev/null +++ b/tests/specs/npm/node_modules_dir_require_main_entry/require_main/main.out @@ -0,0 +1 @@ +function diff --git a/tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc b/tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc new file mode 100644 index 000000000..75488e1b5 --- /dev/null +++ b/tests/specs/npm/node_modules_dir_with_deps/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tempDir": true, + "args": "run --allow-read --allow-env --node-modules-dir=auto cjs_with_deps/main.js", + "output": "cjs_with_deps/main_node_modules.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.js b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.js new file mode 100644 index 000000000..568726874 --- /dev/null +++ b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.js @@ -0,0 +1,12 @@ +import chalk from "npm:chalk@4"; +import { expect } from "npm:chai@4.3"; + +console.log(chalk.green("chalk cjs loads")); + +const timeout = setTimeout(() => {}, 0); +expect(timeout).to.be.a("number"); +clearTimeout(timeout); + +const interval = setInterval(() => {}, 100); +expect(interval).to.be.a("number"); +clearInterval(interval); diff --git a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.out b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.out new file mode 100644 index 000000000..7051c2395 --- /dev/null +++ b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main.out @@ -0,0 +1,33 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Download http://localhost:4260/chai/chai-4.3.6.tgz +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info.out b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info.out new file mode 100644 index 000000000..bcaaf1eec --- /dev/null +++ b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info.out @@ -0,0 +1,22 @@ +local: [WILDCARD]main.js +type: JavaScript +dependencies: 14 unique +size: [WILDCARD] + +file:///[WILDCARD]/npm/cjs_with_deps/main.js ([WILDCARD]) +├─┬ npm:/chalk@4.1.2 ([WILDCARD]) +│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) +│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) +│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) +│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) +│ └── npm:/has-flag@4.0.0 ([WILDCARD]) +└─┬ npm:/chai@4.3.6 ([WILDCARD]) + ├── npm:/assertion-error@1.1.0 ([WILDCARD]) + ├── npm:/check-error@1.0.2 ([WILDCARD]) + ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) + │ └── npm:/type-detect@4.0.8 ([WILDCARD]) + ├── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) + │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) + ├── npm:/pathval@1.1.1 ([WILDCARD]) + └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out new file mode 100644 index 000000000..af1ef1351 --- /dev/null +++ b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out @@ -0,0 +1,148 @@ +{ + "roots": [ + "file://[WILDCARD]/main.js" + ], + "modules": [ + { + "kind": "esm", + "dependencies": [ + { + "specifier": "npm:chalk@4", + "code": { + "specifier": "npm:chalk@4", + "span": { + "start": { + "line": 0, + "character": 18 + }, + "end": { + "line": 0, + "character": 31 + } + } + }, + "npmPackage": "chalk@4.1.2" + }, + { + "specifier": "npm:chai@4.3", + "code": { + "specifier": "npm:chai@4.3", + "span": { + "start": { + "line": 1, + "character": 23 + }, + "end": { + "line": 1, + "character": 37 + } + } + }, + "npmPackage": "chai@4.3.6" + } + ], + "local": "[WILDCARD]main.js", + "size": 325, + "mediaType": "JavaScript", + "specifier": "[WILDCARD]/main.js" + } + ], + "redirects": { + "npm:chai@4.3": "npm:/chai@4.3.6", + "npm:chalk@4": "npm:/chalk@4.1.2" + }, + "version": 1, + "npmPackages": { + "ansi-styles@4.3.0": { + "name": "ansi-styles", + "version": "4.3.0", + "dependencies": [ + "color-convert@2.0.1" + ] + }, + "assertion-error@1.1.0": { + "name": "assertion-error", + "version": "1.1.0", + "dependencies": [] + }, + "chai@4.3.6": { + "name": "chai", + "version": "4.3.6", + "dependencies": [ + "assertion-error@1.1.0", + "check-error@1.0.2", + "deep-eql@3.0.1", + "get-func-name@2.0.0", + "loupe@2.3.4", + "pathval@1.1.1", + "type-detect@4.0.8" + ] + }, + "chalk@4.1.2": { + "name": "chalk", + "version": "4.1.2", + "dependencies": [ + "ansi-styles@4.3.0", + "supports-color@7.2.0" + ] + }, + "check-error@1.0.2": { + "name": "check-error", + "version": "1.0.2", + "dependencies": [] + }, + "color-convert@2.0.1": { + "name": "color-convert", + "version": "2.0.1", + "dependencies": [ + "color-name@1.1.4" + ] + }, + "color-name@1.1.4": { + "name": "color-name", + "version": "1.1.4", + "dependencies": [] + }, + "deep-eql@3.0.1": { + "name": "deep-eql", + "version": "3.0.1", + "dependencies": [ + "type-detect@4.0.8" + ] + }, + "get-func-name@2.0.0": { + "name": "get-func-name", + "version": "2.0.0", + "dependencies": [] + }, + "has-flag@4.0.0": { + "name": "has-flag", + "version": "4.0.0", + "dependencies": [] + }, + "loupe@2.3.4": { + "name": "loupe", + "version": "2.3.4", + "dependencies": [ + "get-func-name@2.0.0" + ] + }, + "pathval@1.1.1": { + "name": "pathval", + "version": "1.1.1", + "dependencies": [] + }, + "supports-color@7.2.0": { + "name": "supports-color", + "version": "7.2.0", + "dependencies": [ + "has-flag@4.0.0" + ] + }, + "type-detect@4.0.8": { + "name": "type-detect", + "version": "4.0.8", + "dependencies": [] + } + } +} diff --git a/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out new file mode 100644 index 000000000..1ab367952 --- /dev/null +++ b/tests/specs/npm/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out @@ -0,0 +1,47 @@ +[UNORDERED_START] +Download http://localhost:4260/chalk +Download http://localhost:4260/chai +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/supports-color +Download http://localhost:4260/assertion-error +Download http://localhost:4260/check-error +Download http://localhost:4260/deep-eql +Download http://localhost:4260/get-func-name +Download http://localhost:4260/loupe +Download http://localhost:4260/pathval +Download http://localhost:4260/type-detect +Download http://localhost:4260/color-convert +Download http://localhost:4260/has-flag +Download http://localhost:4260/color-name +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Initialize ansi-styles@4.3.0 +Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz +Initialize assertion-error@1.1.0 +Download http://localhost:4260/chai/chai-4.3.6.tgz +Initialize chai@4.3.6 +Download http://localhost:4260/chalk/chalk-4.1.2.tgz +Initialize chalk@4.1.2 +Download http://localhost:4260/check-error/check-error-1.0.2.tgz +Initialize check-error@1.0.2 +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Initialize color-convert@2.0.1 +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Initialize color-name@1.1.4 +Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz +Initialize deep-eql@3.0.1 +Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz +Initialize get-func-name@2.0.0 +Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz +Initialize has-flag@4.0.0 +Download http://localhost:4260/loupe/loupe-2.3.4.tgz +Initialize loupe@2.3.4 +Download http://localhost:4260/pathval/pathval-1.1.1.tgz +Initialize pathval@1.1.1 +Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz +Initialize supports-color@7.2.0 +Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz +Initialize type-detect@4.0.8 +[UNORDERED_END] +chalk cjs loads diff --git a/tests/specs/npm/node_modules_dir_yargs/__test__.jsonc b/tests/specs/npm/node_modules_dir_yargs/__test__.jsonc new file mode 100644 index 000000000..df28ea7ef --- /dev/null +++ b/tests/specs/npm/node_modules_dir_yargs/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tempDir": true, + "args": "run --allow-read --allow-env --node-modules-dir=auto cjs_yargs/main.js", + "output": "cjs_yargs/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.js b/tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.js new file mode 100644 index 000000000..832fd053c --- /dev/null +++ b/tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.js @@ -0,0 +1,20 @@ +import yargs from "npm:yargs@15.4.1"; + +const args = yargs(["serve", "8000"]) + .command("serve [port]", "start the server", (yargs) => { + return yargs + .positional("port", { + describe: "port to bind on", + default: 5000, + }); + }, (argv) => { + console.info(`start server on :${argv.port}`); + }) + .option("verbose", { + alias: "v", + type: "boolean", + description: "Run with verbose logging", + }) + .argv; + +console.log(args); diff --git a/tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.out b/tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.out new file mode 100644 index 000000000..938d7a771 --- /dev/null +++ b/tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.out @@ -0,0 +1,84 @@ +[UNORDERED_START] +Download http://localhost:4260/yargs +Download http://localhost:4260/cliui +Download http://localhost:4260/decamelize +Download http://localhost:4260/find-up +Download http://localhost:4260/get-caller-file +Download http://localhost:4260/require-directory +Download http://localhost:4260/require-main-filename +Download http://localhost:4260/set-blocking +Download http://localhost:4260/string-width +Download http://localhost:4260/which-module +Download http://localhost:4260/y18n +Download http://localhost:4260/yargs-parser +Download http://localhost:4260/strip-ansi +Download http://localhost:4260/wrap-ansi +Download http://localhost:4260/locate-path +Download http://localhost:4260/path-exists +Download http://localhost:4260/emoji-regex +Download http://localhost:4260/is-fullwidth-code-point +Download http://localhost:4260/camelcase +Download http://localhost:4260/ansi-regex +Download http://localhost:4260/ansi-styles +Download http://localhost:4260/p-locate +Download http://localhost:4260/color-convert +Download http://localhost:4260/p-limit +Download http://localhost:4260/color-name +Download http://localhost:4260/p-try +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/ansi-regex/ansi-regex-5.0.1.tgz +Initialize ansi-regex@5.0.1 +Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz +Initialize ansi-styles@4.3.0 +Download http://localhost:4260/camelcase/camelcase-5.3.1.tgz +Initialize camelcase@5.3.1 +Download http://localhost:4260/cliui/cliui-6.0.0.tgz +Initialize cliui@6.0.0 +Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz +Initialize color-convert@2.0.1 +Download http://localhost:4260/color-name/color-name-1.1.4.tgz +Initialize color-name@1.1.4 +Download http://localhost:4260/decamelize/decamelize-1.2.0.tgz +Initialize decamelize@1.2.0 +Download http://localhost:4260/emoji-regex/emoji-regex-8.0.0.tgz +Initialize emoji-regex@8.0.0 +Download http://localhost:4260/find-up/find-up-4.1.0.tgz +Initialize find-up@4.1.0 +Download http://localhost:4260/get-caller-file/get-caller-file-2.0.5.tgz +Initialize get-caller-file@2.0.5 +Download http://localhost:4260/is-fullwidth-code-point/is-fullwidth-code-point-3.0.0.tgz +Initialize is-fullwidth-code-point@3.0.0 +Download http://localhost:4260/locate-path/locate-path-5.0.0.tgz +Initialize locate-path@5.0.0 +Download http://localhost:4260/p-limit/p-limit-2.3.0.tgz +Initialize p-limit@2.3.0 +Download http://localhost:4260/p-locate/p-locate-4.1.0.tgz +Initialize p-locate@4.1.0 +Download http://localhost:4260/p-try/p-try-2.2.0.tgz +Initialize p-try@2.2.0 +Download http://localhost:4260/path-exists/path-exists-4.0.0.tgz +Initialize path-exists@4.0.0 +Download http://localhost:4260/require-directory/require-directory-2.1.1.tgz +Initialize require-directory@2.1.1 +Download http://localhost:4260/require-main-filename/require-main-filename-2.0.0.tgz +Initialize require-main-filename@2.0.0 +Download http://localhost:4260/set-blocking/set-blocking-2.0.0.tgz +Initialize set-blocking@2.0.0 +Download http://localhost:4260/string-width/string-width-4.2.3.tgz +Initialize string-width@4.2.3 +Download http://localhost:4260/strip-ansi/strip-ansi-6.0.1.tgz +Initialize strip-ansi@6.0.1 +Download http://localhost:4260/which-module/which-module-2.0.0.tgz +Initialize which-module@2.0.0 +Download http://localhost:4260/wrap-ansi/wrap-ansi-6.2.0.tgz +Initialize wrap-ansi@6.2.0 +Download http://localhost:4260/y18n/y18n-4.0.3.tgz +Initialize y18n@4.0.3 +Download http://localhost:4260/yargs/yargs-15.4.1.tgz +Initialize yargs@15.4.1 +Download http://localhost:4260/yargs-parser/yargs-parser-18.1.3.tgz +Initialize yargs-parser@18.1.3 +[UNORDERED_END] +start server on :8000 +[WILDCARD] diff --git a/tests/specs/npm/non_existent_dep/__test__.jsonc b/tests/specs/npm/non_existent_dep/__test__.jsonc new file mode 100644 index 000000000..a43708421 --- /dev/null +++ b/tests/specs/npm/non_existent_dep/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "cache npm:@denotest/non-existent-dep", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1, + "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest/non-existent-dep\nDownload http://localhost:4260/@denotest/non-existent\n[UNORDERED_END]\nerror: npm package '@denotest/non-existent' does not exist.\n" +} diff --git a/tests/specs/npm/non_existent_dep_version/__test__.jsonc b/tests/specs/npm/non_existent_dep_version/__test__.jsonc new file mode 100644 index 000000000..19cd713e2 --- /dev/null +++ b/tests/specs/npm/non_existent_dep_version/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "cache npm:@denotest/non-existent-dep-version", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1, + "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest/non-existent-dep-version\nDownload http://localhost:4260/@denotest/esm-basic\n[UNORDERED_END]\nerror: Could not find npm package '@denotest/esm-basic' matching '=99.99.99'.\n" +} diff --git a/tests/specs/npm/nonexistent_file/__test__.jsonc b/tests/specs/npm/nonexistent_file/__test__.jsonc new file mode 100644 index 000000000..efbda98d2 --- /dev/null +++ b/tests/specs/npm/nonexistent_file/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run -A --quiet nonexistent_file/main.js", + "output": "nonexistent_file/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/nonexistent_file/nonexistent_file/main.js b/tests/specs/npm/nonexistent_file/nonexistent_file/main.js new file mode 100644 index 000000000..c480b0548 --- /dev/null +++ b/tests/specs/npm/nonexistent_file/nonexistent_file/main.js @@ -0,0 +1,2 @@ +import hmacSHA512 from "npm:crypto-js/non-existent"; +console.log(hmacSHA512); diff --git a/tests/specs/npm/nonexistent_file/nonexistent_file/main.out b/tests/specs/npm/nonexistent_file/nonexistent_file/main.out new file mode 100644 index 000000000..baa79b1ce --- /dev/null +++ b/tests/specs/npm/nonexistent_file/nonexistent_file/main.out @@ -0,0 +1,4 @@ +error: Unable to load [WILDCARD]non-existent imported from [WILDCARD]main.js + +Caused by: +[WILDCARD] diff --git a/tests/specs/npm/nonexistent_file_node_modules_dir/__test__.jsonc b/tests/specs/npm/nonexistent_file_node_modules_dir/__test__.jsonc new file mode 100644 index 000000000..66595558f --- /dev/null +++ b/tests/specs/npm/nonexistent_file_node_modules_dir/__test__.jsonc @@ -0,0 +1,10 @@ +{ + "tempDir": true, + "args": "run -A --quiet --node-modules-dir nonexistent_file/main.js", + "output": "nonexistent_file/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.js b/tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.js new file mode 100644 index 000000000..c480b0548 --- /dev/null +++ b/tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.js @@ -0,0 +1,2 @@ +import hmacSHA512 from "npm:crypto-js/non-existent"; +console.log(hmacSHA512); diff --git a/tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.out b/tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.out new file mode 100644 index 000000000..baa79b1ce --- /dev/null +++ b/tests/specs/npm/nonexistent_file_node_modules_dir/nonexistent_file/main.out @@ -0,0 +1,4 @@ +error: Unable to load [WILDCARD]non-existent imported from [WILDCARD]main.js + +Caused by: +[WILDCARD] diff --git a/tests/specs/npm/permissions_outside_package/__test__.jsonc b/tests/specs/npm/permissions_outside_package/__test__.jsonc new file mode 100644 index 000000000..58f917f73 --- /dev/null +++ b/tests/specs/npm/permissions_outside_package/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run --allow-read permissions_outside_package/main.ts", + "output": "permissions_outside_package/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/config.js b/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/config.js new file mode 100644 index 000000000..e667790d2 --- /dev/null +++ b/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/config.js @@ -0,0 +1,4 @@ +module.exports = { + "name": "foobar", + "version": "0.0.1", +}; diff --git a/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/package.json b/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/package.json new file mode 100644 index 000000000..cc049e6ce --- /dev/null +++ b/tests/specs/npm/permissions_outside_package/permissions_outside_package/foo/package.json @@ -0,0 +1,4 @@ +{ + "name": "foobar", + "version": "0.0.1" +} diff --git a/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out b/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out new file mode 100644 index 000000000..089f329c4 --- /dev/null +++ b/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/permissions-outside-package +Download http://localhost:4260/@denotest/permissions-outside-package/1.0.0.tgz +{ name: "foobar", version: "0.0.1" } diff --git a/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.ts b/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.ts new file mode 100644 index 000000000..934a3eebc --- /dev/null +++ b/tests/specs/npm/permissions_outside_package/permissions_outside_package/main.ts @@ -0,0 +1,5 @@ +import { loadConfigFile } from "npm:@denotest/permissions-outside-package"; + +const fileName = `${Deno.cwd()}/permissions_outside_package/foo/config.js`; +const config = loadConfigFile(fileName); +console.log(config); diff --git a/tests/specs/npm/remote_npm_specifier/__test__.jsonc b/tests/specs/npm/remote_npm_specifier/__test__.jsonc new file mode 100644 index 000000000..416024f0c --- /dev/null +++ b/tests/specs/npm/remote_npm_specifier/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run --quiet -A remote_npm_specifier/main.ts", + "output": "remote_npm_specifier/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 0 +} diff --git a/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.out b/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.out new file mode 100644 index 000000000..9daeafb98 --- /dev/null +++ b/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.out @@ -0,0 +1 @@ +test diff --git a/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.ts b/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.ts new file mode 100644 index 000000000..ea9442059 --- /dev/null +++ b/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/main.ts @@ -0,0 +1 @@ +import "./remote.ts"; diff --git a/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/remote.ts b/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/remote.ts new file mode 100644 index 000000000..923ed3ed8 --- /dev/null +++ b/tests/specs/npm/remote_npm_specifier/remote_npm_specifier/remote.ts @@ -0,0 +1,3 @@ +import chalk from "npm:chalk"; + +console.log(chalk.green("test")); diff --git a/tests/specs/npm/require_esm/__test__.jsonc b/tests/specs/npm/require_esm/__test__.jsonc new file mode 100644 index 000000000..83859c8f1 --- /dev/null +++ b/tests/specs/npm/require_esm/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run --allow-read --quiet require_esm/main.ts", + "output": "require_esm/main.out" +} diff --git a/tests/specs/npm/require_esm/require_esm/esm.js b/tests/specs/npm/require_esm/require_esm/esm.js new file mode 100644 index 000000000..0613f1911 --- /dev/null +++ b/tests/specs/npm/require_esm/require_esm/esm.js @@ -0,0 +1 @@ +export class Test {} diff --git a/tests/specs/npm/require_esm/require_esm/main.out b/tests/specs/npm/require_esm/require_esm/main.out new file mode 100644 index 000000000..aab0d5c28 --- /dev/null +++ b/tests/specs/npm/require_esm/require_esm/main.out @@ -0,0 +1 @@ +[Module: null prototype] { Test: [class Test] } diff --git a/tests/specs/npm/require_esm/require_esm/main.ts b/tests/specs/npm/require_esm/require_esm/main.ts new file mode 100644 index 000000000..67ac808f0 --- /dev/null +++ b/tests/specs/npm/require_esm/require_esm/main.ts @@ -0,0 +1,5 @@ +import { createRequire } from "node:module"; + +const require = createRequire(import.meta.url); + +console.log(require("./esm.js")); diff --git a/tests/specs/npm/require_json/__test__.jsonc b/tests/specs/npm/require_json/__test__.jsonc new file mode 100644 index 000000000..43af6230f --- /dev/null +++ b/tests/specs/npm/require_json/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet require_json/main.js", + "output": "require_json/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/require_json/require_json/main.js b/tests/specs/npm/require_json/require_json/main.js new file mode 100644 index 000000000..d11e85305 --- /dev/null +++ b/tests/specs/npm/require_json/require_json/main.js @@ -0,0 +1,2 @@ +import globals from "npm:globals@13.17.0"; +console.log(globals); diff --git a/tests/specs/npm/require_json/require_json/main.out b/tests/specs/npm/require_json/require_json/main.out new file mode 100644 index 000000000..97db68e1b --- /dev/null +++ b/tests/specs/npm/require_json/require_json/main.out @@ -0,0 +1,3 @@ +[WILDCARD] + devtools: { +[WILDCARD] \ No newline at end of file diff --git a/tests/specs/npm/reserved_word_exports/__test__.jsonc b/tests/specs/npm/reserved_word_exports/__test__.jsonc new file mode 100644 index 000000000..d2f6ae7c2 --- /dev/null +++ b/tests/specs/npm/reserved_word_exports/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run reserved_word_exports/main.ts", + "output": "reserved_word_exports/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out b/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out new file mode 100644 index 000000000..ccfd35bc8 --- /dev/null +++ b/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.out @@ -0,0 +1,141 @@ +Download http://localhost:4260/@denotest/reserved-word-exports +Download http://localhost:4260/@denotest/reserved-word-exports/1.0.0.tgz +[Module: null prototype] { + abstract: "abstract", + arguments: "arguments", + async: "async", + await: "await", + boolean: "boolean", + break: "break", + byte: "byte", + case: "case", + catch: "catch", + char: "char", + class: "class", + const: "const", + continue: "continue", + debugger: "debugger", + default: { + abstract: "abstract", + arguments: "arguments", + async: "async", + await: "await", + boolean: "boolean", + break: "break", + byte: "byte", + case: "case", + catch: "catch", + char: "char", + class: "class", + const: "const", + continue: "continue", + debugger: "debugger", + default: "default", + delete: "delete", + do: "do", + double: "double", + else: "else", + enum: "enum", + eval: "eval", + export: "export", + extends: "extends", + false: "false", + final: "final", + finally: "finally", + float: "float", + for: "for", + function: "function", + get: "get", + goto: "goto", + if: "if", + implements: "implements", + import: "import", + in: "in", + instanceof: "instanceof", + int: "int", + interface: "interface", + let: "let", + long: "long", + mod: "mod", + native: "native", + new: "new", + null: "null", + package: "package", + private: "private", + protected: "protected", + public: "public", + return: "return", + set: "set", + short: "short", + static: "static", + super: "super", + switch: "switch", + synchronized: "synchronized", + this: "this", + throw: "throw", + throws: "throws", + transient: "transient", + true: "true", + try: "try", + typeof: "typeof", + var: "var", + void: "void", + volatile: "volatile", + while: "while", + with: "with", + yield: "yield" + }, + delete: "delete", + do: "do", + double: "double", + else: "else", + enum: "enum", + eval: "eval", + export: "export", + extends: "extends", + false: "false", + final: "final", + finally: "finally", + float: "float", + for: "for", + function: "function", + get: "get", + goto: "goto", + if: "if", + implements: "implements", + import: "import", + in: "in", + instanceof: "instanceof", + int: "int", + interface: "interface", + let: "let", + long: "long", + mod: "mod", + native: "native", + new: "new", + null: "null", + package: "package", + private: "private", + protected: "protected", + public: "public", + return: "return", + set: "set", + short: "short", + static: "static", + super: "super", + switch: "switch", + synchronized: "synchronized", + this: "this", + throw: "throw", + throws: "throws", + transient: "transient", + true: "true", + try: "try", + typeof: "typeof", + var: "var", + void: "void", + volatile: "volatile", + while: "while", + with: "with", + yield: "yield" +} diff --git a/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.ts b/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.ts new file mode 100644 index 000000000..33cf183d3 --- /dev/null +++ b/tests/specs/npm/reserved_word_exports/reserved_word_exports/main.ts @@ -0,0 +1,3 @@ +import * as exports from "npm:@denotest/reserved-word-exports"; + +console.log(exports); diff --git a/tests/specs/npm/run_existing_npm_package_with_subpath/__test__.jsonc b/tests/specs/npm/run_existing_npm_package_with_subpath/__test__.jsonc new file mode 100644 index 000000000..bb02973c4 --- /dev/null +++ b/tests/specs/npm/run_existing_npm_package_with_subpath/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tempDir": true, + "args": "run --allow-read --node-modules-dir=auto npm:@denotest/bin/cli-esm dev --help", + "output": "run_existing_npm_package_with_subpath/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out b/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out new file mode 100644 index 000000000..f6ee03ef1 --- /dev/null +++ b/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out @@ -0,0 +1,5 @@ +Download http://localhost:4260/@denotest/bin +Download http://localhost:4260/@denotest/bin/1.0.0.tgz +Initialize @denotest/bin@1.0.0 +dev +--help diff --git a/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json b/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json new file mode 100644 index 000000000..e9a7e84ce --- /dev/null +++ b/tests/specs/npm/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json @@ -0,0 +1,6 @@ +{ + "name": "run-existing-npm-package", + "dependencies": { + "@denotest/bin": "1.0.0" + } +} diff --git a/tests/specs/npm/sub_paths/__test__.jsonc b/tests/specs/npm/sub_paths/__test__.jsonc new file mode 100644 index 000000000..88ccbc3ac --- /dev/null +++ b/tests/specs/npm/sub_paths/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet sub_paths/main.jsx", + "output": "sub_paths/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/sub_paths/sub_paths/main.jsx b/tests/specs/npm/sub_paths/sub_paths/main.jsx new file mode 100644 index 000000000..0c712b9ff --- /dev/null +++ b/tests/specs/npm/sub_paths/sub_paths/main.jsx @@ -0,0 +1,8 @@ +import React from "npm:react@18.2.0"; +import { renderToString } from "npm:react-dom@18.2.0/server"; + +function App({ name }) { + return
Hello {name}!
; +} + +console.log(renderToString()); diff --git a/tests/specs/npm/sub_paths/sub_paths/main.out b/tests/specs/npm/sub_paths/sub_paths/main.out new file mode 100644 index 000000000..f034585a7 --- /dev/null +++ b/tests/specs/npm/sub_paths/sub_paths/main.out @@ -0,0 +1 @@ +
Hello World!
diff --git a/tests/specs/npm/tarball_with_global_header/__test__.jsonc b/tests/specs/npm/tarball_with_global_header/__test__.jsonc new file mode 100644 index 000000000..7cf4a6083 --- /dev/null +++ b/tests/specs/npm/tarball_with_global_header/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet tarball_with_global_header/main.js", + "output": "tarball_with_global_header/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.js b/tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.js new file mode 100644 index 000000000..d1bb40fbc --- /dev/null +++ b/tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.js @@ -0,0 +1,3 @@ +import { Client } from "npm:ssh2"; + +console.log(Client); diff --git a/tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.out b/tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.out new file mode 100644 index 000000000..ff211087b --- /dev/null +++ b/tests/specs/npm/tarball_with_global_header/tarball_with_global_header/main.out @@ -0,0 +1 @@ +[class Client extends EventEmitter] diff --git a/tests/specs/npm/translate_cjs_to_esm/__test__.jsonc b/tests/specs/npm/translate_cjs_to_esm/__test__.jsonc new file mode 100644 index 000000000..e1344493c --- /dev/null +++ b/tests/specs/npm/translate_cjs_to_esm/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "run -A --quiet translate_cjs_to_esm/main.js", + "output": "translate_cjs_to_esm/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.js b/tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.js new file mode 100644 index 000000000..04a86fbf1 --- /dev/null +++ b/tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.js @@ -0,0 +1,6 @@ +import fsx from "npm:fs-extra@10.1.0"; +import { createApp } from "npm:vue"; +import "npm:@denotest/cjs-with-file-stem"; + +console.log(fsx.access); +console.log(createApp); diff --git a/tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.out b/tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.out new file mode 100644 index 000000000..c21a965b8 --- /dev/null +++ b/tests/specs/npm/translate_cjs_to_esm/translate_cjs_to_esm/main.out @@ -0,0 +1,4 @@ +hello +world +[Function: access] +[Function: createApp] diff --git a/tests/specs/npm/types_ambient_module/__test__.jsonc b/tests/specs/npm/types_ambient_module/__test__.jsonc new file mode 100644 index 000000000..fc60b3433 --- /dev/null +++ b/tests/specs/npm/types_ambient_module/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "check --quiet types_ambient_module/main.ts", + "output": "types_ambient_module/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/types_ambient_module/types_ambient_module/import_map.json b/tests/specs/npm/types_ambient_module/types_ambient_module/import_map.json new file mode 100644 index 000000000..f61d99b47 --- /dev/null +++ b/tests/specs/npm/types_ambient_module/types_ambient_module/import_map.json @@ -0,0 +1,5 @@ +{ + "imports": { + "types-ambient": "npm:@denotest/types-ambient" + } +} diff --git a/tests/specs/npm/types_ambient_module/types_ambient_module/main.out b/tests/specs/npm/types_ambient_module/types_ambient_module/main.out new file mode 100644 index 000000000..c84130707 --- /dev/null +++ b/tests/specs/npm/types_ambient_module/types_ambient_module/main.out @@ -0,0 +1,21 @@ +error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? +console.log(import1.Test2); // should error + ~~~~~ + at file:///[WILDCARD]/types_ambient_module/main.ts:5:21 + + 'Test' is declared here. + class Test { + ~~~~ + at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 + +TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? +console.log(import2.Test2); // should error + ~~~~~ + at file:///[WILDCARD]/types_ambient_module/main.ts:7:21 + + 'Test' is declared here. + class Test { + ~~~~ + at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 + +Found 2 errors. diff --git a/tests/specs/npm/types_ambient_module/types_ambient_module/main.ts b/tests/specs/npm/types_ambient_module/types_ambient_module/main.ts new file mode 100644 index 000000000..8f77cabe8 --- /dev/null +++ b/tests/specs/npm/types_ambient_module/types_ambient_module/main.ts @@ -0,0 +1,7 @@ +import * as import1 from "npm:@denotest/types-ambient"; +import * as import2 from "npm:@denotest/types-ambient@1"; + +console.log(import1.Test); +console.log(import1.Test2); // should error +console.log(import2.Test); +console.log(import2.Test2); // should error diff --git a/tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.out b/tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.out new file mode 100644 index 000000000..548f9b479 --- /dev/null +++ b/tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.out @@ -0,0 +1,9 @@ +error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? +console.log(mod.Test2); // should error + ~~~~~ + at file:///[WILDCARD]/main_import_map.ts:4:17 + + 'Test' is declared here. + class Test { + ~~~~ + at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 diff --git a/tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.ts b/tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.ts new file mode 100644 index 000000000..2694c94b7 --- /dev/null +++ b/tests/specs/npm/types_ambient_module/types_ambient_module/main_import_map.ts @@ -0,0 +1,4 @@ +import * as mod from "npm:@denotest/types-ambient"; + +console.log(mod.Test); +console.log(mod.Test2); // should error diff --git a/tests/specs/npm/types_ambient_module_import_map/__test__.jsonc b/tests/specs/npm/types_ambient_module_import_map/__test__.jsonc new file mode 100644 index 000000000..2e8c9b60b --- /dev/null +++ b/tests/specs/npm/types_ambient_module_import_map/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "check --quiet --import-map=types_ambient_module/import_map.json types_ambient_module/main_import_map.ts", + "output": "types_ambient_module/main_import_map.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/import_map.json b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/import_map.json new file mode 100644 index 000000000..f61d99b47 --- /dev/null +++ b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/import_map.json @@ -0,0 +1,5 @@ +{ + "imports": { + "types-ambient": "npm:@denotest/types-ambient" + } +} diff --git a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.out b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.out new file mode 100644 index 000000000..c84130707 --- /dev/null +++ b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.out @@ -0,0 +1,21 @@ +error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? +console.log(import1.Test2); // should error + ~~~~~ + at file:///[WILDCARD]/types_ambient_module/main.ts:5:21 + + 'Test' is declared here. + class Test { + ~~~~ + at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 + +TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? +console.log(import2.Test2); // should error + ~~~~~ + at file:///[WILDCARD]/types_ambient_module/main.ts:7:21 + + 'Test' is declared here. + class Test { + ~~~~ + at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 + +Found 2 errors. diff --git a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.ts b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.ts new file mode 100644 index 000000000..8f77cabe8 --- /dev/null +++ b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main.ts @@ -0,0 +1,7 @@ +import * as import1 from "npm:@denotest/types-ambient"; +import * as import2 from "npm:@denotest/types-ambient@1"; + +console.log(import1.Test); +console.log(import1.Test2); // should error +console.log(import2.Test); +console.log(import2.Test2); // should error diff --git a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.out b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.out new file mode 100644 index 000000000..548f9b479 --- /dev/null +++ b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.out @@ -0,0 +1,9 @@ +error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? +console.log(mod.Test2); // should error + ~~~~~ + at file:///[WILDCARD]/main_import_map.ts:4:17 + + 'Test' is declared here. + class Test { + ~~~~ + at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 diff --git a/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.ts b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.ts new file mode 100644 index 000000000..2694c94b7 --- /dev/null +++ b/tests/specs/npm/types_ambient_module_import_map/types_ambient_module/main_import_map.ts @@ -0,0 +1,4 @@ +import * as mod from "npm:@denotest/types-ambient"; + +console.log(mod.Test); +console.log(mod.Test2); // should error diff --git a/tests/specs/npm/types_d_ext/__test__.jsonc b/tests/specs/npm/types_d_ext/__test__.jsonc new file mode 100644 index 000000000..daa0f26ff --- /dev/null +++ b/tests/specs/npm/types_d_ext/__test__.jsonc @@ -0,0 +1,8 @@ +{ + "args": "check --all d_ext/main.ts", + "output": "d_ext/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + } +} diff --git a/tests/specs/npm/types_d_ext/d_ext/main.out b/tests/specs/npm/types_d_ext/d_ext/main.out new file mode 100644 index 000000000..e99df6696 --- /dev/null +++ b/tests/specs/npm/types_d_ext/d_ext/main.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/@denotest/d-ext +Download http://localhost:4260/@denotest/d-ext/1.0.0.tgz +Check file:///[WILDCARD]/d_ext/main.ts diff --git a/tests/specs/npm/types_d_ext/d_ext/main.ts b/tests/specs/npm/types_d_ext/d_ext/main.ts new file mode 100644 index 000000000..c92dbe065 --- /dev/null +++ b/tests/specs/npm/types_d_ext/d_ext/main.ts @@ -0,0 +1,3 @@ +import { test } from "npm:@denotest/d-ext"; + +console.log(test); diff --git a/tests/specs/npm/types_entry_value_not_exists/__test__.jsonc b/tests/specs/npm/types_entry_value_not_exists/__test__.jsonc new file mode 100644 index 000000000..1c2e8735f --- /dev/null +++ b/tests/specs/npm/types_entry_value_not_exists/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "check --all types_entry_value_not_exists/main.ts", + "output": "types_entry_value_not_exists/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out b/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out new file mode 100644 index 000000000..017a17ea2 --- /dev/null +++ b/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.out @@ -0,0 +1,7 @@ +Download http://localhost:4260/@denotest/types-entry-value-not-exists +Download http://localhost:4260/@denotest/types-entry-value-not-exists/1.0.0.tgz +Check file://[WILDCARD]/types_entry_value_not_exists/main.ts +error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. +const result: string = getValue(); + ~~~~~~ + at file:///[WILDCARD]/main.ts:4:7 diff --git a/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.ts b/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.ts new file mode 100644 index 000000000..04374ef87 --- /dev/null +++ b/tests/specs/npm/types_entry_value_not_exists/types_entry_value_not_exists/main.ts @@ -0,0 +1,5 @@ +import { getValue } from "npm:@denotest/types-entry-value-not-exists"; + +// should error here +const result: string = getValue(); +console.log(result); diff --git a/tests/specs/npm/types_exports_import_types/__test__.jsonc b/tests/specs/npm/types_exports_import_types/__test__.jsonc new file mode 100644 index 000000000..fbb6a918a --- /dev/null +++ b/tests/specs/npm/types_exports_import_types/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "check --all types_exports_import_types/main.ts", + "output": "types_exports_import_types/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out b/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out new file mode 100644 index 000000000..10f9425ca --- /dev/null +++ b/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.out @@ -0,0 +1,7 @@ +Download http://localhost:4260/@denotest/types-exports-import-types +Download http://localhost:4260/@denotest/types-exports-import-types/1.0.0.tgz +Check file://[WILDCARD]/types_exports_import_types/main.ts +error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. +const result: string = getValue(); + ~~~~~~ + at file:///[WILDCARD]/main.ts:4:7 diff --git a/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.ts b/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.ts new file mode 100644 index 000000000..3ae3e92a3 --- /dev/null +++ b/tests/specs/npm/types_exports_import_types/types_exports_import_types/main.ts @@ -0,0 +1,5 @@ +import { getValue } from "npm:@denotest/types-exports-import-types"; + +// should error here +const result: string = getValue(); +console.log(result); diff --git a/tests/specs/npm/types_no_types_entry/__test__.jsonc b/tests/specs/npm/types_no_types_entry/__test__.jsonc new file mode 100644 index 000000000..bae02f3a8 --- /dev/null +++ b/tests/specs/npm/types_no_types_entry/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "check --all types_no_types_entry/main.ts", + "output": "types_no_types_entry/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out b/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out new file mode 100644 index 000000000..53e872eaf --- /dev/null +++ b/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.out @@ -0,0 +1,13 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest/types-no-types-entry +Download http://localhost:4260/@denotest/types-entry-value-not-exists +[UNORDERED_END] +[UNORDERED_START] +Download http://localhost:4260/@denotest/types-entry-value-not-exists/1.0.0.tgz +Download http://localhost:4260/@denotest/types-no-types-entry/1.0.0.tgz +[UNORDERED_END] +Check file://[WILDCARD]/types_no_types_entry/main.ts +error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. +const result: string = getValue(); + ~~~~~~ + at file:///[WILDCARD]/main.ts:4:7 diff --git a/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.ts b/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.ts new file mode 100644 index 000000000..eef53b681 --- /dev/null +++ b/tests/specs/npm/types_no_types_entry/types_no_types_entry/main.ts @@ -0,0 +1,5 @@ +import { getValue } from "npm:@denotest/types-no-types-entry"; + +// should error here +const result: string = getValue(); +console.log(result); diff --git a/tests/specs/npm/typescript_file_in_package/__test__.jsonc b/tests/specs/npm/typescript_file_in_package/__test__.jsonc new file mode 100644 index 000000000..c5bd61ca2 --- /dev/null +++ b/tests/specs/npm/typescript_file_in_package/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "args": "run typescript_file_in_package/main.ts", + "output": "typescript_file_in_package/main.out", + "envs": { + "NO_COLOR": "1", + "NPM_CONFIG_REGISTRY": "http://localhost:4260/" + }, + "exitCode": 1 +} diff --git a/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out b/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out new file mode 100644 index 000000000..3c3b97190 --- /dev/null +++ b/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.out @@ -0,0 +1,6 @@ +Download http://localhost:4260/@denotest/typescript-file +Download http://localhost:4260/@denotest/typescript-file/1.0.0.tgz +error: Could not resolve 'npm:@denotest/typescript-file@1.0.0'. + +Caused by: + TypeScript files are not supported in npm packages: file:///[WILDCARD]/@denotest/typescript-file/1.0.0/index.ts diff --git a/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts b/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts new file mode 100644 index 000000000..aefc38ebe --- /dev/null +++ b/tests/specs/npm/typescript_file_in_package/typescript_file_in_package/main.ts @@ -0,0 +1,5 @@ +// We don't support typescript files in npm packages because we don't +// want to encourage people distributing npm packages that aren't JavaScript. +import { getValue } from "npm:@denotest/typescript-file"; + +console.log(getValue()); diff --git a/tests/specs/npm_tests/builtin_module_module/__test__.jsonc b/tests/specs/npm_tests/builtin_module_module/__test__.jsonc deleted file mode 100644 index 2f26a95d4..000000000 --- a/tests/specs/npm_tests/builtin_module_module/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --quiet builtin_module_module/main.js", - "output": "builtin_module_module/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.js b/tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.js deleted file mode 100644 index 9a036791b..000000000 --- a/tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.js +++ /dev/null @@ -1 +0,0 @@ -import "npm:@denotest/builtin-module-module"; diff --git a/tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.out b/tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.out deleted file mode 100644 index 160ba6503..000000000 --- a/tests/specs/npm_tests/builtin_module_module/builtin_module_module/main.out +++ /dev/null @@ -1,4 +0,0 @@ -function -function -function -true diff --git a/tests/specs/npm_tests/cached_only/__test__.jsonc b/tests/specs/npm_tests/cached_only/__test__.jsonc deleted file mode 100644 index 764f702d2..000000000 --- a/tests/specs/npm_tests/cached_only/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --cached-only cached_only/main.ts", - "output": "cached_only/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/cached_only/cached_only/main.out b/tests/specs/npm_tests/cached_only/cached_only/main.out deleted file mode 100644 index 31113eef3..000000000 --- a/tests/specs/npm_tests/cached_only/cached_only/main.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Error getting response at http://localhost:4260/chalk for package "chalk": An npm specifier not found in cache: "chalk", --cached-only is specified. - at file:///[WILDCARD]/specs/npm_tests/cached_only/cached_only/main.ts:1:19 diff --git a/tests/specs/npm_tests/cached_only/cached_only/main.ts b/tests/specs/npm_tests/cached_only/cached_only/main.ts deleted file mode 100644 index 1ccc441a1..000000000 --- a/tests/specs/npm_tests/cached_only/cached_only/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import chalk from "npm:chalk@5"; - -console.log(chalk); diff --git a/tests/specs/npm_tests/check_all/__test__.jsonc b/tests/specs/npm_tests/check_all/__test__.jsonc deleted file mode 100644 index 427524305..000000000 --- a/tests/specs/npm_tests/check_all/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "check --all check_errors/main.ts", - "output": "check_errors/main_all.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/check_all/check_errors/main.ts b/tests/specs/npm_tests/check_all/check_errors/main.ts deleted file mode 100644 index 4b8684195..000000000 --- a/tests/specs/npm_tests/check_all/check_errors/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as test from "npm:@denotest/check-error"; - -console.log(test.Asdf); // should error diff --git a/tests/specs/npm_tests/check_all/check_errors/main_all.out b/tests/specs/npm_tests/check_all/check_errors/main_all.out deleted file mode 100644 index 4c624c0ea..000000000 --- a/tests/specs/npm_tests/check_all/check_errors/main_all.out +++ /dev/null @@ -1,19 +0,0 @@ -Download http://localhost:4260/@denotest/check-error -Download http://localhost:4260/@denotest/check-error/1.0.0.tgz -Check file:///[WILDCARD]/check_errors/main.ts -error: TS2506 [ERROR]: 'Class1' is referenced directly or indirectly in its own base expression. -export class Class1 extends Class2 { - ~~~~~~ - at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:2:14 - -TS2506 [ERROR]: 'Class2' is referenced directly or indirectly in its own base expression. -export class Class2 extends Class1 { - ~~~~~~ - at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:5:14 - -TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. -console.log(test.Asdf); // should error - ~~~~ - at file:///[WILDCARD]/check_errors/main.ts:3:18 - -Found 3 errors. diff --git a/tests/specs/npm_tests/check_all/check_errors/main_local.out b/tests/specs/npm_tests/check_all/check_errors/main_local.out deleted file mode 100644 index 4d3a892e7..000000000 --- a/tests/specs/npm_tests/check_all/check_errors/main_local.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/check-error -Download http://localhost:4260/@denotest/check-error/1.0.0.tgz -Check file:///[WILDCARD]/check_errors/main.ts -error: TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. -console.log(test.Asdf); // should error - ~~~~ - at file:///[WILDCARD]/npm/check_errors/main.ts:3:18 diff --git a/tests/specs/npm_tests/check_local/__test__.jsonc b/tests/specs/npm_tests/check_local/__test__.jsonc deleted file mode 100644 index 1bffa5eed..000000000 --- a/tests/specs/npm_tests/check_local/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "check check_errors/main.ts", - "output": "check_errors/main_local.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/check_local/check_errors/main.ts b/tests/specs/npm_tests/check_local/check_errors/main.ts deleted file mode 100644 index 4b8684195..000000000 --- a/tests/specs/npm_tests/check_local/check_errors/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as test from "npm:@denotest/check-error"; - -console.log(test.Asdf); // should error diff --git a/tests/specs/npm_tests/check_local/check_errors/main_all.out b/tests/specs/npm_tests/check_local/check_errors/main_all.out deleted file mode 100644 index 4c624c0ea..000000000 --- a/tests/specs/npm_tests/check_local/check_errors/main_all.out +++ /dev/null @@ -1,19 +0,0 @@ -Download http://localhost:4260/@denotest/check-error -Download http://localhost:4260/@denotest/check-error/1.0.0.tgz -Check file:///[WILDCARD]/check_errors/main.ts -error: TS2506 [ERROR]: 'Class1' is referenced directly or indirectly in its own base expression. -export class Class1 extends Class2 { - ~~~~~~ - at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:2:14 - -TS2506 [ERROR]: 'Class2' is referenced directly or indirectly in its own base expression. -export class Class2 extends Class1 { - ~~~~~~ - at file:///[WILDCARD]/check-error/1.0.0/index.d.ts:5:14 - -TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. -console.log(test.Asdf); // should error - ~~~~ - at file:///[WILDCARD]/check_errors/main.ts:3:18 - -Found 3 errors. diff --git a/tests/specs/npm_tests/check_local/check_errors/main_local.out b/tests/specs/npm_tests/check_local/check_errors/main_local.out deleted file mode 100644 index 1a150b5e6..000000000 --- a/tests/specs/npm_tests/check_local/check_errors/main_local.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/check-error -Download http://localhost:4260/@denotest/check-error/1.0.0.tgz -Check file:///[WILDCARD]/check_errors/main.ts -error: TS2339 [ERROR]: Property 'Asdf' does not exist on type 'typeof import("file:///[WILDCARD]/@denotest/check-error/1.0.0/index.d.ts")'. -console.log(test.Asdf); // should error - ~~~~ - at file:///[WILDCARD]/check_errors/main.ts:3:18 diff --git a/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/__test__.jsonc b/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/__test__.jsonc deleted file mode 100644 index 675051a69..000000000 --- a/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "check file_dts_dmts_dcts/main.ts", - "output": "file_dts_dmts_dcts/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out b/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out deleted file mode 100644 index 507d2c2f7..000000000 --- a/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.out +++ /dev/null @@ -1,24 +0,0 @@ -Download http://localhost:4260/@denotest/file-dts-dmts-dcts -Download http://localhost:4260/@denotest/file-dts-dmts-dcts/1.0.0.tgz -Check file:///[WILDCARD]/main.ts -error: TS2322 [ERROR]: Type '5' is not assignable to type '"dts"'. -const value1: Dts1 = 5; - ~~~~~~ - at file:///[WILDCARD] - -TS2322 [ERROR]: Type '5' is not assignable to type '"mts"'. -const value2: Mts1 = 5; - ~~~~~~ - at file:///[WILDCARD] - -TS2322 [ERROR]: Type '5' is not assignable to type '"mts"'. -const value3: Mts2 = 5; - ~~~~~~ - at file:///[WILDCARD] - -TS2322 [ERROR]: Type '5' is not assignable to type '"cts"'. -const value4: Cts1 = 5; - ~~~~~~ - at file:///[WILDCARD] - -Found 4 errors. diff --git a/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts b/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts deleted file mode 100644 index 63686e2d3..000000000 --- a/tests/specs/npm_tests/check_package_file_dts_dmts_dcts/file_dts_dmts_dcts/main.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Value as Dts1 } from "npm:@denotest/file-dts-dmts-dcts/js"; -import { Value as Mts1 } from "npm:@denotest/file-dts-dmts-dcts"; -import { Value as Mts2 } from "npm:@denotest/file-dts-dmts-dcts/mjs"; -import { Value as Cts1 } from "npm:@denotest/file-dts-dmts-dcts/cjs"; - -const value1: Dts1 = 5; -const value2: Mts1 = 5; -const value3: Mts2 = 5; -const value4: Cts1 = 5; diff --git a/tests/specs/npm_tests/child_process_fork_test/__test__.jsonc b/tests/specs/npm_tests/child_process_fork_test/__test__.jsonc deleted file mode 100644 index f83cb051e..000000000 --- a/tests/specs/npm_tests/child_process_fork_test/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet child_process_fork_test/main.ts", - "output": "child_process_fork_test/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.out b/tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.out deleted file mode 100644 index d5bc57741..000000000 --- a/tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.out +++ /dev/null @@ -1,2 +0,0 @@ -function -Done. diff --git a/tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.ts b/tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.ts deleted file mode 100644 index e560edb7e..000000000 --- a/tests/specs/npm_tests/child_process_fork_test/child_process_fork_test/main.ts +++ /dev/null @@ -1,4 +0,0 @@ -import "npm:chalk@4"; -import { run } from "npm:@denotest/child-process-fork"; - -run(); diff --git a/tests/specs/npm_tests/cjs_invalid_name_exports/__test__.jsonc b/tests/specs/npm_tests/cjs_invalid_name_exports/__test__.jsonc deleted file mode 100644 index a38b8d035..000000000 --- a/tests/specs/npm_tests/cjs_invalid_name_exports/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --quiet cjs-invalid-name-exports/main.ts", - "output": "cjs-invalid-name-exports/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out b/tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out deleted file mode 100644 index 45ec15d0e..000000000 --- a/tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.out +++ /dev/null @@ -1,13 +0,0 @@ -[Module: null prototype] { - "a \\ b": "a \\ b", - "another 'case'": "example", - default: { - 'wow "double quotes"': "double quotes", - "another 'case'": "example", - "a \\ b": "a \\ b", - "name variable": "a", - "foo - bar": "foo - bar" - }, - "foo - bar": "foo - bar", - 'wow "double quotes"': "double quotes" -} diff --git a/tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts b/tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts deleted file mode 100644 index 9bdf0e43b..000000000 --- a/tests/specs/npm_tests/cjs_invalid_name_exports/cjs-invalid-name-exports/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as foo from "npm:@denotest/cjs-invalid-name-exports"; - -console.log(foo); diff --git a/tests/specs/npm_tests/cjs_local_global_decls/__test__.jsonc b/tests/specs/npm_tests/cjs_local_global_decls/__test__.jsonc deleted file mode 100644 index 8bf847873..000000000 --- a/tests/specs/npm_tests/cjs_local_global_decls/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read cjs_local_global_decls/main.ts", - "output": "cjs_local_global_decls/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.out b/tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.out deleted file mode 100644 index 5e7a36c8d..000000000 --- a/tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/cjs-local-global-decls -Download http://localhost:4260/@denotest/cjs-local-global-decls/1.0.0.tgz -Loaded. diff --git a/tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.ts b/tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.ts deleted file mode 100644 index 04074057b..000000000 --- a/tests/specs/npm_tests/cjs_local_global_decls/cjs_local_global_decls/main.ts +++ /dev/null @@ -1 +0,0 @@ -import "npm:@denotest/cjs-local-global-decls@1.0.0"; diff --git a/tests/specs/npm_tests/cjs_module_export_assignment/__test__.jsonc b/tests/specs/npm_tests/cjs_module_export_assignment/__test__.jsonc deleted file mode 100644 index e9be6361a..000000000 --- a/tests/specs/npm_tests/cjs_module_export_assignment/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet --check=all cjs_module_export_assignment/main.ts", - "output": "cjs_module_export_assignment/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.out b/tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.out deleted file mode 100644 index dea185e38..000000000 --- a/tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.out +++ /dev/null @@ -1,6 +0,0 @@ -{ func: [Function: func] } -[Module: null prototype] { - default: { func: [Function: func] }, - func: [Function: func] -} -5 diff --git a/tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.ts b/tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.ts deleted file mode 100644 index 93d3db1c3..000000000 --- a/tests/specs/npm_tests/cjs_module_export_assignment/cjs_module_export_assignment/main.ts +++ /dev/null @@ -1,6 +0,0 @@ -import defaultImport, * as namespaceImport from "npm:@denotest/cjs-module-export-assignment"; -import { func } from "npm:@denotest/cjs-module-export-assignment"; - -console.log(defaultImport); -console.log(namespaceImport); -console.log(func()); diff --git a/tests/specs/npm_tests/cjs_module_export_assignment_number/__test__.jsonc b/tests/specs/npm_tests/cjs_module_export_assignment_number/__test__.jsonc deleted file mode 100644 index d70f82e50..000000000 --- a/tests/specs/npm_tests/cjs_module_export_assignment_number/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet --check=all cjs_module_export_assignment_number/main.ts", - "output": "cjs_module_export_assignment_number/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out b/tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out deleted file mode 100644 index e559775cf..000000000 --- a/tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.out +++ /dev/null @@ -1,3 +0,0 @@ -5 -5 -[Module: null prototype] { default: 5 } diff --git a/tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts b/tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts deleted file mode 100644 index aee24bf19..000000000 --- a/tests/specs/npm_tests/cjs_module_export_assignment_number/cjs_module_export_assignment_number/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import defaultImport, * as namespaceImport from "npm:@denotest/cjs-module-export-assignment-number"; - -const testDefault: 5 = defaultImport; -console.log(testDefault); -const testNamespace: 5 = namespaceImport.default; -console.log(testNamespace); -console.log(namespaceImport); diff --git a/tests/specs/npm_tests/cjs_pkg_imports/__test__.jsonc b/tests/specs/npm_tests/cjs_pkg_imports/__test__.jsonc deleted file mode 100644 index c51f14b56..000000000 --- a/tests/specs/npm_tests/cjs_pkg_imports/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A cjs_pkg_imports/main.ts", - "output": "cjs_pkg_imports/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.out b/tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.out deleted file mode 100644 index 661146bd0..000000000 --- a/tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/cjs-pkg-imports -Download http://localhost:4260/@denotest/cjs-pkg-imports/1.0.0.tgz -{ crypto: Crypto { subtle: SubtleCrypto {} }, number: 5 } diff --git a/tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.ts b/tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.ts deleted file mode 100644 index b30a3f85c..000000000 --- a/tests/specs/npm_tests/cjs_pkg_imports/cjs_pkg_imports/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import crypto from "npm:@denotest/cjs-pkg-imports"; - -console.log(crypto); diff --git a/tests/specs/npm_tests/cjs_reexport_collision/__test__.jsonc b/tests/specs/npm_tests/cjs_reexport_collision/__test__.jsonc deleted file mode 100644 index 0b9d1e621..000000000 --- a/tests/specs/npm_tests/cjs_reexport_collision/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet cjs_reexport_collision/main.ts", - "output": "cjs_reexport_collision/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.out b/tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.out deleted file mode 100644 index ed3193f8d..000000000 --- a/tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.out +++ /dev/null @@ -1 +0,0 @@ -Hi. diff --git a/tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.ts b/tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.ts deleted file mode 100644 index 4bfcd89b1..000000000 --- a/tests/specs/npm_tests/cjs_reexport_collision/cjs_reexport_collision/main.ts +++ /dev/null @@ -1,2 +0,0 @@ -import ReExportCollision from "npm:@denotest/cjs-reexport-collision"; -ReExportCollision.default.sayHello(); diff --git a/tests/specs/npm_tests/cjs_require_esm/__test__.jsonc b/tests/specs/npm_tests/cjs_require_esm/__test__.jsonc deleted file mode 100644 index 172f1ca65..000000000 --- a/tests/specs/npm_tests/cjs_require_esm/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --quiet cjs_require_esm/main.ts", - "output": "cjs_require_esm/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.out b/tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.out deleted file mode 100644 index 4afceccc9..000000000 --- a/tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.out +++ /dev/null @@ -1,4 +0,0 @@ -[Module: null prototype] { - Test: [Module: null prototype] { Test: [class Test] }, - default: { Test: [Module: null prototype] { Test: [class Test] } } -} diff --git a/tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.ts b/tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.ts deleted file mode 100644 index 069d4b60e..000000000 --- a/tests/specs/npm_tests/cjs_require_esm/cjs_require_esm/main.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as ns from "npm:@denotest/cjs-require-esm"; -console.log(ns); diff --git a/tests/specs/npm_tests/cjs_require_esm_mjs/__test__.jsonc b/tests/specs/npm_tests/cjs_require_esm_mjs/__test__.jsonc deleted file mode 100644 index 3a1323127..000000000 --- a/tests/specs/npm_tests/cjs_require_esm_mjs/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --quiet cjs_require_esm_mjs/main.ts", - "output": "cjs_require_esm_mjs/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out b/tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out deleted file mode 100644 index 4afceccc9..000000000 --- a/tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.out +++ /dev/null @@ -1,4 +0,0 @@ -[Module: null prototype] { - Test: [Module: null prototype] { Test: [class Test] }, - default: { Test: [Module: null prototype] { Test: [class Test] } } -} diff --git a/tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts b/tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts deleted file mode 100644 index d753c2a83..000000000 --- a/tests/specs/npm_tests/cjs_require_esm_mjs/cjs_require_esm_mjs/main.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as ns from "npm:@denotest/cjs-require-esm/require_mjs.js"; -console.log(ns); diff --git a/tests/specs/npm_tests/cjs_sub_path/__test__.jsonc b/tests/specs/npm_tests/cjs_sub_path/__test__.jsonc deleted file mode 100644 index dbec76a13..000000000 --- a/tests/specs/npm_tests/cjs_sub_path/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read cjs_sub_path/main.js", - "output": "cjs_sub_path/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.js b/tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.js deleted file mode 100644 index b71360959..000000000 --- a/tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.js +++ /dev/null @@ -1,21 +0,0 @@ -// this package will require a subpath like "ajv/dist/compile/codegen" -// and also get the parent directory index.js file using require("..") -import Ajv from "npm:ajv@~8.11"; -import addFormats from "npm:ajv-formats@2.1.1"; -import { expect } from "npm:chai@4.3"; - -const ajv = new Ajv(); -addFormats(ajv); - -const schema = { - type: "string", - format: "date", - formatMinimum: "2016-02-06", - formatExclusiveMaximum: "2016-12-27", -}; -const validate = ajv.compile(schema); - -expect(validate("2016-02-06")).to.be.true; -expect(validate("2016-02-05")).to.be.false; - -console.log("Fini"); diff --git a/tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.out b/tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.out deleted file mode 100644 index 868733775..000000000 --- a/tests/specs/npm_tests/cjs_sub_path/cjs_sub_path/main.out +++ /dev/null @@ -1,35 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/ajv -Download http://localhost:4260/ajv-formats -Download http://localhost:4260/chai -Download http://localhost:4260/fast-deep-equal -Download http://localhost:4260/json-schema-traverse -Download http://localhost:4260/require-from-string -Download http://localhost:4260/uri-js -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/punycode -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ajv/ajv-8.11.0.tgz -Download http://localhost:4260/ajv-formats/ajv-formats-2.1.1.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/fast-deep-equal/fast-deep-equal-3.1.3.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/json-schema-traverse/json-schema-traverse-1.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/punycode/punycode-2.1.1.tgz -Download http://localhost:4260/require-from-string/require-from-string-2.0.2.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Download http://localhost:4260/uri-js/uri-js-4.4.1.tgz -[UNORDERED_END] -Fini diff --git a/tests/specs/npm_tests/cjs_this_in_exports/__test__.jsonc b/tests/specs/npm_tests/cjs_this_in_exports/__test__.jsonc deleted file mode 100644 index 251691ca8..000000000 --- a/tests/specs/npm_tests/cjs_this_in_exports/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --allow-read --quiet cjs_this_in_exports/main.js", - "output": "cjs_this_in_exports/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.js b/tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.js deleted file mode 100644 index 03aaabe05..000000000 --- a/tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.js +++ /dev/null @@ -1,11 +0,0 @@ -import defaultImport, { getValue } from "npm:@denotest/cjs-this-in-exports"; -import * as namespaceImport from "npm:@denotest/cjs-this-in-exports"; - -console.log(defaultImport.getValue()); -// In Node this actually fails, but it seems to work in Deno -// so I guess there's no harm in that. -console.log(namespaceImport.getValue()); - -// This will throw because it's lost its context. -// (same thing occurs with Node's cjs -> esm translation) -getValue(); diff --git a/tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.out b/tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.out deleted file mode 100644 index 9517015ae..000000000 --- a/tests/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.out +++ /dev/null @@ -1,5 +0,0 @@ -1 -1 -error: Uncaught (in promise) TypeError: this.otherMethod is not a function - at getValue (file://[WILDCARD]/@denotest/cjs-this-in-exports/1.0.0/index.js:3:17) - at file://[WILDCARD]/specs/npm_tests/cjs_this_in_exports/cjs_this_in_exports/main.js:11:1 diff --git a/tests/specs/npm_tests/cjs_with_deps/__test__.jsonc b/tests/specs/npm_tests/cjs_with_deps/__test__.jsonc deleted file mode 100644 index d9014f102..000000000 --- a/tests/specs/npm_tests/cjs_with_deps/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --allow-env cjs_with_deps/main.js", - "output": "cjs_with_deps/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.js b/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.js deleted file mode 100644 index 568726874..000000000 --- a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.js +++ /dev/null @@ -1,12 +0,0 @@ -import chalk from "npm:chalk@4"; -import { expect } from "npm:chai@4.3"; - -console.log(chalk.green("chalk cjs loads")); - -const timeout = setTimeout(() => {}, 0); -expect(timeout).to.be.a("number"); -clearTimeout(timeout); - -const interval = setInterval(() => {}, 100); -expect(interval).to.be.a("number"); -clearInterval(interval); diff --git a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.out b/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.out deleted file mode 100644 index 7051c2395..000000000 --- a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main.out +++ /dev/null @@ -1,33 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info.out b/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info.out deleted file mode 100644 index 8e37c88eb..000000000 --- a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info.out +++ /dev/null @@ -1,22 +0,0 @@ -local: [WILDCARD]main.js -type: JavaScript -dependencies: 14 unique -size: [WILDCARD] - -file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) -├─┬ npm:/chalk@4.1.2 ([WILDCARD]) -│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) -│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) -│ └── npm:/has-flag@4.0.0 ([WILDCARD]) -└─┬ npm:/chai@4.3.6 ([WILDCARD]) - ├── npm:/assertion-error@1.1.0 ([WILDCARD]) - ├── npm:/check-error@1.0.2 ([WILDCARD]) - ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) - │ └── npm:/type-detect@4.0.8 ([WILDCARD]) - ├── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) - │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├── npm:/pathval@1.1.1 ([WILDCARD]) - └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info_json.out b/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info_json.out deleted file mode 100644 index af1ef1351..000000000 --- a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_info_json.out +++ /dev/null @@ -1,148 +0,0 @@ -{ - "roots": [ - "file://[WILDCARD]/main.js" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:chalk@4", - "code": { - "specifier": "npm:chalk@4", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 31 - } - } - }, - "npmPackage": "chalk@4.1.2" - }, - { - "specifier": "npm:chai@4.3", - "code": { - "specifier": "npm:chai@4.3", - "span": { - "start": { - "line": 1, - "character": 23 - }, - "end": { - "line": 1, - "character": 37 - } - } - }, - "npmPackage": "chai@4.3.6" - } - ], - "local": "[WILDCARD]main.js", - "size": 325, - "mediaType": "JavaScript", - "specifier": "[WILDCARD]/main.js" - } - ], - "redirects": { - "npm:chai@4.3": "npm:/chai@4.3.6", - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "version": 1, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "assertion-error@1.1.0": { - "name": "assertion-error", - "version": "1.1.0", - "dependencies": [] - }, - "chai@4.3.6": { - "name": "chai", - "version": "4.3.6", - "dependencies": [ - "assertion-error@1.1.0", - "check-error@1.0.2", - "deep-eql@3.0.1", - "get-func-name@2.0.0", - "loupe@2.3.4", - "pathval@1.1.1", - "type-detect@4.0.8" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "check-error@1.0.2": { - "name": "check-error", - "version": "1.0.2", - "dependencies": [] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "deep-eql@3.0.1": { - "name": "deep-eql", - "version": "3.0.1", - "dependencies": [ - "type-detect@4.0.8" - ] - }, - "get-func-name@2.0.0": { - "name": "get-func-name", - "version": "2.0.0", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "loupe@2.3.4": { - "name": "loupe", - "version": "2.3.4", - "dependencies": [ - "get-func-name@2.0.0" - ] - }, - "pathval@1.1.1": { - "name": "pathval", - "version": "1.1.1", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - }, - "type-detect@4.0.8": { - "name": "type-detect", - "version": "4.0.8", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_node_modules.out b/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_node_modules.out deleted file mode 100644 index 1ab367952..000000000 --- a/tests/specs/npm_tests/cjs_with_deps/cjs_with_deps/main_node_modules.out +++ /dev/null @@ -1,47 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Initialize assertion-error@1.1.0 -Download http://localhost:4260/chai/chai-4.3.6.tgz -Initialize chai@4.3.6 -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Initialize chalk@4.1.2 -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Initialize check-error@1.0.2 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Initialize deep-eql@3.0.1 -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Initialize get-func-name@2.0.0 -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Initialize has-flag@4.0.0 -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Initialize loupe@2.3.4 -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Initialize pathval@1.1.1 -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Initialize supports-color@7.2.0 -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Initialize type-detect@4.0.8 -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/compare_globals/__test__.jsonc b/tests/specs/npm_tests/compare_globals/__test__.jsonc deleted file mode 100644 index d86a76dbc..000000000 --- a/tests/specs/npm_tests/compare_globals/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --check=all compare_globals/main.ts", - "output": "compare_globals/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/compare_globals/compare_globals/main.out b/tests/specs/npm_tests/compare_globals/compare_globals/main.out deleted file mode 100644 index a1b0a566d..000000000 --- a/tests/specs/npm_tests/compare_globals/compare_globals/main.out +++ /dev/null @@ -1,30 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@types/node -Download http://localhost:4260/undici-types -Download http://localhost:4260/@denotest/globals -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/globals/1.0.0.tgz -Download http://localhost:4260/@types/node/node-22.5.4.tgz -Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz -[UNORDERED_END] -Check file:///[WILDCARD]/compare_globals/main.ts -true -true -[] -setTimeout 1 false -setTimeout 2 function -setTimeout 3 function -setTimeout 4 function -setTimeout 5 undefined -window 1 false -window 2 false -false -false -self 1 true -self 2 true -false -false -bar -bar -true diff --git a/tests/specs/npm_tests/compare_globals/compare_globals/main.ts b/tests/specs/npm_tests/compare_globals/compare_globals/main.ts deleted file mode 100644 index 9482798d8..000000000 --- a/tests/specs/npm_tests/compare_globals/compare_globals/main.ts +++ /dev/null @@ -1,54 +0,0 @@ -/// - -import * as globals from "npm:@denotest/globals"; -console.log(globals.global === globals.globalThis); -// @ts-expect-error even though these are the same object, they have different types -console.log(globals.globalThis === globalThis); -console.log(globals.process.execArgv); - -type AssertTrue = never; -type _TestNoProcessGlobal = AssertTrue< - typeof globalThis extends { process: any } ? false : true ->; -type _TestHasNodeJsGlobal = NodeJS.Architecture; - -const controller = new AbortController(); -controller.abort("reason"); // in the NodeJS declaration it doesn't have a reason - -// Some globals are not the same between Node and Deno. -// @ts-expect-error incompatible types between Node and Deno -console.log("setTimeout 1", globalThis.setTimeout === globals.getSetTimeout()); - -// Super edge case where some Node code deletes a global where the -// Node code has its own global and the Deno code has the same global, -// but it's different. Basically if some Node code deletes -// one of these globals then we don't want it to suddenly inherit -// the Deno global (or touch the Deno global at all). -console.log("setTimeout 2", typeof globalThis.setTimeout); -console.log("setTimeout 3", typeof globals.getSetTimeout()); -globals.deleteSetTimeout(); -console.log("setTimeout 4", typeof globalThis.setTimeout); -console.log("setTimeout 5", typeof globals.getSetTimeout()); - -// In Deno 2 and Node.js, the window global is not defined. -console.log("window 1", "window" in globalThis); -console.log( - "window 2", - Object.getOwnPropertyDescriptor(globalThis, "window") !== undefined, -); -globals.checkWindowGlobal(); - -// In Deno 2 self global is defined, but in Node it is not. -console.log("self 1", "self" in globalThis); -console.log( - "self 2", - Object.getOwnPropertyDescriptor(globalThis, "self") !== undefined, -); -globals.checkSelfGlobal(); - -// "Non-managed" globals are shared between Node and Deno. -(globalThis as any).foo = "bar"; -console.log((globalThis as any).foo); -console.log(globals.getFoo()); - -console.log(Reflect.ownKeys(globalThis).includes("console")); // non-enumerable keys are included diff --git a/tests/specs/npm_tests/create_require/__test__.jsonc b/tests/specs/npm_tests/create_require/__test__.jsonc deleted file mode 100644 index 40d9ce066..000000000 --- a/tests/specs/npm_tests/create_require/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --reload --allow-read create_require/main.ts", - "output": "create_require/main.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/create_require/create_require/main.out b/tests/specs/npm_tests/create_require/create_require/main.out deleted file mode 100644 index 70b0415b3..000000000 --- a/tests/specs/npm_tests/create_require/create_require/main.out +++ /dev/null @@ -1,12 +0,0 @@ -[WILDCARD] -function -function -function -function -function -function -The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received https://example.com/ -The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received https://example.com/ -The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received 1 -The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received foo -The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ./foo diff --git a/tests/specs/npm_tests/create_require/create_require/main.ts b/tests/specs/npm_tests/create_require/create_require/main.ts deleted file mode 100644 index 625c734aa..000000000 --- a/tests/specs/npm_tests/create_require/create_require/main.ts +++ /dev/null @@ -1 +0,0 @@ -import "npm:@denotest/create-require@1.0.0"; diff --git a/tests/specs/npm_tests/deno_cache/__test__.jsonc b/tests/specs/npm_tests/deno_cache/__test__.jsonc deleted file mode 100644 index 93b204c03..000000000 --- a/tests/specs/npm_tests/deno_cache/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "cache --reload npm:chalk npm:mkdirp", - "output": "deno_cache.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_cache/deno_cache.out b/tests/specs/npm_tests/deno_cache/deno_cache.out deleted file mode 100644 index d723293a8..000000000 --- a/tests/specs/npm_tests/deno_cache/deno_cache.out +++ /dev/null @@ -1,8 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/mkdirp -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/chalk/chalk-5.0.1.tgz -Download http://localhost:4260/mkdirp/mkdirp-1.0.4.tgz -[UNORDERED_END] diff --git a/tests/specs/npm_tests/deno_run_bin_cjs/__test__.jsonc b/tests/specs/npm_tests/deno_run_bin_cjs/__test__.jsonc deleted file mode 100644 index 9eb8e9bfe..000000000 --- a/tests/specs/npm_tests/deno_run_bin_cjs/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet npm:@denotest/bin/cli-cjs this is a test", - "output": "deno_run_cjs.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_run_bin_cjs/deno_run_cjs.out b/tests/specs/npm_tests/deno_run_bin_cjs/deno_run_cjs.out deleted file mode 100644 index ffe7cbd89..000000000 --- a/tests/specs/npm_tests/deno_run_bin_cjs/deno_run_cjs.out +++ /dev/null @@ -1,4 +0,0 @@ -this -is -a -test diff --git a/tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc b/tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc deleted file mode 100644 index 6ee5a326b..000000000 --- a/tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet npm:@denotest/bin@0.6.0/cli-cjs.js this is a test", - "output": "deno_run_cjs.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out b/tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out deleted file mode 100644 index ffe7cbd89..000000000 --- a/tests/specs/npm_tests/deno_run_bin_cjs_no_bin_entrypoint/deno_run_cjs.out +++ /dev/null @@ -1,4 +0,0 @@ -this -is -a -test diff --git a/tests/specs/npm_tests/deno_run_bin_esm/__test__.jsonc b/tests/specs/npm_tests/deno_run_bin_esm/__test__.jsonc deleted file mode 100644 index fc48451bb..000000000 --- a/tests/specs/npm_tests/deno_run_bin_esm/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet npm:@denotest/bin/cli-esm this is a test", - "output": "deno_run_esm.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_run_bin_esm/deno_run_esm.out b/tests/specs/npm_tests/deno_run_bin_esm/deno_run_esm.out deleted file mode 100644 index ffe7cbd89..000000000 --- a/tests/specs/npm_tests/deno_run_bin_esm/deno_run_esm.out +++ /dev/null @@ -1,4 +0,0 @@ -this -is -a -test diff --git a/tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc b/tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc deleted file mode 100644 index 956755b30..000000000 --- a/tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet npm:@denotest/bin@0.6.0/cli.mjs this is a test", - "output": "deno_run_esm.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out b/tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out deleted file mode 100644 index ffe7cbd89..000000000 --- a/tests/specs/npm_tests/deno_run_bin_esm_no_bin_entrypoint/deno_run_esm.out +++ /dev/null @@ -1,4 +0,0 @@ -this -is -a -test diff --git a/tests/specs/npm_tests/deno_run_bin_no_ext/__test__.jsonc b/tests/specs/npm_tests/deno_run_bin_no_ext/__test__.jsonc deleted file mode 100644 index 71877b399..000000000 --- a/tests/specs/npm_tests/deno_run_bin_no_ext/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet npm:@denotest/bin/cli-no-ext this is a test", - "output": "deno_run_no_ext.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_run_bin_no_ext/deno_run_no_ext.out b/tests/specs/npm_tests/deno_run_bin_no_ext/deno_run_no_ext.out deleted file mode 100644 index ffe7cbd89..000000000 --- a/tests/specs/npm_tests/deno_run_bin_no_ext/deno_run_no_ext.out +++ /dev/null @@ -1,4 +0,0 @@ -this -is -a -test diff --git a/tests/specs/npm_tests/deno_run_bin_special_chars/__test__.jsonc b/tests/specs/npm_tests/deno_run_bin_special_chars/__test__.jsonc deleted file mode 100644 index c3e14c0b7..000000000 --- a/tests/specs/npm_tests/deno_run_bin_special_chars/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet npm:@denotest/special-chars-in-bin-name/\\foo\" this is a test", - "output": "deno_run_special_chars_in_bin_name.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out b/tests/specs/npm_tests/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out deleted file mode 100644 index ffe7cbd89..000000000 --- a/tests/specs/npm_tests/deno_run_bin_special_chars/deno_run_special_chars_in_bin_name.out +++ /dev/null @@ -1,4 +0,0 @@ -this -is -a -test diff --git a/tests/specs/npm_tests/deno_run_cowsay/__test__.jsonc b/tests/specs/npm_tests/deno_run_cowsay/__test__.jsonc deleted file mode 100644 index 0015b88be..000000000 --- a/tests/specs/npm_tests/deno_run_cowsay/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet npm:cowsay@1.5.0 Hello", - "output": "deno_run_cowsay.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_run_cowsay/deno_run_cowsay.out b/tests/specs/npm_tests/deno_run_cowsay/deno_run_cowsay.out deleted file mode 100644 index 46de82730..000000000 --- a/tests/specs/npm_tests/deno_run_cowsay/deno_run_cowsay.out +++ /dev/null @@ -1,8 +0,0 @@ - _______ -< Hello > - ------- - \ ^__^ - \ (oo)\_______ - (__)\ )\/\ - ||----w | - || || diff --git a/tests/specs/npm_tests/deno_run_cowsay_explicit/__test__.jsonc b/tests/specs/npm_tests/deno_run_cowsay_explicit/__test__.jsonc deleted file mode 100644 index 1ecce925e..000000000 --- a/tests/specs/npm_tests/deno_run_cowsay_explicit/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet npm:cowsay@1.5.0/cowsay Hello", - "output": "deno_run_cowsay.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_run_cowsay_explicit/deno_run_cowsay.out b/tests/specs/npm_tests/deno_run_cowsay_explicit/deno_run_cowsay.out deleted file mode 100644 index 46de82730..000000000 --- a/tests/specs/npm_tests/deno_run_cowsay_explicit/deno_run_cowsay.out +++ /dev/null @@ -1,8 +0,0 @@ - _______ -< Hello > - ------- - \ ^__^ - \ (oo)\_______ - (__)\ )\/\ - ||----w | - || || diff --git a/tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/__test__.jsonc b/tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/__test__.jsonc deleted file mode 100644 index 8671ed1fe..000000000 --- a/tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet --node-modules-dir npm:cowsay@1.5.0 Hello", - "output": "deno_run_cowsay.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out b/tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out deleted file mode 100644 index 46de82730..000000000 --- a/tests/specs/npm_tests/deno_run_cowsay_with_node_modules_dir/deno_run_cowsay.out +++ /dev/null @@ -1,8 +0,0 @@ - _______ -< Hello > - ------- - \ ^__^ - \ (oo)\_______ - (__)\ )\/\ - ||----w | - || || diff --git a/tests/specs/npm_tests/deno_run_cowthink/__test__.jsonc b/tests/specs/npm_tests/deno_run_cowthink/__test__.jsonc deleted file mode 100644 index 2acc84e7b..000000000 --- a/tests/specs/npm_tests/deno_run_cowthink/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet npm:cowsay@1.5.0/cowthink Hello", - "output": "deno_run_cowthink.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/deno_run_cowthink/deno_run_cowthink.out b/tests/specs/npm_tests/deno_run_cowthink/deno_run_cowthink.out deleted file mode 100644 index 8dd990ed6..000000000 --- a/tests/specs/npm_tests/deno_run_cowthink/deno_run_cowthink.out +++ /dev/null @@ -1,8 +0,0 @@ - _______ -( Hello ) - ------- - o ^__^ - o (oo)\_______ - (__)\ )\/\ - ||----w | - || || diff --git a/tests/specs/npm_tests/deno_run_no_bin_entrypoint/__test__.jsonc b/tests/specs/npm_tests/deno_run_no_bin_entrypoint/__test__.jsonc deleted file mode 100644 index 5331ec9c4..000000000 --- a/tests/specs/npm_tests/deno_run_no_bin_entrypoint/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run -A --quiet npm:@denotest/esm-basic", - "output": "deno_run_no_bin_entrypoint.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out b/tests/specs/npm_tests/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out deleted file mode 100644 index 2b885ed59..000000000 --- a/tests/specs/npm_tests/deno_run_no_bin_entrypoint/deno_run_no_bin_entrypoint.out +++ /dev/null @@ -1 +0,0 @@ -error: Failed resolving binary export. '[WILDCARD]@denotest[WILDCARD]esm-basic[WILDCARD]package.json' did not have a bin property diff --git a/tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc b/tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc deleted file mode 100644 index 3eaa8274c..000000000 --- a/tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run -A --quiet npm:@denotest/esm-basic/non-existent.js", - "output": "deno_run_no_bin_entrypoint_non_existent_subpath.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out b/tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out deleted file mode 100644 index 525fe4b4f..000000000 --- a/tests/specs/npm_tests/deno_run_no_bin_entrypoint_non_existent_subpath/deno_run_no_bin_entrypoint_non_existent_subpath.out +++ /dev/null @@ -1,3 +0,0 @@ -error: Failed resolving binary export. '[WILDCARD]@denotest[WILDCARD]esm-basic[WILDCARD]package.json' did not have a bin property - -Fallback failed: Cannot find module 'file:///[WILDCARD]/non-existent.js' diff --git a/tests/specs/npm_tests/deno_run_non_existent/__test__.jsonc b/tests/specs/npm_tests/deno_run_non_existent/__test__.jsonc deleted file mode 100644 index 72dc01450..000000000 --- a/tests/specs/npm_tests/deno_run_non_existent/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run npm:mkdirp@0.5.125", - "output": "deno_run_non_existent.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/deno_run_non_existent/deno_run_non_existent.out b/tests/specs/npm_tests/deno_run_non_existent/deno_run_non_existent.out deleted file mode 100644 index 247e650e6..000000000 --- a/tests/specs/npm_tests/deno_run_non_existent/deno_run_non_existent.out +++ /dev/null @@ -1,2 +0,0 @@ -Download http://localhost:4260/mkdirp -error: Could not find npm package 'mkdirp' matching '0.5.125'. diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/__test__.jsonc b/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/__test__.jsonc deleted file mode 100644 index 24587d928..000000000 --- a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --quiet --no-lock --node-modules-dir=none different_nested_dep/main.js", - "output": "different_nested_dep/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 0 -} diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js b/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js deleted file mode 100644 index 5677eb094..000000000 --- a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import dep from "@denotest/different-nested-dep"; -import childDep from "@denotest/different-nested-dep-child"; - -console.log(dep); -console.log(childDep); diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out b/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out deleted file mode 100644 index 1191247b6..000000000 --- a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/main.out +++ /dev/null @@ -1,2 +0,0 @@ -1 -2 diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json b/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json deleted file mode 100644 index c20425851..000000000 --- a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_false/different_nested_dep/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependencies": { - "@denotest/different-nested-dep": "1.0.0", - "@denotest/different-nested-dep-child": "2.0.0" - } -} diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/__test__.jsonc b/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/__test__.jsonc deleted file mode 100644 index 0533a992b..000000000 --- a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --no-lock --quiet --node-modules-dir=auto different_nested_dep/main.js", - "output": "different_nested_dep/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 0 -} diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js b/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js deleted file mode 100644 index 5677eb094..000000000 --- a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import dep from "@denotest/different-nested-dep"; -import childDep from "@denotest/different-nested-dep-child"; - -console.log(dep); -console.log(childDep); diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out b/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out deleted file mode 100644 index 1191247b6..000000000 --- a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/main.out +++ /dev/null @@ -1,2 +0,0 @@ -1 -2 diff --git a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json b/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json deleted file mode 100644 index c20425851..000000000 --- a/tests/specs/npm_tests/different_nested_dep_node_modules_dir_true/different_nested_dep/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dependencies": { - "@denotest/different-nested-dep": "1.0.0", - "@denotest/different-nested-dep-child": "2.0.0" - } -} diff --git a/tests/specs/npm_tests/directory_import_folder_index_js/__test__.jsonc b/tests/specs/npm_tests/directory_import_folder_index_js/__test__.jsonc deleted file mode 100644 index 8eb6226d6..000000000 --- a/tests/specs/npm_tests/directory_import_folder_index_js/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run directory_import/folder_index_js.ts", - "output": "directory_import/folder_index_js.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.out b/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.out deleted file mode 100644 index a700b8fdb..000000000 --- a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/sub-folders -Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz -error: Directory import [WILDCARD]folder_index_js is not supported resolving import from file:///[WILDCARD]/directory_import/folder_index_js.ts -Did you mean to import index.js within the directory? - -Caused by: - [WILDCARD] diff --git a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.ts b/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.ts deleted file mode 100644 index b0d51fcd9..000000000 --- a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_index_js.ts +++ /dev/null @@ -1,2 +0,0 @@ -import test from "npm:@denotest/sub-folders/folder_index_js"; -console.log(test); diff --git a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.out b/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.out deleted file mode 100644 index 844419b4c..000000000 --- a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4260/@denotest/sub-folders -Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz -error: Directory import [WILDCARD]folder_no_index is not supported resolving import from file:///[WILDCARD]/folder_no_index.ts - -Caused by: - [WILDCARD] diff --git a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.ts b/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.ts deleted file mode 100644 index 4c5fb7ec0..000000000 --- a/tests/specs/npm_tests/directory_import_folder_index_js/directory_import/folder_no_index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import test from "npm:@denotest/sub-folders/folder_no_index"; -console.log(test); diff --git a/tests/specs/npm_tests/directory_import_folder_no_index/__test__.jsonc b/tests/specs/npm_tests/directory_import_folder_no_index/__test__.jsonc deleted file mode 100644 index 613747998..000000000 --- a/tests/specs/npm_tests/directory_import_folder_no_index/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run directory_import/folder_no_index.ts", - "output": "directory_import/folder_no_index.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.out b/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.out deleted file mode 100644 index a700b8fdb..000000000 --- a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/sub-folders -Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz -error: Directory import [WILDCARD]folder_index_js is not supported resolving import from file:///[WILDCARD]/directory_import/folder_index_js.ts -Did you mean to import index.js within the directory? - -Caused by: - [WILDCARD] diff --git a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.ts b/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.ts deleted file mode 100644 index b0d51fcd9..000000000 --- a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_index_js.ts +++ /dev/null @@ -1,2 +0,0 @@ -import test from "npm:@denotest/sub-folders/folder_index_js"; -console.log(test); diff --git a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.out b/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.out deleted file mode 100644 index 844419b4c..000000000 --- a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4260/@denotest/sub-folders -Download http://localhost:4260/@denotest/sub-folders/1.0.0.tgz -error: Directory import [WILDCARD]folder_no_index is not supported resolving import from file:///[WILDCARD]/folder_no_index.ts - -Caused by: - [WILDCARD] diff --git a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.ts b/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.ts deleted file mode 100644 index 4c5fb7ec0..000000000 --- a/tests/specs/npm_tests/directory_import_folder_no_index/directory_import/folder_no_index.ts +++ /dev/null @@ -1,2 +0,0 @@ -import test from "npm:@denotest/sub-folders/folder_no_index"; -console.log(test); diff --git a/tests/specs/npm_tests/dual_cjs_esm/__test__.jsonc b/tests/specs/npm_tests/dual_cjs_esm/__test__.jsonc deleted file mode 100644 index 5ace51cec..000000000 --- a/tests/specs/npm_tests/dual_cjs_esm/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet dual_cjs_esm/main.ts", - "output": "dual_cjs_esm/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.out b/tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.out deleted file mode 100644 index 32e232f11..000000000 --- a/tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.out +++ /dev/null @@ -1,3 +0,0 @@ -esm -cjs -cjs diff --git a/tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.ts b/tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.ts deleted file mode 100644 index 4f3b79667..000000000 --- a/tests/specs/npm_tests/dual_cjs_esm/dual_cjs_esm/main.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { getKind } from "npm:@denotest/dual-cjs-esm@latest"; // test out @latest dist tag -import * as cjs from "npm:@denotest/dual-cjs-esm@latest/cjs/main.cjs"; - -console.log(getKind()); -console.log(cjs.getKind()); -console.log(cjs.getSubPathKind()); diff --git a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/__test__.jsonc b/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/__test__.jsonc deleted file mode 100644 index 8dbee51c7..000000000 --- a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --quiet dynamic_import_deno_ts_from_npm/main.ts", - "output": "dynamic_import_deno_ts_from_npm/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts b/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts deleted file mode 100644 index 3b399665d..000000000 --- a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/add.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function add(a: number, b: number) { - return a + b; -} diff --git a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out b/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out deleted file mode 100644 index 81d7aba8a..000000000 --- a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.out +++ /dev/null @@ -1,2 +0,0 @@ -3 --1 diff --git a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts b/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts deleted file mode 100644 index 4d5deec48..000000000 --- a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/main.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { dynamicImport } from "npm:@denotest/dynamic-import"; - -const { add } = await dynamicImport(new URL("./add.ts", import.meta.url)); -console.log(add(1, 2)); -const { subtract } = await dynamicImport( - new URL("./subtract.mts", import.meta.url), -); -console.log(subtract(1, 2)); diff --git a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts b/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts deleted file mode 100644 index 4bf634170..000000000 --- a/tests/specs/npm_tests/dynamic_import_deno_ts_from_npm/dynamic_import_deno_ts_from_npm/subtract.mts +++ /dev/null @@ -1,3 +0,0 @@ -export function subtract(a: number, b: number) { - return a - b; -} diff --git a/tests/specs/npm_tests/dynamic_import_invalid_package_name/__test__.jsonc b/tests/specs/npm_tests/dynamic_import_invalid_package_name/__test__.jsonc deleted file mode 100644 index a15cabf83..000000000 --- a/tests/specs/npm_tests/dynamic_import_invalid_package_name/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --reload dynamic_import_invalid_package_name/main.ts", - "output": "dynamic_import_invalid_package_name/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out b/tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out deleted file mode 100644 index 414d08795..000000000 --- a/tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4260/ws%3A -FAILED -TypeError: npm package 'ws:' does not exist. - at async file:///[WILDCARD]/dynamic_import_invalid_package_name/main.ts:2:3 { - code: "ERR_MODULE_NOT_FOUND" -} diff --git a/tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts b/tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts deleted file mode 100644 index 368ccc282..000000000 --- a/tests/specs/npm_tests/dynamic_import_invalid_package_name/dynamic_import_invalid_package_name/main.ts +++ /dev/null @@ -1,6 +0,0 @@ -try { - await import(`npm:${"ws:"}`); -} catch (err) { - console.log("FAILED"); - console.log(err); -} diff --git a/tests/specs/npm_tests/dynamic_import_json/__test__.jsonc b/tests/specs/npm_tests/dynamic_import_json/__test__.jsonc deleted file mode 100644 index 9b4f5a212..000000000 --- a/tests/specs/npm_tests/dynamic_import_json/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet import_json/main.js", - "output": "import_json/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/dynamic_import_json/import_json/main.js b/tests/specs/npm_tests/dynamic_import_json/import_json/main.js deleted file mode 100644 index ac6cee9a8..000000000 --- a/tests/specs/npm_tests/dynamic_import_json/import_json/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import json from "npm:@denotest/binary-package@1/package.json" with { - type: "json", -}; -console.log(json); diff --git a/tests/specs/npm_tests/dynamic_import_json/import_json/main.out b/tests/specs/npm_tests/dynamic_import_json/import_json/main.out deleted file mode 100644 index 7db7ec4ea..000000000 --- a/tests/specs/npm_tests/dynamic_import_json/import_json/main.out +++ /dev/null @@ -1,10 +0,0 @@ -{ - name: "@denotest/binary-package", - version: "1.0.0", - main: "index.js", - optionalDependencies: { - "@denotest/binary-package-linux": "1.0.0", - "@denotest/binary-package-mac": "1.0.0", - "@denotest/binary-package-windows": "1.0.0" - } -} diff --git a/tests/specs/npm_tests/dynamic_import_reload_same_package/__test__.jsonc b/tests/specs/npm_tests/dynamic_import_reload_same_package/__test__.jsonc deleted file mode 100644 index d255b9a87..000000000 --- a/tests/specs/npm_tests/dynamic_import_reload_same_package/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --reload dynamic_import_reload_same_package/main.ts", - "output": "dynamic_import_reload_same_package/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out b/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out deleted file mode 100644 index b2f99b465..000000000 --- a/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://localhost:4260/chalk -Download http://localhost:4260/chalk/chalk-5.0.1.tgz -Starting... -Ran other. -Finished... diff --git a/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts b/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts deleted file mode 100644 index 7c7ee7d55..000000000 --- a/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import chalk from "npm:chalk@5"; - -console.log(chalk.green("Starting...")); -// non-analyzable -const importName = "./other.ts"; -await import(importName); -console.log(chalk.green("Finished...")); diff --git a/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts b/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts deleted file mode 100644 index 28e3da14f..000000000 --- a/tests/specs/npm_tests/dynamic_import_reload_same_package/dynamic_import_reload_same_package/other.ts +++ /dev/null @@ -1,3 +0,0 @@ -import chalk from "npm:chalk@5"; - -console.log(chalk.green("Ran other.")); diff --git a/tests/specs/npm_tests/env_var_re_export_dev/__test__.jsonc b/tests/specs/npm_tests/env_var_re_export_dev/__test__.jsonc deleted file mode 100644 index e65ae0308..000000000 --- a/tests/specs/npm_tests/env_var_re_export_dev/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --allow-env --quiet env_var_re_export/main.js", - "output": "dev\n", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/env_var_re_export_dev/env_var_re_export/main.js b/tests/specs/npm_tests/env_var_re_export_dev/env_var_re_export/main.js deleted file mode 100644 index ed91487a0..000000000 --- a/tests/specs/npm_tests/env_var_re_export_dev/env_var_re_export/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { getEnv } from "npm:@denotest/env-var-re-export"; - -console.log(getEnv()); diff --git a/tests/specs/npm_tests/env_var_re_export_prod/__test__.jsonc b/tests/specs/npm_tests/env_var_re_export_prod/__test__.jsonc deleted file mode 100644 index 6c206ba3e..000000000 --- a/tests/specs/npm_tests/env_var_re_export_prod/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --allow-read --allow-env --quiet env_var_re_export/main.js", - "output": "prod\n", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/", - "NODE_ENV": "production" - } -} diff --git a/tests/specs/npm_tests/env_var_re_export_prod/env_var_re_export/main.js b/tests/specs/npm_tests/env_var_re_export_prod/env_var_re_export/main.js deleted file mode 100644 index ed91487a0..000000000 --- a/tests/specs/npm_tests/env_var_re_export_prod/env_var_re_export/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { getEnv } from "npm:@denotest/env-var-re-export"; - -console.log(getEnv()); diff --git a/tests/specs/npm_tests/error_version_after_subpath/__test__.jsonc b/tests/specs/npm_tests/error_version_after_subpath/__test__.jsonc deleted file mode 100644 index 157e238d8..000000000 --- a/tests/specs/npm_tests/error_version_after_subpath/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run -A --quiet error_version_after_subpath/main.js", - "output": "error_version_after_subpath/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.js b/tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.js deleted file mode 100644 index 77c7a017c..000000000 --- a/tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.js +++ /dev/null @@ -1 +0,0 @@ -import "npm:react-dom/server@18.2.0"; diff --git a/tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.out b/tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.out deleted file mode 100644 index 4e5f03e23..000000000 --- a/tests/specs/npm_tests/error_version_after_subpath/error_version_after_subpath/main.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Invalid package specifier 'npm:react-dom/server@18.2.0'. Did you mean to write 'npm:react-dom@18.2.0/server'? - at [WILDCARD]/error_version_after_subpath/main.js:1:8 diff --git a/tests/specs/npm_tests/import_json/__test__.jsonc b/tests/specs/npm_tests/import_json/__test__.jsonc deleted file mode 100644 index 9b4f5a212..000000000 --- a/tests/specs/npm_tests/import_json/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet import_json/main.js", - "output": "import_json/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/import_json/import_json/main.js b/tests/specs/npm_tests/import_json/import_json/main.js deleted file mode 100644 index ac6cee9a8..000000000 --- a/tests/specs/npm_tests/import_json/import_json/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import json from "npm:@denotest/binary-package@1/package.json" with { - type: "json", -}; -console.log(json); diff --git a/tests/specs/npm_tests/import_json/import_json/main.out b/tests/specs/npm_tests/import_json/import_json/main.out deleted file mode 100644 index 7db7ec4ea..000000000 --- a/tests/specs/npm_tests/import_json/import_json/main.out +++ /dev/null @@ -1,10 +0,0 @@ -{ - name: "@denotest/binary-package", - version: "1.0.0", - main: "index.js", - optionalDependencies: { - "@denotest/binary-package-linux": "1.0.0", - "@denotest/binary-package-mac": "1.0.0", - "@denotest/binary-package-windows": "1.0.0" - } -} diff --git a/tests/specs/npm_tests/import_map/__test__.jsonc b/tests/specs/npm_tests/import_map/__test__.jsonc deleted file mode 100644 index 822acbbe4..000000000 --- a/tests/specs/npm_tests/import_map/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --allow-env --import-map import_map/import_map.json import_map/main.js", - "output": "import_map/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/import_map/import_map/import_map.json b/tests/specs/npm_tests/import_map/import_map/import_map.json deleted file mode 100644 index 1c3baacd1..000000000 --- a/tests/specs/npm_tests/import_map/import_map/import_map.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "imports": { - "chalk": "npm:chalk@5", - "@denotest/": "npm:/@denotest/dual-cjs-esm/" - } -} diff --git a/tests/specs/npm_tests/import_map/import_map/main.js b/tests/specs/npm_tests/import_map/import_map/main.js deleted file mode 100644 index e354b7e92..000000000 --- a/tests/specs/npm_tests/import_map/import_map/main.js +++ /dev/null @@ -1,10 +0,0 @@ -import chalk from "chalk"; -import { getSubPathKind } from "@denotest/subpath/main.mjs"; - -console.log(chalk.green("chalk import map loads")); - -export function test(value) { - return chalk.red(value); -} - -console.log(getSubPathKind()); diff --git a/tests/specs/npm_tests/import_map/import_map/main.out b/tests/specs/npm_tests/import_map/import_map/main.out deleted file mode 100644 index 05f313d4e..000000000 --- a/tests/specs/npm_tests/import_map/import_map/main.out +++ /dev/null @@ -1,10 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/@denotest/dual-cjs-esm -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/dual-cjs-esm/1.0.0.tgz -Download http://localhost:4260/chalk/chalk-5.0.1.tgz -[UNORDERED_END] -chalk import map loads -esm diff --git a/tests/specs/npm_tests/imports_package_json/__test__.jsonc b/tests/specs/npm_tests/imports_package_json/__test__.jsonc deleted file mode 100644 index e11b92132..000000000 --- a/tests/specs/npm_tests/imports_package_json/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --no-lock --node-modules-dir=none imports_package_json/main.js", - "output": "imports_package_json/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.js b/tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.js deleted file mode 100644 index dc4d2df16..000000000 --- a/tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/import-not-defined"; - -console.log(data); diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.out b/tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.out deleted file mode 100644 index 70d1145a3..000000000 --- a/tests/specs/npm_tests/imports_package_json/imports_package_json/import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/main.js b/tests/specs/npm_tests/imports_package_json/imports_package_json/main.js deleted file mode 100644 index 53090dd94..000000000 --- a/tests/specs/npm_tests/imports_package_json/imports_package_json/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import data from "@denotest/imports-package-json"; - -console.log(data.hi); -console.log(data.bye); -console.log(typeof data.fs.readFile); -console.log(typeof data.path.join); -console.log(typeof data.fs2.writeFile); diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/main.out b/tests/specs/npm_tests/imports_package_json/imports_package_json/main.out deleted file mode 100644 index 979e35576..000000000 --- a/tests/specs/npm_tests/imports_package_json/imports_package_json/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -hi -bye -function -function -function diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/package.json b/tests/specs/npm_tests/imports_package_json/imports_package_json/package.json deleted file mode 100644 index cb6a08d1a..000000000 --- a/tests/specs/npm_tests/imports_package_json/imports_package_json/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "my-test", - "dependencies": { - "@denotest/imports-package-json": "1.0.0" - } -} diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.js deleted file mode 100644 index f1097aa06..000000000 --- a/tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/sub-path-import-not-defined"; - -console.log(data); diff --git a/tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.out deleted file mode 100644 index 7c803f2bf..000000000 --- a/tests/specs/npm_tests/imports_package_json/imports_package_json/sub_path_import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/__test__.jsonc b/tests/specs/npm_tests/imports_package_json_import_not_defined/__test__.jsonc deleted file mode 100644 index 0f094838c..000000000 --- a/tests/specs/npm_tests/imports_package_json_import_not_defined/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --no-lock --node-modules-dir=none imports_package_json/import_not_defined.js", - "output": "imports_package_json/import_not_defined.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js b/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js deleted file mode 100644 index dc4d2df16..000000000 --- a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/import-not-defined"; - -console.log(data); diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out b/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out deleted file mode 100644 index 70d1145a3..000000000 --- a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.js b/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.js deleted file mode 100644 index 53090dd94..000000000 --- a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import data from "@denotest/imports-package-json"; - -console.log(data.hi); -console.log(data.bye); -console.log(typeof data.fs.readFile); -console.log(typeof data.path.join); -console.log(typeof data.fs2.writeFile); diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.out b/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.out deleted file mode 100644 index 979e35576..000000000 --- a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -hi -bye -function -function -function diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/package.json b/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/package.json deleted file mode 100644 index cb6a08d1a..000000000 --- a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "my-test", - "dependencies": { - "@denotest/imports-package-json": "1.0.0" - } -} diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js deleted file mode 100644 index f1097aa06..000000000 --- a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/sub-path-import-not-defined"; - -console.log(data); diff --git a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out deleted file mode 100644 index 7c803f2bf..000000000 --- a/tests/specs/npm_tests/imports_package_json_import_not_defined/imports_package_json/sub_path_import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/__test__.jsonc b/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/__test__.jsonc deleted file mode 100644 index f862dc58e..000000000 --- a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --no-lock --node-modules-dir=none imports_package_json/sub_path_import_not_defined.js", - "output": "imports_package_json/sub_path_import_not_defined.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js b/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js deleted file mode 100644 index dc4d2df16..000000000 --- a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/import-not-defined"; - -console.log(data); diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out b/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out deleted file mode 100644 index 70d1145a3..000000000 --- a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#not-defined" is not defined in package [WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js b/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js deleted file mode 100644 index 53090dd94..000000000 --- a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import data from "@denotest/imports-package-json"; - -console.log(data.hi); -console.log(data.bye); -console.log(typeof data.fs.readFile); -console.log(typeof data.path.join); -console.log(typeof data.fs2.writeFile); diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out b/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out deleted file mode 100644 index 979e35576..000000000 --- a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -hi -bye -function -function -function diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json b/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json deleted file mode 100644 index cb6a08d1a..000000000 --- a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "my-test", - "dependencies": { - "@denotest/imports-package-json": "1.0.0" - } -} diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js b/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js deleted file mode 100644 index f1097aa06..000000000 --- a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.js +++ /dev/null @@ -1,3 +0,0 @@ -import data from "@denotest/imports-package-json/sub-path-import-not-defined"; - -console.log(data); diff --git a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out b/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out deleted file mode 100644 index 7c803f2bf..000000000 --- a/tests/specs/npm_tests/imports_package_json_sub_path_import_not_defined/imports_package_json/sub_path_import_not_defined.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/imports-package-json -Download http://localhost:4260/@denotest/imports-package-json/1.0.0.tgz -error: [ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier "#hi" is not defined in package [WILDCARD]sub_path[WILDCARD]package.json imported from '[WILDCARD]import_not_defined.js' diff --git a/tests/specs/npm_tests/info_chalk_display/__test__.jsonc b/tests/specs/npm_tests/info_chalk_display/__test__.jsonc deleted file mode 100644 index 998aa6f1d..000000000 --- a/tests/specs/npm_tests/info_chalk_display/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "info --quiet cjs_with_deps/main.js", - "output": "cjs_with_deps/main_info.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.js b/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.js deleted file mode 100644 index 568726874..000000000 --- a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.js +++ /dev/null @@ -1,12 +0,0 @@ -import chalk from "npm:chalk@4"; -import { expect } from "npm:chai@4.3"; - -console.log(chalk.green("chalk cjs loads")); - -const timeout = setTimeout(() => {}, 0); -expect(timeout).to.be.a("number"); -clearTimeout(timeout); - -const interval = setInterval(() => {}, 100); -expect(interval).to.be.a("number"); -clearInterval(interval); diff --git a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.out b/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.out deleted file mode 100644 index 7051c2395..000000000 --- a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main.out +++ /dev/null @@ -1,33 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info.out b/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info.out deleted file mode 100644 index 8e37c88eb..000000000 --- a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info.out +++ /dev/null @@ -1,22 +0,0 @@ -local: [WILDCARD]main.js -type: JavaScript -dependencies: 14 unique -size: [WILDCARD] - -file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) -├─┬ npm:/chalk@4.1.2 ([WILDCARD]) -│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) -│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) -│ └── npm:/has-flag@4.0.0 ([WILDCARD]) -└─┬ npm:/chai@4.3.6 ([WILDCARD]) - ├── npm:/assertion-error@1.1.0 ([WILDCARD]) - ├── npm:/check-error@1.0.2 ([WILDCARD]) - ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) - │ └── npm:/type-detect@4.0.8 ([WILDCARD]) - ├── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) - │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├── npm:/pathval@1.1.1 ([WILDCARD]) - └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info_json.out b/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info_json.out deleted file mode 100644 index af1ef1351..000000000 --- a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_info_json.out +++ /dev/null @@ -1,148 +0,0 @@ -{ - "roots": [ - "file://[WILDCARD]/main.js" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:chalk@4", - "code": { - "specifier": "npm:chalk@4", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 31 - } - } - }, - "npmPackage": "chalk@4.1.2" - }, - { - "specifier": "npm:chai@4.3", - "code": { - "specifier": "npm:chai@4.3", - "span": { - "start": { - "line": 1, - "character": 23 - }, - "end": { - "line": 1, - "character": 37 - } - } - }, - "npmPackage": "chai@4.3.6" - } - ], - "local": "[WILDCARD]main.js", - "size": 325, - "mediaType": "JavaScript", - "specifier": "[WILDCARD]/main.js" - } - ], - "redirects": { - "npm:chai@4.3": "npm:/chai@4.3.6", - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "version": 1, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "assertion-error@1.1.0": { - "name": "assertion-error", - "version": "1.1.0", - "dependencies": [] - }, - "chai@4.3.6": { - "name": "chai", - "version": "4.3.6", - "dependencies": [ - "assertion-error@1.1.0", - "check-error@1.0.2", - "deep-eql@3.0.1", - "get-func-name@2.0.0", - "loupe@2.3.4", - "pathval@1.1.1", - "type-detect@4.0.8" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "check-error@1.0.2": { - "name": "check-error", - "version": "1.0.2", - "dependencies": [] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "deep-eql@3.0.1": { - "name": "deep-eql", - "version": "3.0.1", - "dependencies": [ - "type-detect@4.0.8" - ] - }, - "get-func-name@2.0.0": { - "name": "get-func-name", - "version": "2.0.0", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "loupe@2.3.4": { - "name": "loupe", - "version": "2.3.4", - "dependencies": [ - "get-func-name@2.0.0" - ] - }, - "pathval@1.1.1": { - "name": "pathval", - "version": "1.1.1", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - }, - "type-detect@4.0.8": { - "name": "type-detect", - "version": "4.0.8", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_node_modules.out b/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_node_modules.out deleted file mode 100644 index 1ab367952..000000000 --- a/tests/specs/npm_tests/info_chalk_display/cjs_with_deps/main_node_modules.out +++ /dev/null @@ -1,47 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Initialize assertion-error@1.1.0 -Download http://localhost:4260/chai/chai-4.3.6.tgz -Initialize chai@4.3.6 -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Initialize chalk@4.1.2 -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Initialize check-error@1.0.2 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Initialize deep-eql@3.0.1 -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Initialize get-func-name@2.0.0 -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Initialize has-flag@4.0.0 -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Initialize loupe@2.3.4 -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Initialize pathval@1.1.1 -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Initialize supports-color@7.2.0 -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Initialize type-detect@4.0.8 -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/__test__.jsonc b/tests/specs/npm_tests/info_chalk_display_node_modules_dir/__test__.jsonc deleted file mode 100644 index 5dd35f5a4..000000000 --- a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "info --quiet --node-modules-dir cjs_with_deps/main.js", - "output": "cjs_with_deps/main_info.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.js b/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.js deleted file mode 100644 index 568726874..000000000 --- a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.js +++ /dev/null @@ -1,12 +0,0 @@ -import chalk from "npm:chalk@4"; -import { expect } from "npm:chai@4.3"; - -console.log(chalk.green("chalk cjs loads")); - -const timeout = setTimeout(() => {}, 0); -expect(timeout).to.be.a("number"); -clearTimeout(timeout); - -const interval = setInterval(() => {}, 100); -expect(interval).to.be.a("number"); -clearInterval(interval); diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.out b/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.out deleted file mode 100644 index 7051c2395..000000000 --- a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main.out +++ /dev/null @@ -1,33 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out b/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out deleted file mode 100644 index 8e37c88eb..000000000 --- a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info.out +++ /dev/null @@ -1,22 +0,0 @@ -local: [WILDCARD]main.js -type: JavaScript -dependencies: 14 unique -size: [WILDCARD] - -file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) -├─┬ npm:/chalk@4.1.2 ([WILDCARD]) -│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) -│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) -│ └── npm:/has-flag@4.0.0 ([WILDCARD]) -└─┬ npm:/chai@4.3.6 ([WILDCARD]) - ├── npm:/assertion-error@1.1.0 ([WILDCARD]) - ├── npm:/check-error@1.0.2 ([WILDCARD]) - ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) - │ └── npm:/type-detect@4.0.8 ([WILDCARD]) - ├── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) - │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├── npm:/pathval@1.1.1 ([WILDCARD]) - └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out b/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out deleted file mode 100644 index af1ef1351..000000000 --- a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_info_json.out +++ /dev/null @@ -1,148 +0,0 @@ -{ - "roots": [ - "file://[WILDCARD]/main.js" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:chalk@4", - "code": { - "specifier": "npm:chalk@4", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 31 - } - } - }, - "npmPackage": "chalk@4.1.2" - }, - { - "specifier": "npm:chai@4.3", - "code": { - "specifier": "npm:chai@4.3", - "span": { - "start": { - "line": 1, - "character": 23 - }, - "end": { - "line": 1, - "character": 37 - } - } - }, - "npmPackage": "chai@4.3.6" - } - ], - "local": "[WILDCARD]main.js", - "size": 325, - "mediaType": "JavaScript", - "specifier": "[WILDCARD]/main.js" - } - ], - "redirects": { - "npm:chai@4.3": "npm:/chai@4.3.6", - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "version": 1, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "assertion-error@1.1.0": { - "name": "assertion-error", - "version": "1.1.0", - "dependencies": [] - }, - "chai@4.3.6": { - "name": "chai", - "version": "4.3.6", - "dependencies": [ - "assertion-error@1.1.0", - "check-error@1.0.2", - "deep-eql@3.0.1", - "get-func-name@2.0.0", - "loupe@2.3.4", - "pathval@1.1.1", - "type-detect@4.0.8" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "check-error@1.0.2": { - "name": "check-error", - "version": "1.0.2", - "dependencies": [] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "deep-eql@3.0.1": { - "name": "deep-eql", - "version": "3.0.1", - "dependencies": [ - "type-detect@4.0.8" - ] - }, - "get-func-name@2.0.0": { - "name": "get-func-name", - "version": "2.0.0", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "loupe@2.3.4": { - "name": "loupe", - "version": "2.3.4", - "dependencies": [ - "get-func-name@2.0.0" - ] - }, - "pathval@1.1.1": { - "name": "pathval", - "version": "1.1.1", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - }, - "type-detect@4.0.8": { - "name": "type-detect", - "version": "4.0.8", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out b/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out deleted file mode 100644 index 1ab367952..000000000 --- a/tests/specs/npm_tests/info_chalk_display_node_modules_dir/cjs_with_deps/main_node_modules.out +++ /dev/null @@ -1,47 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Initialize assertion-error@1.1.0 -Download http://localhost:4260/chai/chai-4.3.6.tgz -Initialize chai@4.3.6 -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Initialize chalk@4.1.2 -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Initialize check-error@1.0.2 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Initialize deep-eql@3.0.1 -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Initialize get-func-name@2.0.0 -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Initialize has-flag@4.0.0 -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Initialize loupe@2.3.4 -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Initialize pathval@1.1.1 -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Initialize supports-color@7.2.0 -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Initialize type-detect@4.0.8 -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/info_chalk_json/__test__.jsonc b/tests/specs/npm_tests/info_chalk_json/__test__.jsonc deleted file mode 100644 index 12c8b9b61..000000000 --- a/tests/specs/npm_tests/info_chalk_json/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "info --quiet --json cjs_with_deps/main.js", - "output": "cjs_with_deps/main_info_json.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.js b/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.js deleted file mode 100644 index 568726874..000000000 --- a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.js +++ /dev/null @@ -1,12 +0,0 @@ -import chalk from "npm:chalk@4"; -import { expect } from "npm:chai@4.3"; - -console.log(chalk.green("chalk cjs loads")); - -const timeout = setTimeout(() => {}, 0); -expect(timeout).to.be.a("number"); -clearTimeout(timeout); - -const interval = setInterval(() => {}, 100); -expect(interval).to.be.a("number"); -clearInterval(interval); diff --git a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.out b/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.out deleted file mode 100644 index 7051c2395..000000000 --- a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main.out +++ /dev/null @@ -1,33 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info.out b/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info.out deleted file mode 100644 index 8e37c88eb..000000000 --- a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info.out +++ /dev/null @@ -1,22 +0,0 @@ -local: [WILDCARD]main.js -type: JavaScript -dependencies: 14 unique -size: [WILDCARD] - -file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) -├─┬ npm:/chalk@4.1.2 ([WILDCARD]) -│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) -│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) -│ └── npm:/has-flag@4.0.0 ([WILDCARD]) -└─┬ npm:/chai@4.3.6 ([WILDCARD]) - ├── npm:/assertion-error@1.1.0 ([WILDCARD]) - ├── npm:/check-error@1.0.2 ([WILDCARD]) - ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) - │ └── npm:/type-detect@4.0.8 ([WILDCARD]) - ├── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) - │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├── npm:/pathval@1.1.1 ([WILDCARD]) - └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info_json.out b/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info_json.out deleted file mode 100644 index af1ef1351..000000000 --- a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_info_json.out +++ /dev/null @@ -1,148 +0,0 @@ -{ - "roots": [ - "file://[WILDCARD]/main.js" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:chalk@4", - "code": { - "specifier": "npm:chalk@4", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 31 - } - } - }, - "npmPackage": "chalk@4.1.2" - }, - { - "specifier": "npm:chai@4.3", - "code": { - "specifier": "npm:chai@4.3", - "span": { - "start": { - "line": 1, - "character": 23 - }, - "end": { - "line": 1, - "character": 37 - } - } - }, - "npmPackage": "chai@4.3.6" - } - ], - "local": "[WILDCARD]main.js", - "size": 325, - "mediaType": "JavaScript", - "specifier": "[WILDCARD]/main.js" - } - ], - "redirects": { - "npm:chai@4.3": "npm:/chai@4.3.6", - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "version": 1, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "assertion-error@1.1.0": { - "name": "assertion-error", - "version": "1.1.0", - "dependencies": [] - }, - "chai@4.3.6": { - "name": "chai", - "version": "4.3.6", - "dependencies": [ - "assertion-error@1.1.0", - "check-error@1.0.2", - "deep-eql@3.0.1", - "get-func-name@2.0.0", - "loupe@2.3.4", - "pathval@1.1.1", - "type-detect@4.0.8" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "check-error@1.0.2": { - "name": "check-error", - "version": "1.0.2", - "dependencies": [] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "deep-eql@3.0.1": { - "name": "deep-eql", - "version": "3.0.1", - "dependencies": [ - "type-detect@4.0.8" - ] - }, - "get-func-name@2.0.0": { - "name": "get-func-name", - "version": "2.0.0", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "loupe@2.3.4": { - "name": "loupe", - "version": "2.3.4", - "dependencies": [ - "get-func-name@2.0.0" - ] - }, - "pathval@1.1.1": { - "name": "pathval", - "version": "1.1.1", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - }, - "type-detect@4.0.8": { - "name": "type-detect", - "version": "4.0.8", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_node_modules.out b/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_node_modules.out deleted file mode 100644 index 1ab367952..000000000 --- a/tests/specs/npm_tests/info_chalk_json/cjs_with_deps/main_node_modules.out +++ /dev/null @@ -1,47 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Initialize assertion-error@1.1.0 -Download http://localhost:4260/chai/chai-4.3.6.tgz -Initialize chai@4.3.6 -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Initialize chalk@4.1.2 -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Initialize check-error@1.0.2 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Initialize deep-eql@3.0.1 -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Initialize get-func-name@2.0.0 -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Initialize has-flag@4.0.0 -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Initialize loupe@2.3.4 -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Initialize pathval@1.1.1 -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Initialize supports-color@7.2.0 -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Initialize type-detect@4.0.8 -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/__test__.jsonc b/tests/specs/npm_tests/info_chalk_json_node_modules_dir/__test__.jsonc deleted file mode 100644 index 1b34f4813..000000000 --- a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "info --quiet --node-modules-dir --json cjs_with_deps/main.js", - "output": "cjs_with_deps/main_info_json.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.js b/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.js deleted file mode 100644 index 568726874..000000000 --- a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.js +++ /dev/null @@ -1,12 +0,0 @@ -import chalk from "npm:chalk@4"; -import { expect } from "npm:chai@4.3"; - -console.log(chalk.green("chalk cjs loads")); - -const timeout = setTimeout(() => {}, 0); -expect(timeout).to.be.a("number"); -clearTimeout(timeout); - -const interval = setInterval(() => {}, 100); -expect(interval).to.be.a("number"); -clearInterval(interval); diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.out b/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.out deleted file mode 100644 index 7051c2395..000000000 --- a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main.out +++ /dev/null @@ -1,33 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out b/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out deleted file mode 100644 index 8e37c88eb..000000000 --- a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info.out +++ /dev/null @@ -1,22 +0,0 @@ -local: [WILDCARD]main.js -type: JavaScript -dependencies: 14 unique -size: [WILDCARD] - -file:///[WILDCARD]/cjs_with_deps/main.js ([WILDCARD]) -├─┬ npm:/chalk@4.1.2 ([WILDCARD]) -│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) -│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) -│ └── npm:/has-flag@4.0.0 ([WILDCARD]) -└─┬ npm:/chai@4.3.6 ([WILDCARD]) - ├── npm:/assertion-error@1.1.0 ([WILDCARD]) - ├── npm:/check-error@1.0.2 ([WILDCARD]) - ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) - │ └── npm:/type-detect@4.0.8 ([WILDCARD]) - ├── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) - │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├── npm:/pathval@1.1.1 ([WILDCARD]) - └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out b/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out deleted file mode 100644 index af1ef1351..000000000 --- a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_info_json.out +++ /dev/null @@ -1,148 +0,0 @@ -{ - "roots": [ - "file://[WILDCARD]/main.js" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:chalk@4", - "code": { - "specifier": "npm:chalk@4", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 31 - } - } - }, - "npmPackage": "chalk@4.1.2" - }, - { - "specifier": "npm:chai@4.3", - "code": { - "specifier": "npm:chai@4.3", - "span": { - "start": { - "line": 1, - "character": 23 - }, - "end": { - "line": 1, - "character": 37 - } - } - }, - "npmPackage": "chai@4.3.6" - } - ], - "local": "[WILDCARD]main.js", - "size": 325, - "mediaType": "JavaScript", - "specifier": "[WILDCARD]/main.js" - } - ], - "redirects": { - "npm:chai@4.3": "npm:/chai@4.3.6", - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "version": 1, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "assertion-error@1.1.0": { - "name": "assertion-error", - "version": "1.1.0", - "dependencies": [] - }, - "chai@4.3.6": { - "name": "chai", - "version": "4.3.6", - "dependencies": [ - "assertion-error@1.1.0", - "check-error@1.0.2", - "deep-eql@3.0.1", - "get-func-name@2.0.0", - "loupe@2.3.4", - "pathval@1.1.1", - "type-detect@4.0.8" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "check-error@1.0.2": { - "name": "check-error", - "version": "1.0.2", - "dependencies": [] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "deep-eql@3.0.1": { - "name": "deep-eql", - "version": "3.0.1", - "dependencies": [ - "type-detect@4.0.8" - ] - }, - "get-func-name@2.0.0": { - "name": "get-func-name", - "version": "2.0.0", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "loupe@2.3.4": { - "name": "loupe", - "version": "2.3.4", - "dependencies": [ - "get-func-name@2.0.0" - ] - }, - "pathval@1.1.1": { - "name": "pathval", - "version": "1.1.1", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - }, - "type-detect@4.0.8": { - "name": "type-detect", - "version": "4.0.8", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out b/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out deleted file mode 100644 index 1ab367952..000000000 --- a/tests/specs/npm_tests/info_chalk_json_node_modules_dir/cjs_with_deps/main_node_modules.out +++ /dev/null @@ -1,47 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Initialize assertion-error@1.1.0 -Download http://localhost:4260/chai/chai-4.3.6.tgz -Initialize chai@4.3.6 -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Initialize chalk@4.1.2 -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Initialize check-error@1.0.2 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Initialize deep-eql@3.0.1 -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Initialize get-func-name@2.0.0 -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Initialize has-flag@4.0.0 -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Initialize loupe@2.3.4 -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Initialize pathval@1.1.1 -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Initialize supports-color@7.2.0 -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Initialize type-detect@4.0.8 -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/info_cli_chalk_display/__test__.jsonc b/tests/specs/npm_tests/info_cli_chalk_display/__test__.jsonc deleted file mode 100644 index 7587fbcb6..000000000 --- a/tests/specs/npm_tests/info_cli_chalk_display/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "info --quiet npm:chalk@4", - "output": "info/chalk.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/info_cli_chalk_display/info/chalk.out b/tests/specs/npm_tests/info_cli_chalk_display/info/chalk.out deleted file mode 100644 index 63fa20da5..000000000 --- a/tests/specs/npm_tests/info_cli_chalk_display/info/chalk.out +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: 5 unique -size: [WILDCARD] - -npm:/chalk@4.1.2 ([WILDCARD]) -├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ └── npm:/color-name@1.1.4 ([WILDCARD]) -└─┬ npm:/supports-color@7.2.0 ([WILDCARD]) - └── npm:/has-flag@4.0.0 ([WILDCARD]) diff --git a/tests/specs/npm_tests/info_cli_chalk_display/info/chalk_json.out b/tests/specs/npm_tests/info_cli_chalk_display/info/chalk_json.out deleted file mode 100644 index d54155270..000000000 --- a/tests/specs/npm_tests/info_cli_chalk_display/info/chalk_json.out +++ /dev/null @@ -1,57 +0,0 @@ -{ - "roots": [ - "npm:chalk@4" - ], - "modules": [ - { - "kind": "npm", - "specifier": "npm:/chalk@4.1.2", - "npmPackage": "chalk@4.1.2" - } - ], - "redirects": { - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "version": 1, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - } - } -} diff --git a/tests/specs/npm_tests/info_cli_chalk_json/__test__.jsonc b/tests/specs/npm_tests/info_cli_chalk_json/__test__.jsonc deleted file mode 100644 index b5173fd93..000000000 --- a/tests/specs/npm_tests/info_cli_chalk_json/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "info --quiet --json npm:chalk@4", - "output": "info/chalk_json.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/info_cli_chalk_json/info/chalk.out b/tests/specs/npm_tests/info_cli_chalk_json/info/chalk.out deleted file mode 100644 index 63fa20da5..000000000 --- a/tests/specs/npm_tests/info_cli_chalk_json/info/chalk.out +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: 5 unique -size: [WILDCARD] - -npm:/chalk@4.1.2 ([WILDCARD]) -├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ └── npm:/color-name@1.1.4 ([WILDCARD]) -└─┬ npm:/supports-color@7.2.0 ([WILDCARD]) - └── npm:/has-flag@4.0.0 ([WILDCARD]) diff --git a/tests/specs/npm_tests/info_cli_chalk_json/info/chalk_json.out b/tests/specs/npm_tests/info_cli_chalk_json/info/chalk_json.out deleted file mode 100644 index d54155270..000000000 --- a/tests/specs/npm_tests/info_cli_chalk_json/info/chalk_json.out +++ /dev/null @@ -1,57 +0,0 @@ -{ - "roots": [ - "npm:chalk@4" - ], - "modules": [ - { - "kind": "npm", - "specifier": "npm:/chalk@4.1.2", - "npmPackage": "chalk@4.1.2" - } - ], - "redirects": { - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "version": 1, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - } - } -} diff --git a/tests/specs/npm_tests/info_peer_deps/__test__.jsonc b/tests/specs/npm_tests/info_peer_deps/__test__.jsonc deleted file mode 100644 index e505f3077..000000000 --- a/tests/specs/npm_tests/info_peer_deps/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "info --quiet peer_deps_with_copied_folders/main.ts", - "output": "peer_deps_with_copied_folders/main_info.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.out b/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.out deleted file mode 100644 index 3c133bcde..000000000 --- a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.out +++ /dev/null @@ -1,14 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.ts b/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.ts deleted file mode 100644 index a8ea8104a..000000000 --- a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import version1 from "npm:@denotest/peer-dep-test-child@1"; -import version2 from "npm:@denotest/peer-dep-test-child@2"; - -console.error(version1); -console.error(version2); diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info.out b/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info.out deleted file mode 100644 index e8b92399d..000000000 --- a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info.out +++ /dev/null @@ -1,14 +0,0 @@ -local: [WILDCARD]main.ts -type: TypeScript -dependencies: 6 unique -size: [WILDCARD] - -file:///[WILDCARD]/peer_deps_with_copied_folders/main.ts (171B) -├─┬ npm:/@denotest/peer-dep-test-child@1.0.0 ([WILDCARD]) -│ ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0 ([WILDCARD]) -│ │ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) -│ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) -└─┬ npm:/@denotest/peer-dep-test-child@2.0.0 ([WILDCARD]) - ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0 ([WILDCARD]) - │ └── npm:/@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) - └── npm:/@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out b/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out deleted file mode 100644 index 1a5f07c97..000000000 --- a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_info_json.out +++ /dev/null @@ -1,97 +0,0 @@ -{ - "roots": [ - "[WILDCARD]/peer_deps_with_copied_folders/main.ts" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:@denotest/peer-dep-test-child@1", - "code": { - "specifier": "npm:@denotest/peer-dep-test-child@1", - "span": { - "start": { - "line": 0, - "character": 21 - }, - "end": { - "line": 0, - "character": 58 - } - } - }, - "npmPackage": "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0" - }, - { - "specifier": "npm:@denotest/peer-dep-test-child@2", - "code": { - "specifier": "npm:@denotest/peer-dep-test-child@2", - "span": { - "start": { - "line": 1, - "character": 21 - }, - "end": { - "line": 1, - "character": 58 - } - } - }, - "npmPackage": "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0" - } - ], - "local": "[WILDCARD]main.ts", - "size": 171, - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/main.ts" - } - ], - "redirects": { - "npm:@denotest/peer-dep-test-child@1": "npm:/@denotest/peer-dep-test-child@1.0.0", - "npm:@denotest/peer-dep-test-child@2": "npm:/@denotest/peer-dep-test-child@2.0.0" - }, - "version": 1, - "npmPackages": { - "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { - "name": "@denotest/peer-dep-test-child", - "version": "1.0.0", - "dependencies": [ - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0", - "@denotest/peer-dep-test-peer@1.0.0" - ] - }, - "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0": { - "name": "@denotest/peer-dep-test-child", - "version": "2.0.0", - "dependencies": [ - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0", - "@denotest/peer-dep-test-peer@2.0.0" - ] - }, - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { - "name": "@denotest/peer-dep-test-grandchild", - "version": "1.0.0", - "dependencies": [ - "@denotest/peer-dep-test-peer@1.0.0" - ] - }, - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0": { - "name": "@denotest/peer-dep-test-grandchild", - "version": "1.0.0", - "dependencies": [ - "@denotest/peer-dep-test-peer@2.0.0" - ] - }, - "@denotest/peer-dep-test-peer@1.0.0": { - "name": "@denotest/peer-dep-test-peer", - "version": "1.0.0", - "dependencies": [] - }, - "@denotest/peer-dep-test-peer@2.0.0": { - "name": "@denotest/peer-dep-test-peer", - "version": "2.0.0", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out b/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out deleted file mode 100644 index 02b5cbafd..000000000 --- a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules.out +++ /dev/null @@ -1,9 +0,0 @@ -[UNORDERED_START] -Initialize @denotest/peer-dep-test-child@1.0.0 -Initialize @denotest/peer-dep-test-child@2.0.0 -Initialize @denotest/peer-dep-test-grandchild@1.0.0 -Initialize @denotest/peer-dep-test-peer@1.0.0 -Initialize @denotest/peer-dep-test-peer@2.0.0 -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out deleted file mode 100644 index 9c8145211..000000000 --- a/tests/specs/npm_tests/info_peer_deps/peer_deps_with_copied_folders/main_node_modules_reload.out +++ /dev/null @@ -1,19 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz -Initialize @denotest/peer-dep-test-child@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz -Initialize @denotest/peer-dep-test-child@2.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz -Initialize @denotest/peer-dep-test-grandchild@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz -Initialize @denotest/peer-dep-test-peer@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz -Initialize @denotest/peer-dep-test-peer@2.0.0 -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm_tests/info_peer_deps_json/__test__.jsonc b/tests/specs/npm_tests/info_peer_deps_json/__test__.jsonc deleted file mode 100644 index 9a630add4..000000000 --- a/tests/specs/npm_tests/info_peer_deps_json/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "info --quiet --json peer_deps_with_copied_folders/main.ts", - "output": "peer_deps_with_copied_folders/main_info_json.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.out b/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.out deleted file mode 100644 index 3c133bcde..000000000 --- a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.out +++ /dev/null @@ -1,14 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz -Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.ts b/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.ts deleted file mode 100644 index a8ea8104a..000000000 --- a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import version1 from "npm:@denotest/peer-dep-test-child@1"; -import version2 from "npm:@denotest/peer-dep-test-child@2"; - -console.error(version1); -console.error(version2); diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out b/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out deleted file mode 100644 index e8b92399d..000000000 --- a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info.out +++ /dev/null @@ -1,14 +0,0 @@ -local: [WILDCARD]main.ts -type: TypeScript -dependencies: 6 unique -size: [WILDCARD] - -file:///[WILDCARD]/peer_deps_with_copied_folders/main.ts (171B) -├─┬ npm:/@denotest/peer-dep-test-child@1.0.0 ([WILDCARD]) -│ ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0 ([WILDCARD]) -│ │ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) -│ └── npm:/@denotest/peer-dep-test-peer@1.0.0 ([WILDCARD]) -└─┬ npm:/@denotest/peer-dep-test-child@2.0.0 ([WILDCARD]) - ├─┬ npm:/@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0 ([WILDCARD]) - │ └── npm:/@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) - └── npm:/@denotest/peer-dep-test-peer@2.0.0 ([WILDCARD]) diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out b/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out deleted file mode 100644 index 1a5f07c97..000000000 --- a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_info_json.out +++ /dev/null @@ -1,97 +0,0 @@ -{ - "roots": [ - "[WILDCARD]/peer_deps_with_copied_folders/main.ts" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:@denotest/peer-dep-test-child@1", - "code": { - "specifier": "npm:@denotest/peer-dep-test-child@1", - "span": { - "start": { - "line": 0, - "character": 21 - }, - "end": { - "line": 0, - "character": 58 - } - } - }, - "npmPackage": "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0" - }, - { - "specifier": "npm:@denotest/peer-dep-test-child@2", - "code": { - "specifier": "npm:@denotest/peer-dep-test-child@2", - "span": { - "start": { - "line": 1, - "character": 21 - }, - "end": { - "line": 1, - "character": 58 - } - } - }, - "npmPackage": "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0" - } - ], - "local": "[WILDCARD]main.ts", - "size": 171, - "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/main.ts" - } - ], - "redirects": { - "npm:@denotest/peer-dep-test-child@1": "npm:/@denotest/peer-dep-test-child@1.0.0", - "npm:@denotest/peer-dep-test-child@2": "npm:/@denotest/peer-dep-test-child@2.0.0" - }, - "version": 1, - "npmPackages": { - "@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { - "name": "@denotest/peer-dep-test-child", - "version": "1.0.0", - "dependencies": [ - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0", - "@denotest/peer-dep-test-peer@1.0.0" - ] - }, - "@denotest/peer-dep-test-child@2.0.0_@denotest+peer-dep-test-peer@2.0.0": { - "name": "@denotest/peer-dep-test-child", - "version": "2.0.0", - "dependencies": [ - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0", - "@denotest/peer-dep-test-peer@2.0.0" - ] - }, - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@1.0.0": { - "name": "@denotest/peer-dep-test-grandchild", - "version": "1.0.0", - "dependencies": [ - "@denotest/peer-dep-test-peer@1.0.0" - ] - }, - "@denotest/peer-dep-test-grandchild@1.0.0_@denotest+peer-dep-test-peer@2.0.0": { - "name": "@denotest/peer-dep-test-grandchild", - "version": "1.0.0", - "dependencies": [ - "@denotest/peer-dep-test-peer@2.0.0" - ] - }, - "@denotest/peer-dep-test-peer@1.0.0": { - "name": "@denotest/peer-dep-test-peer", - "version": "1.0.0", - "dependencies": [] - }, - "@denotest/peer-dep-test-peer@2.0.0": { - "name": "@denotest/peer-dep-test-peer", - "version": "2.0.0", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out b/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out deleted file mode 100644 index 02b5cbafd..000000000 --- a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules.out +++ /dev/null @@ -1,9 +0,0 @@ -[UNORDERED_START] -Initialize @denotest/peer-dep-test-child@1.0.0 -Initialize @denotest/peer-dep-test-child@2.0.0 -Initialize @denotest/peer-dep-test-grandchild@1.0.0 -Initialize @denotest/peer-dep-test-peer@1.0.0 -Initialize @denotest/peer-dep-test-peer@2.0.0 -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out b/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out deleted file mode 100644 index 9c8145211..000000000 --- a/tests/specs/npm_tests/info_peer_deps_json/peer_deps_with_copied_folders/main_node_modules_reload.out +++ /dev/null @@ -1,19 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child -Download http://localhost:4260/@denotest/peer-dep-test-grandchild -Download http://localhost:4260/@denotest/peer-dep-test-peer -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/peer-dep-test-child/1.0.0.tgz -Initialize @denotest/peer-dep-test-child@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-child/2.0.0.tgz -Initialize @denotest/peer-dep-test-child@2.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-grandchild/1.0.0.tgz -Initialize @denotest/peer-dep-test-grandchild@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-peer/1.0.0.tgz -Initialize @denotest/peer-dep-test-peer@1.0.0 -Download http://localhost:4260/@denotest/peer-dep-test-peer/2.0.0.tgz -Initialize @denotest/peer-dep-test-peer@2.0.0 -[UNORDERED_END] -1 -2 diff --git a/tests/specs/npm_tests/mixed_case_package_name_global_dir/__test__.jsonc b/tests/specs/npm_tests/mixed_case_package_name_global_dir/__test__.jsonc deleted file mode 100644 index cc9359aab..000000000 --- a/tests/specs/npm_tests/mixed_case_package_name_global_dir/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run mixed_case_package_name/global.ts", - "output": "mixed_case_package_name/global.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.out b/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.out deleted file mode 100644 index fdacea385..000000000 --- a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.out +++ /dev/null @@ -1,9 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz -Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz -[UNORDERED_END] -5 diff --git a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts b/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts deleted file mode 100644 index a721b3d78..000000000 --- a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/global.ts +++ /dev/null @@ -1,2 +0,0 @@ -import value from "npm:@denotest/MixedCase"; -console.log(value); diff --git a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.out b/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.out deleted file mode 100644 index 6ab989d80..000000000 --- a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.out +++ /dev/null @@ -1,13 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz -Initialize @denotest/CAPITALS@1.0.0 -Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz -Initialize @denotest/MixedCase@1.0.0 -[UNORDERED_END] -5 -true -true diff --git a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts b/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts deleted file mode 100644 index 6ca6cb581..000000000 --- a/tests/specs/npm_tests/mixed_case_package_name_global_dir/mixed_case_package_name/local.ts +++ /dev/null @@ -1,18 +0,0 @@ -import value from "npm:@denotest/MixedCase"; -console.log(value); -console.log(pathExists("./node_modules/.deno")); -console.log( - pathExists("./node_modules/.deno/_ibsgk3tporsxg5bpinavaskuifgfg@1.0.0"), -); - -function pathExists(filePath: string) { - try { - Deno.lstatSync(filePath); - return true; - } catch (error) { - if (error instanceof Deno.errors.NotFound) { - return false; - } - throw error; - } -} diff --git a/tests/specs/npm_tests/mixed_case_package_name_local_dir/__test__.jsonc b/tests/specs/npm_tests/mixed_case_package_name_local_dir/__test__.jsonc deleted file mode 100644 index 0778cb562..000000000 --- a/tests/specs/npm_tests/mixed_case_package_name_local_dir/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --node-modules-dir=auto -A mixed_case_package_name/local.ts", - "output": "mixed_case_package_name/local.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.out b/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.out deleted file mode 100644 index fdacea385..000000000 --- a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.out +++ /dev/null @@ -1,9 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz -Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz -[UNORDERED_END] -5 diff --git a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts b/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts deleted file mode 100644 index a721b3d78..000000000 --- a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/global.ts +++ /dev/null @@ -1,2 +0,0 @@ -import value from "npm:@denotest/MixedCase"; -console.log(value); diff --git a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.out b/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.out deleted file mode 100644 index 6ab989d80..000000000 --- a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.out +++ /dev/null @@ -1,13 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/MixedCase -Download http://localhost:4260/@denotest/CAPITALS -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/CAPITALS/1.0.0.tgz -Initialize @denotest/CAPITALS@1.0.0 -Download http://localhost:4260/@denotest/MixedCase/1.0.0.tgz -Initialize @denotest/MixedCase@1.0.0 -[UNORDERED_END] -5 -true -true diff --git a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts b/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts deleted file mode 100644 index 6ca6cb581..000000000 --- a/tests/specs/npm_tests/mixed_case_package_name_local_dir/mixed_case_package_name/local.ts +++ /dev/null @@ -1,18 +0,0 @@ -import value from "npm:@denotest/MixedCase"; -console.log(value); -console.log(pathExists("./node_modules/.deno")); -console.log( - pathExists("./node_modules/.deno/_ibsgk3tporsxg5bpinavaskuifgfg@1.0.0"), -); - -function pathExists(filePath: string) { - try { - Deno.lstatSync(filePath); - return true; - } catch (error) { - if (error instanceof Deno.errors.NotFound) { - return false; - } - throw error; - } -} diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules/__test__.jsonc b/tests/specs/npm_tests/node_modules_deno_node_modules/__test__.jsonc deleted file mode 100644 index 377fd05ea..000000000 --- a/tests/specs/npm_tests/node_modules_deno_node_modules/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --quiet node_modules_deno_node_modules/main.ts", - "output": "node_modules_deno_node_modules/main.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out b/tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out deleted file mode 100644 index 1ebdb2dd5..000000000 --- a/tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.out +++ /dev/null @@ -1,2 +0,0 @@ -esm -esm diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts b/tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts deleted file mode 100644 index 6e4a32d8e..000000000 --- a/tests/specs/npm_tests/node_modules_deno_node_modules/node_modules_deno_node_modules/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { getKind as getKind1 } from "npm:@denotest/dual-cjs-esm-dep"; -// this should still be able to be resolved even though it's missing the -// "@denotest/dual-cjs-esm" package because the above import will resolve it -import { getKind as getKind2 } from "npm:@denotest/dual-cjs-esm-dep-missing"; - -console.log(getKind1()); -console.log(getKind2()); diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules_local/__test__.jsonc b/tests/specs/npm_tests/node_modules_deno_node_modules_local/__test__.jsonc deleted file mode 100644 index a1e67b32b..000000000 --- a/tests/specs/npm_tests/node_modules_deno_node_modules_local/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --quiet --node-modules-dir node_modules_deno_node_modules/main.ts", - "output": "node_modules_deno_node_modules/main.out", - "exitCode": 0, - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out b/tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out deleted file mode 100644 index 1ebdb2dd5..000000000 --- a/tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.out +++ /dev/null @@ -1,2 +0,0 @@ -esm -esm diff --git a/tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts b/tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts deleted file mode 100644 index 6e4a32d8e..000000000 --- a/tests/specs/npm_tests/node_modules_deno_node_modules_local/node_modules_deno_node_modules/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { getKind as getKind1 } from "npm:@denotest/dual-cjs-esm-dep"; -// this should still be able to be resolved even though it's missing the -// "@denotest/dual-cjs-esm" package because the above import will resolve it -import { getKind as getKind2 } from "npm:@denotest/dual-cjs-esm-dep-missing"; - -console.log(getKind1()); -console.log(getKind2()); diff --git a/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/__test__.jsonc b/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/__test__.jsonc deleted file mode 100644 index 5813bb3f2..000000000 --- a/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --node-modules-dir=auto -A --quiet require_added_nm_folder/main.js", - "output": "require_added_nm_folder/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 0 -} diff --git a/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js b/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js deleted file mode 100644 index 723b2023a..000000000 --- a/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.js +++ /dev/null @@ -1,10 +0,0 @@ -import { getValue } from "npm:@denotest/require-added-nm-folder"; - -Deno.mkdirSync("./node_modules/.other-package"); -Deno.writeTextFileSync("./node_modules/.other-package/package.json", "{}"); -Deno.writeTextFileSync( - "./node_modules/.other-package/index.js", - "exports.get = () => 5;", -); - -console.log(getValue()); diff --git a/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out b/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out deleted file mode 100644 index 7ed6ff82d..000000000 --- a/tests/specs/npm_tests/node_modules_dir_require_added_node_modules_folder/require_added_nm_folder/main.out +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/tests/specs/npm_tests/node_modules_dir_require_main_entry/__test__.jsonc b/tests/specs/npm_tests/node_modules_dir_require_main_entry/__test__.jsonc deleted file mode 100644 index 45936f1de..000000000 --- a/tests/specs/npm_tests/node_modules_dir_require_main_entry/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --node-modules-dir -A --quiet require_main/main.js", - "output": "require_main/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 0 -} diff --git a/tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.js b/tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.js deleted file mode 100644 index ddecd4fdb..000000000 --- a/tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import fraction from "npm:autoprefixer"; -console.log(typeof fraction); diff --git a/tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.out b/tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.out deleted file mode 100644 index e2dbde096..000000000 --- a/tests/specs/npm_tests/node_modules_dir_require_main_entry/require_main/main.out +++ /dev/null @@ -1 +0,0 @@ -function diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/__test__.jsonc b/tests/specs/npm_tests/node_modules_dir_with_deps/__test__.jsonc deleted file mode 100644 index ae79e8a47..000000000 --- a/tests/specs/npm_tests/node_modules_dir_with_deps/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --allow-env --node-modules-dir=auto cjs_with_deps/main.js", - "output": "cjs_with_deps/main_node_modules.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.js b/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.js deleted file mode 100644 index 568726874..000000000 --- a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.js +++ /dev/null @@ -1,12 +0,0 @@ -import chalk from "npm:chalk@4"; -import { expect } from "npm:chai@4.3"; - -console.log(chalk.green("chalk cjs loads")); - -const timeout = setTimeout(() => {}, 0); -expect(timeout).to.be.a("number"); -clearTimeout(timeout); - -const interval = setInterval(() => {}, 100); -expect(interval).to.be.a("number"); -clearInterval(interval); diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.out b/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.out deleted file mode 100644 index 7051c2395..000000000 --- a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main.out +++ /dev/null @@ -1,33 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Download http://localhost:4260/chai/chai-4.3.6.tgz -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info.out b/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info.out deleted file mode 100644 index bcaaf1eec..000000000 --- a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info.out +++ /dev/null @@ -1,22 +0,0 @@ -local: [WILDCARD]main.js -type: JavaScript -dependencies: 14 unique -size: [WILDCARD] - -file:///[WILDCARD]/npm/cjs_with_deps/main.js ([WILDCARD]) -├─┬ npm:/chalk@4.1.2 ([WILDCARD]) -│ ├─┬ npm:/ansi-styles@4.3.0 ([WILDCARD]) -│ │ └─┬ npm:/color-convert@2.0.1 ([WILDCARD]) -│ │ └── npm:/color-name@1.1.4 ([WILDCARD]) -│ └─┬ npm:/supports-color@7.2.0 ([WILDCARD]) -│ └── npm:/has-flag@4.0.0 ([WILDCARD]) -└─┬ npm:/chai@4.3.6 ([WILDCARD]) - ├── npm:/assertion-error@1.1.0 ([WILDCARD]) - ├── npm:/check-error@1.0.2 ([WILDCARD]) - ├─┬ npm:/deep-eql@3.0.1 ([WILDCARD]) - │ └── npm:/type-detect@4.0.8 ([WILDCARD]) - ├── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├─┬ npm:/loupe@2.3.4 ([WILDCARD]) - │ └── npm:/get-func-name@2.0.0 ([WILDCARD]) - ├── npm:/pathval@1.1.1 ([WILDCARD]) - └── npm:/type-detect@4.0.8 ([WILDCARD]) diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out b/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out deleted file mode 100644 index af1ef1351..000000000 --- a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_info_json.out +++ /dev/null @@ -1,148 +0,0 @@ -{ - "roots": [ - "file://[WILDCARD]/main.js" - ], - "modules": [ - { - "kind": "esm", - "dependencies": [ - { - "specifier": "npm:chalk@4", - "code": { - "specifier": "npm:chalk@4", - "span": { - "start": { - "line": 0, - "character": 18 - }, - "end": { - "line": 0, - "character": 31 - } - } - }, - "npmPackage": "chalk@4.1.2" - }, - { - "specifier": "npm:chai@4.3", - "code": { - "specifier": "npm:chai@4.3", - "span": { - "start": { - "line": 1, - "character": 23 - }, - "end": { - "line": 1, - "character": 37 - } - } - }, - "npmPackage": "chai@4.3.6" - } - ], - "local": "[WILDCARD]main.js", - "size": 325, - "mediaType": "JavaScript", - "specifier": "[WILDCARD]/main.js" - } - ], - "redirects": { - "npm:chai@4.3": "npm:/chai@4.3.6", - "npm:chalk@4": "npm:/chalk@4.1.2" - }, - "version": 1, - "npmPackages": { - "ansi-styles@4.3.0": { - "name": "ansi-styles", - "version": "4.3.0", - "dependencies": [ - "color-convert@2.0.1" - ] - }, - "assertion-error@1.1.0": { - "name": "assertion-error", - "version": "1.1.0", - "dependencies": [] - }, - "chai@4.3.6": { - "name": "chai", - "version": "4.3.6", - "dependencies": [ - "assertion-error@1.1.0", - "check-error@1.0.2", - "deep-eql@3.0.1", - "get-func-name@2.0.0", - "loupe@2.3.4", - "pathval@1.1.1", - "type-detect@4.0.8" - ] - }, - "chalk@4.1.2": { - "name": "chalk", - "version": "4.1.2", - "dependencies": [ - "ansi-styles@4.3.0", - "supports-color@7.2.0" - ] - }, - "check-error@1.0.2": { - "name": "check-error", - "version": "1.0.2", - "dependencies": [] - }, - "color-convert@2.0.1": { - "name": "color-convert", - "version": "2.0.1", - "dependencies": [ - "color-name@1.1.4" - ] - }, - "color-name@1.1.4": { - "name": "color-name", - "version": "1.1.4", - "dependencies": [] - }, - "deep-eql@3.0.1": { - "name": "deep-eql", - "version": "3.0.1", - "dependencies": [ - "type-detect@4.0.8" - ] - }, - "get-func-name@2.0.0": { - "name": "get-func-name", - "version": "2.0.0", - "dependencies": [] - }, - "has-flag@4.0.0": { - "name": "has-flag", - "version": "4.0.0", - "dependencies": [] - }, - "loupe@2.3.4": { - "name": "loupe", - "version": "2.3.4", - "dependencies": [ - "get-func-name@2.0.0" - ] - }, - "pathval@1.1.1": { - "name": "pathval", - "version": "1.1.1", - "dependencies": [] - }, - "supports-color@7.2.0": { - "name": "supports-color", - "version": "7.2.0", - "dependencies": [ - "has-flag@4.0.0" - ] - }, - "type-detect@4.0.8": { - "name": "type-detect", - "version": "4.0.8", - "dependencies": [] - } - } -} diff --git a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out b/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out deleted file mode 100644 index 1ab367952..000000000 --- a/tests/specs/npm_tests/node_modules_dir_with_deps/cjs_with_deps/main_node_modules.out +++ /dev/null @@ -1,47 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/chalk -Download http://localhost:4260/chai -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/supports-color -Download http://localhost:4260/assertion-error -Download http://localhost:4260/check-error -Download http://localhost:4260/deep-eql -Download http://localhost:4260/get-func-name -Download http://localhost:4260/loupe -Download http://localhost:4260/pathval -Download http://localhost:4260/type-detect -Download http://localhost:4260/color-convert -Download http://localhost:4260/has-flag -Download http://localhost:4260/color-name -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/assertion-error/assertion-error-1.1.0.tgz -Initialize assertion-error@1.1.0 -Download http://localhost:4260/chai/chai-4.3.6.tgz -Initialize chai@4.3.6 -Download http://localhost:4260/chalk/chalk-4.1.2.tgz -Initialize chalk@4.1.2 -Download http://localhost:4260/check-error/check-error-1.0.2.tgz -Initialize check-error@1.0.2 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/deep-eql/deep-eql-3.0.1.tgz -Initialize deep-eql@3.0.1 -Download http://localhost:4260/get-func-name/get-func-name-2.0.0.tgz -Initialize get-func-name@2.0.0 -Download http://localhost:4260/has-flag/has-flag-4.0.0.tgz -Initialize has-flag@4.0.0 -Download http://localhost:4260/loupe/loupe-2.3.4.tgz -Initialize loupe@2.3.4 -Download http://localhost:4260/pathval/pathval-1.1.1.tgz -Initialize pathval@1.1.1 -Download http://localhost:4260/supports-color/supports-color-7.2.0.tgz -Initialize supports-color@7.2.0 -Download http://localhost:4260/type-detect/type-detect-4.0.8.tgz -Initialize type-detect@4.0.8 -[UNORDERED_END] -chalk cjs loads diff --git a/tests/specs/npm_tests/node_modules_dir_yargs/__test__.jsonc b/tests/specs/npm_tests/node_modules_dir_yargs/__test__.jsonc deleted file mode 100644 index 8aa139a51..000000000 --- a/tests/specs/npm_tests/node_modules_dir_yargs/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --allow-env --node-modules-dir=auto cjs_yargs/main.js", - "output": "cjs_yargs/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.js b/tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.js deleted file mode 100644 index 832fd053c..000000000 --- a/tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.js +++ /dev/null @@ -1,20 +0,0 @@ -import yargs from "npm:yargs@15.4.1"; - -const args = yargs(["serve", "8000"]) - .command("serve [port]", "start the server", (yargs) => { - return yargs - .positional("port", { - describe: "port to bind on", - default: 5000, - }); - }, (argv) => { - console.info(`start server on :${argv.port}`); - }) - .option("verbose", { - alias: "v", - type: "boolean", - description: "Run with verbose logging", - }) - .argv; - -console.log(args); diff --git a/tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.out b/tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.out deleted file mode 100644 index 938d7a771..000000000 --- a/tests/specs/npm_tests/node_modules_dir_yargs/cjs_yargs/main.out +++ /dev/null @@ -1,84 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/yargs -Download http://localhost:4260/cliui -Download http://localhost:4260/decamelize -Download http://localhost:4260/find-up -Download http://localhost:4260/get-caller-file -Download http://localhost:4260/require-directory -Download http://localhost:4260/require-main-filename -Download http://localhost:4260/set-blocking -Download http://localhost:4260/string-width -Download http://localhost:4260/which-module -Download http://localhost:4260/y18n -Download http://localhost:4260/yargs-parser -Download http://localhost:4260/strip-ansi -Download http://localhost:4260/wrap-ansi -Download http://localhost:4260/locate-path -Download http://localhost:4260/path-exists -Download http://localhost:4260/emoji-regex -Download http://localhost:4260/is-fullwidth-code-point -Download http://localhost:4260/camelcase -Download http://localhost:4260/ansi-regex -Download http://localhost:4260/ansi-styles -Download http://localhost:4260/p-locate -Download http://localhost:4260/color-convert -Download http://localhost:4260/p-limit -Download http://localhost:4260/color-name -Download http://localhost:4260/p-try -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/ansi-regex/ansi-regex-5.0.1.tgz -Initialize ansi-regex@5.0.1 -Download http://localhost:4260/ansi-styles/ansi-styles-4.3.0.tgz -Initialize ansi-styles@4.3.0 -Download http://localhost:4260/camelcase/camelcase-5.3.1.tgz -Initialize camelcase@5.3.1 -Download http://localhost:4260/cliui/cliui-6.0.0.tgz -Initialize cliui@6.0.0 -Download http://localhost:4260/color-convert/color-convert-2.0.1.tgz -Initialize color-convert@2.0.1 -Download http://localhost:4260/color-name/color-name-1.1.4.tgz -Initialize color-name@1.1.4 -Download http://localhost:4260/decamelize/decamelize-1.2.0.tgz -Initialize decamelize@1.2.0 -Download http://localhost:4260/emoji-regex/emoji-regex-8.0.0.tgz -Initialize emoji-regex@8.0.0 -Download http://localhost:4260/find-up/find-up-4.1.0.tgz -Initialize find-up@4.1.0 -Download http://localhost:4260/get-caller-file/get-caller-file-2.0.5.tgz -Initialize get-caller-file@2.0.5 -Download http://localhost:4260/is-fullwidth-code-point/is-fullwidth-code-point-3.0.0.tgz -Initialize is-fullwidth-code-point@3.0.0 -Download http://localhost:4260/locate-path/locate-path-5.0.0.tgz -Initialize locate-path@5.0.0 -Download http://localhost:4260/p-limit/p-limit-2.3.0.tgz -Initialize p-limit@2.3.0 -Download http://localhost:4260/p-locate/p-locate-4.1.0.tgz -Initialize p-locate@4.1.0 -Download http://localhost:4260/p-try/p-try-2.2.0.tgz -Initialize p-try@2.2.0 -Download http://localhost:4260/path-exists/path-exists-4.0.0.tgz -Initialize path-exists@4.0.0 -Download http://localhost:4260/require-directory/require-directory-2.1.1.tgz -Initialize require-directory@2.1.1 -Download http://localhost:4260/require-main-filename/require-main-filename-2.0.0.tgz -Initialize require-main-filename@2.0.0 -Download http://localhost:4260/set-blocking/set-blocking-2.0.0.tgz -Initialize set-blocking@2.0.0 -Download http://localhost:4260/string-width/string-width-4.2.3.tgz -Initialize string-width@4.2.3 -Download http://localhost:4260/strip-ansi/strip-ansi-6.0.1.tgz -Initialize strip-ansi@6.0.1 -Download http://localhost:4260/which-module/which-module-2.0.0.tgz -Initialize which-module@2.0.0 -Download http://localhost:4260/wrap-ansi/wrap-ansi-6.2.0.tgz -Initialize wrap-ansi@6.2.0 -Download http://localhost:4260/y18n/y18n-4.0.3.tgz -Initialize y18n@4.0.3 -Download http://localhost:4260/yargs/yargs-15.4.1.tgz -Initialize yargs@15.4.1 -Download http://localhost:4260/yargs-parser/yargs-parser-18.1.3.tgz -Initialize yargs-parser@18.1.3 -[UNORDERED_END] -start server on :8000 -[WILDCARD] diff --git a/tests/specs/npm_tests/non_existent_dep/__test__.jsonc b/tests/specs/npm_tests/non_existent_dep/__test__.jsonc deleted file mode 100644 index a43708421..000000000 --- a/tests/specs/npm_tests/non_existent_dep/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "cache npm:@denotest/non-existent-dep", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1, - "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest/non-existent-dep\nDownload http://localhost:4260/@denotest/non-existent\n[UNORDERED_END]\nerror: npm package '@denotest/non-existent' does not exist.\n" -} diff --git a/tests/specs/npm_tests/non_existent_dep_version/__test__.jsonc b/tests/specs/npm_tests/non_existent_dep_version/__test__.jsonc deleted file mode 100644 index 19cd713e2..000000000 --- a/tests/specs/npm_tests/non_existent_dep_version/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "cache npm:@denotest/non-existent-dep-version", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1, - "output": "[UNORDERED_START]\nDownload http://localhost:4260/@denotest/non-existent-dep-version\nDownload http://localhost:4260/@denotest/esm-basic\n[UNORDERED_END]\nerror: Could not find npm package '@denotest/esm-basic' matching '=99.99.99'.\n" -} diff --git a/tests/specs/npm_tests/nonexistent_file/__test__.jsonc b/tests/specs/npm_tests/nonexistent_file/__test__.jsonc deleted file mode 100644 index efbda98d2..000000000 --- a/tests/specs/npm_tests/nonexistent_file/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run -A --quiet nonexistent_file/main.js", - "output": "nonexistent_file/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.js b/tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.js deleted file mode 100644 index c480b0548..000000000 --- a/tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import hmacSHA512 from "npm:crypto-js/non-existent"; -console.log(hmacSHA512); diff --git a/tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.out b/tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.out deleted file mode 100644 index baa79b1ce..000000000 --- a/tests/specs/npm_tests/nonexistent_file/nonexistent_file/main.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Unable to load [WILDCARD]non-existent imported from [WILDCARD]main.js - -Caused by: -[WILDCARD] diff --git a/tests/specs/npm_tests/nonexistent_file_node_modules_dir/__test__.jsonc b/tests/specs/npm_tests/nonexistent_file_node_modules_dir/__test__.jsonc deleted file mode 100644 index 28da47300..000000000 --- a/tests/specs/npm_tests/nonexistent_file_node_modules_dir/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run -A --quiet --node-modules-dir nonexistent_file/main.js", - "output": "nonexistent_file/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.js b/tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.js deleted file mode 100644 index c480b0548..000000000 --- a/tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import hmacSHA512 from "npm:crypto-js/non-existent"; -console.log(hmacSHA512); diff --git a/tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.out b/tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.out deleted file mode 100644 index baa79b1ce..000000000 --- a/tests/specs/npm_tests/nonexistent_file_node_modules_dir/nonexistent_file/main.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Unable to load [WILDCARD]non-existent imported from [WILDCARD]main.js - -Caused by: -[WILDCARD] diff --git a/tests/specs/npm_tests/permissions_outside_package/__test__.jsonc b/tests/specs/npm_tests/permissions_outside_package/__test__.jsonc deleted file mode 100644 index 58f917f73..000000000 --- a/tests/specs/npm_tests/permissions_outside_package/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read permissions_outside_package/main.ts", - "output": "permissions_outside_package/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/config.js b/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/config.js deleted file mode 100644 index e667790d2..000000000 --- a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/config.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - "name": "foobar", - "version": "0.0.1", -}; diff --git a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/package.json b/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/package.json deleted file mode 100644 index cc049e6ce..000000000 --- a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "foobar", - "version": "0.0.1" -} diff --git a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.out b/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.out deleted file mode 100644 index 089f329c4..000000000 --- a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/permissions-outside-package -Download http://localhost:4260/@denotest/permissions-outside-package/1.0.0.tgz -{ name: "foobar", version: "0.0.1" } diff --git a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.ts b/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.ts deleted file mode 100644 index 934a3eebc..000000000 --- a/tests/specs/npm_tests/permissions_outside_package/permissions_outside_package/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { loadConfigFile } from "npm:@denotest/permissions-outside-package"; - -const fileName = `${Deno.cwd()}/permissions_outside_package/foo/config.js`; -const config = loadConfigFile(fileName); -console.log(config); diff --git a/tests/specs/npm_tests/remote_npm_specifier/__test__.jsonc b/tests/specs/npm_tests/remote_npm_specifier/__test__.jsonc deleted file mode 100644 index 416024f0c..000000000 --- a/tests/specs/npm_tests/remote_npm_specifier/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run --quiet -A remote_npm_specifier/main.ts", - "output": "remote_npm_specifier/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 0 -} diff --git a/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.out b/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.out deleted file mode 100644 index 9daeafb98..000000000 --- a/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.out +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.ts b/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.ts deleted file mode 100644 index ea9442059..000000000 --- a/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/main.ts +++ /dev/null @@ -1 +0,0 @@ -import "./remote.ts"; diff --git a/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/remote.ts b/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/remote.ts deleted file mode 100644 index 923ed3ed8..000000000 --- a/tests/specs/npm_tests/remote_npm_specifier/remote_npm_specifier/remote.ts +++ /dev/null @@ -1,3 +0,0 @@ -import chalk from "npm:chalk"; - -console.log(chalk.green("test")); diff --git a/tests/specs/npm_tests/require_esm/__test__.jsonc b/tests/specs/npm_tests/require_esm/__test__.jsonc deleted file mode 100644 index 83859c8f1..000000000 --- a/tests/specs/npm_tests/require_esm/__test__.jsonc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "args": "run --allow-read --quiet require_esm/main.ts", - "output": "require_esm/main.out" -} diff --git a/tests/specs/npm_tests/require_esm/require_esm/esm.js b/tests/specs/npm_tests/require_esm/require_esm/esm.js deleted file mode 100644 index 0613f1911..000000000 --- a/tests/specs/npm_tests/require_esm/require_esm/esm.js +++ /dev/null @@ -1 +0,0 @@ -export class Test {} diff --git a/tests/specs/npm_tests/require_esm/require_esm/main.out b/tests/specs/npm_tests/require_esm/require_esm/main.out deleted file mode 100644 index aab0d5c28..000000000 --- a/tests/specs/npm_tests/require_esm/require_esm/main.out +++ /dev/null @@ -1 +0,0 @@ -[Module: null prototype] { Test: [class Test] } diff --git a/tests/specs/npm_tests/require_esm/require_esm/main.ts b/tests/specs/npm_tests/require_esm/require_esm/main.ts deleted file mode 100644 index 67ac808f0..000000000 --- a/tests/specs/npm_tests/require_esm/require_esm/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { createRequire } from "node:module"; - -const require = createRequire(import.meta.url); - -console.log(require("./esm.js")); diff --git a/tests/specs/npm_tests/require_json/__test__.jsonc b/tests/specs/npm_tests/require_json/__test__.jsonc deleted file mode 100644 index 43af6230f..000000000 --- a/tests/specs/npm_tests/require_json/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet require_json/main.js", - "output": "require_json/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/require_json/require_json/main.js b/tests/specs/npm_tests/require_json/require_json/main.js deleted file mode 100644 index d11e85305..000000000 --- a/tests/specs/npm_tests/require_json/require_json/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import globals from "npm:globals@13.17.0"; -console.log(globals); diff --git a/tests/specs/npm_tests/require_json/require_json/main.out b/tests/specs/npm_tests/require_json/require_json/main.out deleted file mode 100644 index 97db68e1b..000000000 --- a/tests/specs/npm_tests/require_json/require_json/main.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD] - devtools: { -[WILDCARD] \ No newline at end of file diff --git a/tests/specs/npm_tests/reserved_word_exports/__test__.jsonc b/tests/specs/npm_tests/reserved_word_exports/__test__.jsonc deleted file mode 100644 index d2f6ae7c2..000000000 --- a/tests/specs/npm_tests/reserved_word_exports/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run reserved_word_exports/main.ts", - "output": "reserved_word_exports/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.out b/tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.out deleted file mode 100644 index ccfd35bc8..000000000 --- a/tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.out +++ /dev/null @@ -1,141 +0,0 @@ -Download http://localhost:4260/@denotest/reserved-word-exports -Download http://localhost:4260/@denotest/reserved-word-exports/1.0.0.tgz -[Module: null prototype] { - abstract: "abstract", - arguments: "arguments", - async: "async", - await: "await", - boolean: "boolean", - break: "break", - byte: "byte", - case: "case", - catch: "catch", - char: "char", - class: "class", - const: "const", - continue: "continue", - debugger: "debugger", - default: { - abstract: "abstract", - arguments: "arguments", - async: "async", - await: "await", - boolean: "boolean", - break: "break", - byte: "byte", - case: "case", - catch: "catch", - char: "char", - class: "class", - const: "const", - continue: "continue", - debugger: "debugger", - default: "default", - delete: "delete", - do: "do", - double: "double", - else: "else", - enum: "enum", - eval: "eval", - export: "export", - extends: "extends", - false: "false", - final: "final", - finally: "finally", - float: "float", - for: "for", - function: "function", - get: "get", - goto: "goto", - if: "if", - implements: "implements", - import: "import", - in: "in", - instanceof: "instanceof", - int: "int", - interface: "interface", - let: "let", - long: "long", - mod: "mod", - native: "native", - new: "new", - null: "null", - package: "package", - private: "private", - protected: "protected", - public: "public", - return: "return", - set: "set", - short: "short", - static: "static", - super: "super", - switch: "switch", - synchronized: "synchronized", - this: "this", - throw: "throw", - throws: "throws", - transient: "transient", - true: "true", - try: "try", - typeof: "typeof", - var: "var", - void: "void", - volatile: "volatile", - while: "while", - with: "with", - yield: "yield" - }, - delete: "delete", - do: "do", - double: "double", - else: "else", - enum: "enum", - eval: "eval", - export: "export", - extends: "extends", - false: "false", - final: "final", - finally: "finally", - float: "float", - for: "for", - function: "function", - get: "get", - goto: "goto", - if: "if", - implements: "implements", - import: "import", - in: "in", - instanceof: "instanceof", - int: "int", - interface: "interface", - let: "let", - long: "long", - mod: "mod", - native: "native", - new: "new", - null: "null", - package: "package", - private: "private", - protected: "protected", - public: "public", - return: "return", - set: "set", - short: "short", - static: "static", - super: "super", - switch: "switch", - synchronized: "synchronized", - this: "this", - throw: "throw", - throws: "throws", - transient: "transient", - true: "true", - try: "try", - typeof: "typeof", - var: "var", - void: "void", - volatile: "volatile", - while: "while", - with: "with", - yield: "yield" -} diff --git a/tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.ts b/tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.ts deleted file mode 100644 index 33cf183d3..000000000 --- a/tests/specs/npm_tests/reserved_word_exports/reserved_word_exports/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as exports from "npm:@denotest/reserved-word-exports"; - -console.log(exports); diff --git a/tests/specs/npm_tests/run_existing_npm_package_with_subpath/__test__.jsonc b/tests/specs/npm_tests/run_existing_npm_package_with_subpath/__test__.jsonc deleted file mode 100644 index bc76b00be..000000000 --- a/tests/specs/npm_tests/run_existing_npm_package_with_subpath/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run --allow-read --node-modules-dir=auto npm:@denotest/bin/cli-esm dev --help", - "output": "run_existing_npm_package_with_subpath/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out b/tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out deleted file mode 100644 index f6ee03ef1..000000000 --- a/tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/main.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://localhost:4260/@denotest/bin -Download http://localhost:4260/@denotest/bin/1.0.0.tgz -Initialize @denotest/bin@1.0.0 -dev ---help diff --git a/tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json b/tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json deleted file mode 100644 index e9a7e84ce..000000000 --- a/tests/specs/npm_tests/run_existing_npm_package_with_subpath/run_existing_npm_package_with_subpath/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "run-existing-npm-package", - "dependencies": { - "@denotest/bin": "1.0.0" - } -} diff --git a/tests/specs/npm_tests/sub_paths/__test__.jsonc b/tests/specs/npm_tests/sub_paths/__test__.jsonc deleted file mode 100644 index 88ccbc3ac..000000000 --- a/tests/specs/npm_tests/sub_paths/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet sub_paths/main.jsx", - "output": "sub_paths/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/sub_paths/sub_paths/main.jsx b/tests/specs/npm_tests/sub_paths/sub_paths/main.jsx deleted file mode 100644 index 0c712b9ff..000000000 --- a/tests/specs/npm_tests/sub_paths/sub_paths/main.jsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from "npm:react@18.2.0"; -import { renderToString } from "npm:react-dom@18.2.0/server"; - -function App({ name }) { - return
Hello {name}!
; -} - -console.log(renderToString()); diff --git a/tests/specs/npm_tests/sub_paths/sub_paths/main.out b/tests/specs/npm_tests/sub_paths/sub_paths/main.out deleted file mode 100644 index f034585a7..000000000 --- a/tests/specs/npm_tests/sub_paths/sub_paths/main.out +++ /dev/null @@ -1 +0,0 @@ -
Hello World!
diff --git a/tests/specs/npm_tests/tarball_with_global_header/__test__.jsonc b/tests/specs/npm_tests/tarball_with_global_header/__test__.jsonc deleted file mode 100644 index 7cf4a6083..000000000 --- a/tests/specs/npm_tests/tarball_with_global_header/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet tarball_with_global_header/main.js", - "output": "tarball_with_global_header/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.js b/tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.js deleted file mode 100644 index d1bb40fbc..000000000 --- a/tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { Client } from "npm:ssh2"; - -console.log(Client); diff --git a/tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.out b/tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.out deleted file mode 100644 index ff211087b..000000000 --- a/tests/specs/npm_tests/tarball_with_global_header/tarball_with_global_header/main.out +++ /dev/null @@ -1 +0,0 @@ -[class Client extends EventEmitter] diff --git a/tests/specs/npm_tests/translate_cjs_to_esm/__test__.jsonc b/tests/specs/npm_tests/translate_cjs_to_esm/__test__.jsonc deleted file mode 100644 index e1344493c..000000000 --- a/tests/specs/npm_tests/translate_cjs_to_esm/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "run -A --quiet translate_cjs_to_esm/main.js", - "output": "translate_cjs_to_esm/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.js b/tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.js deleted file mode 100644 index 04a86fbf1..000000000 --- a/tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.js +++ /dev/null @@ -1,6 +0,0 @@ -import fsx from "npm:fs-extra@10.1.0"; -import { createApp } from "npm:vue"; -import "npm:@denotest/cjs-with-file-stem"; - -console.log(fsx.access); -console.log(createApp); diff --git a/tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.out b/tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.out deleted file mode 100644 index c21a965b8..000000000 --- a/tests/specs/npm_tests/translate_cjs_to_esm/translate_cjs_to_esm/main.out +++ /dev/null @@ -1,4 +0,0 @@ -hello -world -[Function: access] -[Function: createApp] diff --git a/tests/specs/npm_tests/types_ambient_module/__test__.jsonc b/tests/specs/npm_tests/types_ambient_module/__test__.jsonc deleted file mode 100644 index fc60b3433..000000000 --- a/tests/specs/npm_tests/types_ambient_module/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "check --quiet types_ambient_module/main.ts", - "output": "types_ambient_module/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/import_map.json b/tests/specs/npm_tests/types_ambient_module/types_ambient_module/import_map.json deleted file mode 100644 index f61d99b47..000000000 --- a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/import_map.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "types-ambient": "npm:@denotest/types-ambient" - } -} diff --git a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.out b/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.out deleted file mode 100644 index c84130707..000000000 --- a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.out +++ /dev/null @@ -1,21 +0,0 @@ -error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(import1.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/types_ambient_module/main.ts:5:21 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 - -TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(import2.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/types_ambient_module/main.ts:7:21 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 - -Found 2 errors. diff --git a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.ts b/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.ts deleted file mode 100644 index 8f77cabe8..000000000 --- a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as import1 from "npm:@denotest/types-ambient"; -import * as import2 from "npm:@denotest/types-ambient@1"; - -console.log(import1.Test); -console.log(import1.Test2); // should error -console.log(import2.Test); -console.log(import2.Test2); // should error diff --git a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.out b/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.out deleted file mode 100644 index 548f9b479..000000000 --- a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.out +++ /dev/null @@ -1,9 +0,0 @@ -error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(mod.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/main_import_map.ts:4:17 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 diff --git a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.ts b/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.ts deleted file mode 100644 index 2694c94b7..000000000 --- a/tests/specs/npm_tests/types_ambient_module/types_ambient_module/main_import_map.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as mod from "npm:@denotest/types-ambient"; - -console.log(mod.Test); -console.log(mod.Test2); // should error diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/__test__.jsonc b/tests/specs/npm_tests/types_ambient_module_import_map/__test__.jsonc deleted file mode 100644 index 2e8c9b60b..000000000 --- a/tests/specs/npm_tests/types_ambient_module_import_map/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "check --quiet --import-map=types_ambient_module/import_map.json types_ambient_module/main_import_map.ts", - "output": "types_ambient_module/main_import_map.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/import_map.json b/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/import_map.json deleted file mode 100644 index f61d99b47..000000000 --- a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/import_map.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "types-ambient": "npm:@denotest/types-ambient" - } -} diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.out b/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.out deleted file mode 100644 index c84130707..000000000 --- a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.out +++ /dev/null @@ -1,21 +0,0 @@ -error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(import1.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/types_ambient_module/main.ts:5:21 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 - -TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(import2.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/types_ambient_module/main.ts:7:21 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 - -Found 2 errors. diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.ts b/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.ts deleted file mode 100644 index 8f77cabe8..000000000 --- a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as import1 from "npm:@denotest/types-ambient"; -import * as import2 from "npm:@denotest/types-ambient@1"; - -console.log(import1.Test); -console.log(import1.Test2); // should error -console.log(import2.Test); -console.log(import2.Test2); // should error diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.out b/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.out deleted file mode 100644 index 548f9b479..000000000 --- a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.out +++ /dev/null @@ -1,9 +0,0 @@ -error: TS2551 [ERROR]: Property 'Test2' does not exist on type 'typeof import("@denotest/types-ambient")'. Did you mean 'Test'? -console.log(mod.Test2); // should error - ~~~~~ - at file:///[WILDCARD]/main_import_map.ts:4:17 - - 'Test' is declared here. - class Test { - ~~~~ - at file:///[WILDCARD]/@denotest/types-ambient/1.0.0/index.d.ts:7:9 diff --git a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.ts b/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.ts deleted file mode 100644 index 2694c94b7..000000000 --- a/tests/specs/npm_tests/types_ambient_module_import_map/types_ambient_module/main_import_map.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as mod from "npm:@denotest/types-ambient"; - -console.log(mod.Test); -console.log(mod.Test2); // should error diff --git a/tests/specs/npm_tests/types_d_ext/__test__.jsonc b/tests/specs/npm_tests/types_d_ext/__test__.jsonc deleted file mode 100644 index daa0f26ff..000000000 --- a/tests/specs/npm_tests/types_d_ext/__test__.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "args": "check --all d_ext/main.ts", - "output": "d_ext/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - } -} diff --git a/tests/specs/npm_tests/types_d_ext/d_ext/main.out b/tests/specs/npm_tests/types_d_ext/d_ext/main.out deleted file mode 100644 index e99df6696..000000000 --- a/tests/specs/npm_tests/types_d_ext/d_ext/main.out +++ /dev/null @@ -1,3 +0,0 @@ -Download http://localhost:4260/@denotest/d-ext -Download http://localhost:4260/@denotest/d-ext/1.0.0.tgz -Check file:///[WILDCARD]/d_ext/main.ts diff --git a/tests/specs/npm_tests/types_d_ext/d_ext/main.ts b/tests/specs/npm_tests/types_d_ext/d_ext/main.ts deleted file mode 100644 index c92dbe065..000000000 --- a/tests/specs/npm_tests/types_d_ext/d_ext/main.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { test } from "npm:@denotest/d-ext"; - -console.log(test); diff --git a/tests/specs/npm_tests/types_entry_value_not_exists/__test__.jsonc b/tests/specs/npm_tests/types_entry_value_not_exists/__test__.jsonc deleted file mode 100644 index 1c2e8735f..000000000 --- a/tests/specs/npm_tests/types_entry_value_not_exists/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "check --all types_entry_value_not_exists/main.ts", - "output": "types_entry_value_not_exists/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.out b/tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.out deleted file mode 100644 index 017a17ea2..000000000 --- a/tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/types-entry-value-not-exists -Download http://localhost:4260/@denotest/types-entry-value-not-exists/1.0.0.tgz -Check file://[WILDCARD]/types_entry_value_not_exists/main.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const result: string = getValue(); - ~~~~~~ - at file:///[WILDCARD]/main.ts:4:7 diff --git a/tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.ts b/tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.ts deleted file mode 100644 index 04374ef87..000000000 --- a/tests/specs/npm_tests/types_entry_value_not_exists/types_entry_value_not_exists/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getValue } from "npm:@denotest/types-entry-value-not-exists"; - -// should error here -const result: string = getValue(); -console.log(result); diff --git a/tests/specs/npm_tests/types_exports_import_types/__test__.jsonc b/tests/specs/npm_tests/types_exports_import_types/__test__.jsonc deleted file mode 100644 index fbb6a918a..000000000 --- a/tests/specs/npm_tests/types_exports_import_types/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "check --all types_exports_import_types/main.ts", - "output": "types_exports_import_types/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.out b/tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.out deleted file mode 100644 index 10f9425ca..000000000 --- a/tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.out +++ /dev/null @@ -1,7 +0,0 @@ -Download http://localhost:4260/@denotest/types-exports-import-types -Download http://localhost:4260/@denotest/types-exports-import-types/1.0.0.tgz -Check file://[WILDCARD]/types_exports_import_types/main.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const result: string = getValue(); - ~~~~~~ - at file:///[WILDCARD]/main.ts:4:7 diff --git a/tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.ts b/tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.ts deleted file mode 100644 index 3ae3e92a3..000000000 --- a/tests/specs/npm_tests/types_exports_import_types/types_exports_import_types/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getValue } from "npm:@denotest/types-exports-import-types"; - -// should error here -const result: string = getValue(); -console.log(result); diff --git a/tests/specs/npm_tests/types_no_types_entry/__test__.jsonc b/tests/specs/npm_tests/types_no_types_entry/__test__.jsonc deleted file mode 100644 index bae02f3a8..000000000 --- a/tests/specs/npm_tests/types_no_types_entry/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "check --all types_no_types_entry/main.ts", - "output": "types_no_types_entry/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.out b/tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.out deleted file mode 100644 index 53e872eaf..000000000 --- a/tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.out +++ /dev/null @@ -1,13 +0,0 @@ -[UNORDERED_START] -Download http://localhost:4260/@denotest/types-no-types-entry -Download http://localhost:4260/@denotest/types-entry-value-not-exists -[UNORDERED_END] -[UNORDERED_START] -Download http://localhost:4260/@denotest/types-entry-value-not-exists/1.0.0.tgz -Download http://localhost:4260/@denotest/types-no-types-entry/1.0.0.tgz -[UNORDERED_END] -Check file://[WILDCARD]/types_no_types_entry/main.ts -error: TS2322 [ERROR]: Type 'number' is not assignable to type 'string'. -const result: string = getValue(); - ~~~~~~ - at file:///[WILDCARD]/main.ts:4:7 diff --git a/tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.ts b/tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.ts deleted file mode 100644 index eef53b681..000000000 --- a/tests/specs/npm_tests/types_no_types_entry/types_no_types_entry/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { getValue } from "npm:@denotest/types-no-types-entry"; - -// should error here -const result: string = getValue(); -console.log(result); diff --git a/tests/specs/npm_tests/typescript_file_in_package/__test__.jsonc b/tests/specs/npm_tests/typescript_file_in_package/__test__.jsonc deleted file mode 100644 index c5bd61ca2..000000000 --- a/tests/specs/npm_tests/typescript_file_in_package/__test__.jsonc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "args": "run typescript_file_in_package/main.ts", - "output": "typescript_file_in_package/main.out", - "envs": { - "NO_COLOR": "1", - "NPM_CONFIG_REGISTRY": "http://localhost:4260/" - }, - "exitCode": 1 -} diff --git a/tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.out b/tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.out deleted file mode 100644 index 3c3b97190..000000000 --- a/tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.out +++ /dev/null @@ -1,6 +0,0 @@ -Download http://localhost:4260/@denotest/typescript-file -Download http://localhost:4260/@denotest/typescript-file/1.0.0.tgz -error: Could not resolve 'npm:@denotest/typescript-file@1.0.0'. - -Caused by: - TypeScript files are not supported in npm packages: file:///[WILDCARD]/@denotest/typescript-file/1.0.0/index.ts diff --git a/tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.ts b/tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.ts deleted file mode 100644 index aefc38ebe..000000000 --- a/tests/specs/npm_tests/typescript_file_in_package/typescript_file_in_package/main.ts +++ /dev/null @@ -1,5 +0,0 @@ -// We don't support typescript files in npm packages because we don't -// want to encourage people distributing npm packages that aren't JavaScript. -import { getValue } from "npm:@denotest/typescript-file"; - -console.log(getValue()); diff --git a/tests/specs/permission/allow_import/__test__.jsonc b/tests/specs/permission/allow_import/__test__.jsonc new file mode 100644 index 000000000..21a3cb7b5 --- /dev/null +++ b/tests/specs/permission/allow_import/__test__.jsonc @@ -0,0 +1,52 @@ +{ + "tests": { + "info": { + "args": "info main.ts", + "output": "info.out" + }, + "cache": { + "args": "cache main.ts", + "output": "cache.out", + "exitCode": 1 + }, + "check": { + "args": "check main.ts", + "output": "check.out", + "exitCode": 1 + }, + "compile": { + "args": "compile main.ts", + "output": "compile.out", + "exitCode": 1 + }, + "doc": { + "args": "doc doc.ts", + "output": "doc.out", + "exitCode": 0 + }, + "doc_allowed": { + "args": "doc --allow-import doc.ts", + "output": "doc_allowed.out", + "exitCode": 0 + }, + "run": { + "args": "run main.ts", + "output": "run.out", + "exitCode": 1 + }, + "serve": { + "args": "serve main.ts", + "output": "serve.out", + "exitCode": 1 + }, + "builtin_host": { + "args": "run --quiet builtin_host.ts", + "output": "3\n" + }, + "builtin_host_replaced": { + "args": "run --quiet --allow-import=other.host builtin_host.ts", + "output": "[WILDCARD]Requires import access[WILDCARD]", + "exitCode": 1 + } + } +} diff --git a/tests/specs/permission/allow_import/builtin_host.ts b/tests/specs/permission/allow_import/builtin_host.ts new file mode 100644 index 000000000..a3ca2df76 --- /dev/null +++ b/tests/specs/permission/allow_import/builtin_host.ts @@ -0,0 +1,4 @@ +// this is the JSR url for the test server +import { add } from "http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts"; + +console.log(add(1, 2)); diff --git a/tests/specs/permission/allow_import/cache.out b/tests/specs/permission/allow_import/cache.out new file mode 100644 index 000000000..da40ede3a --- /dev/null +++ b/tests/specs/permission/allow_import/cache.out @@ -0,0 +1,2 @@ +error: Requires import access to "example.com:443", run again with the --allow-import flag + at file:///[WILDLINE]/main.ts:1:8 diff --git a/tests/specs/permission/allow_import/check.out b/tests/specs/permission/allow_import/check.out new file mode 100644 index 000000000..da40ede3a --- /dev/null +++ b/tests/specs/permission/allow_import/check.out @@ -0,0 +1,2 @@ +error: Requires import access to "example.com:443", run again with the --allow-import flag + at file:///[WILDLINE]/main.ts:1:8 diff --git a/tests/specs/permission/allow_import/compile.out b/tests/specs/permission/allow_import/compile.out new file mode 100644 index 000000000..da40ede3a --- /dev/null +++ b/tests/specs/permission/allow_import/compile.out @@ -0,0 +1,2 @@ +error: Requires import access to "example.com:443", run again with the --allow-import flag + at file:///[WILDLINE]/main.ts:1:8 diff --git a/tests/specs/permission/allow_import/doc.out b/tests/specs/permission/allow_import/doc.out new file mode 100644 index 000000000..bc748d726 --- /dev/null +++ b/tests/specs/permission/allow_import/doc.out @@ -0,0 +1,6 @@ +[# todo(dsherret): we should probably at least show a warning here] +Defined in file:///[WILDLINE]/doc.ts:3:1 + +class Test + + diff --git a/tests/specs/permission/allow_import/doc.ts b/tests/specs/permission/allow_import/doc.ts new file mode 100644 index 000000000..622506c9b --- /dev/null +++ b/tests/specs/permission/allow_import/doc.ts @@ -0,0 +1,3 @@ +export * from "http://localhost:4545/add.ts"; + +export class Test {} diff --git a/tests/specs/permission/allow_import/doc_allowed.out b/tests/specs/permission/allow_import/doc_allowed.out new file mode 100644 index 000000000..61886be38 --- /dev/null +++ b/tests/specs/permission/allow_import/doc_allowed.out @@ -0,0 +1,10 @@ +Download http://localhost:4545/add.ts +Defined in http://localhost:4545/add.ts:1:1 + +function add(a: number, b: number): number + +Defined in file:///[WILDLINE]/doc.ts:3:1 + +class Test + + diff --git a/tests/specs/permission/allow_import/info.out b/tests/specs/permission/allow_import/info.out new file mode 100644 index 000000000..2e364ff27 --- /dev/null +++ b/tests/specs/permission/allow_import/info.out @@ -0,0 +1,7 @@ +local: [WILDLINE]main.ts +type: TypeScript +dependencies: 0 unique +size: [WILDLINE] + +file:///[WILDLINE]/main.ts ([WILDLINE]) +└── https://example.com/malicious_string (not capable, requires --allow-import) diff --git a/tests/specs/permission/allow_import/main.ts b/tests/specs/permission/allow_import/main.ts new file mode 100644 index 000000000..8dfed682e --- /dev/null +++ b/tests/specs/permission/allow_import/main.ts @@ -0,0 +1 @@ +import "https://example.com/malicious_string"; diff --git a/tests/specs/permission/allow_import/run.out b/tests/specs/permission/allow_import/run.out new file mode 100644 index 000000000..da40ede3a --- /dev/null +++ b/tests/specs/permission/allow_import/run.out @@ -0,0 +1,2 @@ +error: Requires import access to "example.com:443", run again with the --allow-import flag + at file:///[WILDLINE]/main.ts:1:8 diff --git a/tests/specs/permission/allow_import/serve.out b/tests/specs/permission/allow_import/serve.out new file mode 100644 index 000000000..da40ede3a --- /dev/null +++ b/tests/specs/permission/allow_import/serve.out @@ -0,0 +1,2 @@ +error: Requires import access to "example.com:443", run again with the --allow-import flag + at file:///[WILDLINE]/main.ts:1:8 diff --git a/tests/specs/permission/allow_import_jsx/__test__.jsonc b/tests/specs/permission/allow_import_jsx/__test__.jsonc new file mode 100644 index 000000000..cb80deb72 --- /dev/null +++ b/tests/specs/permission/allow_import_jsx/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run main.tsx", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/permission/allow_import_jsx/deno.jsonc b/tests/specs/permission/allow_import_jsx/deno.jsonc new file mode 100644 index 000000000..311409ea3 --- /dev/null +++ b/tests/specs/permission/allow_import_jsx/deno.jsonc @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "http://localhost:4545/jsx" + } +} diff --git a/tests/specs/permission/allow_import_jsx/main.out b/tests/specs/permission/allow_import_jsx/main.out new file mode 100644 index 000000000..fda79f89d --- /dev/null +++ b/tests/specs/permission/allow_import_jsx/main.out @@ -0,0 +1,3 @@ +[# do not allow exfiltrating data via the deno.json] +error: Requires import access to "localhost:4545", run again with the --allow-import flag + at file:///[WILDLINE]/main.tsx:1:1 diff --git a/tests/specs/permission/allow_import_jsx/main.tsx b/tests/specs/permission/allow_import_jsx/main.tsx new file mode 100644 index 000000000..f03d10c5b --- /dev/null +++ b/tests/specs/permission/allow_import_jsx/main.tsx @@ -0,0 +1,3 @@ +export function Component() { + return
Hi
; +} diff --git a/tests/specs/permission/allow_import_main_module/__test__.jsonc b/tests/specs/permission/allow_import_main_module/__test__.jsonc new file mode 100644 index 000000000..c0a92bfc3 --- /dev/null +++ b/tests/specs/permission/allow_import_main_module/__test__.jsonc @@ -0,0 +1,17 @@ +{ + // won't need --allow-import because it's implied from the main module + "tests": { + "run": { + "args": "run http://localhost:4545/run/002_hello.ts", + "output": "Download http://localhost:4545/run/002_hello.ts\nHello World\n" + }, + "cache": { + "args": "cache http://localhost:4545/run/002_hello.ts", + "output": "Download http://localhost:4545/run/002_hello.ts\n" + }, + "check": { + "args": "check http://localhost:4545/run/002_hello.ts", + "output": "Download http://localhost:4545/run/002_hello.ts\nCheck http://localhost:4545/run/002_hello.ts\n" + } + } +} diff --git a/tests/specs/permission/allow_import_not_on_redirect/__test__.jsonc b/tests/specs/permission/allow_import_not_on_redirect/__test__.jsonc new file mode 100644 index 000000000..b05d0c0cb --- /dev/null +++ b/tests/specs/permission/allow_import_not_on_redirect/__test__.jsonc @@ -0,0 +1,5 @@ +{ + "args": "run --allow-import=localhost:4547 --quiet --reload main.js", + "output": "main.out", + "exitCode": 1 +} diff --git a/tests/specs/permission/allow_import_not_on_redirect/main.js b/tests/specs/permission/allow_import_not_on_redirect/main.js new file mode 100644 index 000000000..226a6b622 --- /dev/null +++ b/tests/specs/permission/allow_import_not_on_redirect/main.js @@ -0,0 +1,2 @@ +import { value } from "http://localhost:4547/redirects/redirect3.js"; +console.log(value); diff --git a/tests/specs/permission/allow_import_not_on_redirect/main.out b/tests/specs/permission/allow_import_not_on_redirect/main.out new file mode 100644 index 000000000..3cab01e14 --- /dev/null +++ b/tests/specs/permission/allow_import_not_on_redirect/main.out @@ -0,0 +1,2 @@ +error: Requires import access to "localhost:4545", run again with the --allow-import flag + at file:///[WILDLINE]/main.js:1:23 diff --git a/tests/specs/publish/banned_triple_slash_directives/publish.out b/tests/specs/publish/banned_triple_slash_directives/publish.out index f1827538a..ab5db6f6e 100644 --- a/tests/specs/publish/banned_triple_slash_directives/publish.out +++ b/tests/specs/publish/banned_triple_slash_directives/publish.out @@ -1,6 +1,5 @@ Check file:///[WILDLINE]/mod.ts Checking for slow types in the public API... -Check file:///[WILDLINE]/mod.ts error[banned-triple-slash-directives]: triple slash directives that modify globals are not allowed --> [WILDLINE]mod.ts:1:1 | diff --git a/tests/specs/publish/invalid_import/invalid_import.out b/tests/specs/publish/invalid_import/invalid_import.out index 929fc72cd..6914dc51e 100644 --- a/tests/specs/publish/invalid_import/invalid_import.out +++ b/tests/specs/publish/invalid_import/invalid_import.out @@ -1,10 +1,7 @@ -Download http://localhost:4545/welcome.ts -Download http://localhost:4545/echo.ts +[# notice that the remote module is not downloaded here. This is so we do not need to add an --allow-import permission here] Download http://localhost:4260/chalk Download http://localhost:4260/chalk/chalk-5.0.1.tgz -Check file:///[WILDCARD]/mod.ts Checking for slow types in the public API... -Check file://[WILDCARD]mod.ts error[invalid-external-import]: invalid import to a non-JSR 'http' specifier --> [WILDCARD]mod.ts:1:8 | diff --git a/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out b/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out index a7235cbf1..b0a544df8 100644 --- a/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out +++ b/tests/specs/publish/invalid_import_esm_sh_suggestion/invalid_import_esm_sh_suggestion.out @@ -1,7 +1,4 @@ -[WILDCARD] -Check file:///[WILDCARD]/mod.ts Checking for slow types in the public API... -Check file:///[WILDCARD]mod.ts error[invalid-external-import]: invalid import to a non-JSR 'http' specifier --> [WILDCARD]mod.ts:1:8 | diff --git a/tests/specs/publish/missing_constraint/publish.out b/tests/specs/publish/missing_constraint/publish.out index 601035b05..d9fb6408f 100644 --- a/tests/specs/publish/missing_constraint/publish.out +++ b/tests/specs/publish/missing_constraint/publish.out @@ -1,6 +1,22 @@ -[WILDCARD] -Checking for slow types in the public API... +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/add/meta.json +Download http://127.0.0.1:4250/@denotest/deps/meta.json +Download http://localhost:4260/@denotest/esm-basic +Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/deps/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/module-graph/meta.json +Download http://127.0.0.1:4250/@denotest/no-module-graph/meta.json +Download http://127.0.0.1:4250/@denotest/module-graph/1.4.0_meta.json +Download http://127.0.0.1:4250/@denotest/no-module-graph/0.1.1_meta.json +Download http://127.0.0.1:4250/@denotest/no-module-graph/0.1.1/mod.ts +Download http://127.0.0.1:4250/@denotest/no-module-graph/0.1.1/TestClass.ts +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/deps/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/module-graph/1.4.0/other.ts +Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz +[UNORDERED_END] Check file:///[WILDLINE]/mod.ts +Checking for slow types in the public API... error[missing-constraint]: specifier 'jsr:@denotest/add' is missing a version constraint --> [WILDLINE]mod.ts:[WILDLINE] | diff --git a/tests/specs/publish/missing_constraint_jsx_import_source/mod.out b/tests/specs/publish/missing_constraint_jsx_import_source/mod.out index d1da06be8..fa06d8c38 100644 --- a/tests/specs/publish/missing_constraint_jsx_import_source/mod.out +++ b/tests/specs/publish/missing_constraint_jsx_import_source/mod.out @@ -1,6 +1,13 @@ -[WILDCARD] +[UNORDERED_START] +Download http://localhost:4260/preact +Download http://localhost:4260/preact-render-to-string +Download http://localhost:4260/pretty-format +Download http://localhost:4260/preact-render-to-string/preact-render-to-string-6.4.0.tgz +Download http://localhost:4260/preact/preact-10.19.6.tgz +Download http://localhost:4260/pretty-format/pretty-format-3.8.0.tgz +[UNORDERED_END] +Check file:///[WILDLINE]/mod.ts Checking for slow types in the public API... -Check file:///[WILDCARD]/mod.ts error[missing-constraint]: specifier 'npm:preact/jsx-runtime' is missing a version constraint --> [WILDLINE] = hint: specify a version constraint for the specifier diff --git a/tests/specs/publish/prefer_fast_check_graph/main.out b/tests/specs/publish/prefer_fast_check_graph/main.out index 64296206f..dd7d052c9 100644 --- a/tests/specs/publish/prefer_fast_check_graph/main.out +++ b/tests/specs/publish/prefer_fast_check_graph/main.out @@ -1,7 +1,4 @@ -[WILDCARD] -Check [WILDLINE]/tests/specs/publish/prefer_fast_check_graph/mod.ts Checking for slow types in the public API... -Check [WILDLINE]/tests/specs/publish/prefer_fast_check_graph/mod.ts error[invalid-external-import]: invalid import to a non-JSR 'https' specifier --> [WILDLINE]deps.ts:1:15 | diff --git a/tests/specs/run/redirect_javascript/__test__.jsonc b/tests/specs/run/redirect_javascript/__test__.jsonc index 1fd0b4cb1..d999a67f9 100644 --- a/tests/specs/run/redirect_javascript/__test__.jsonc +++ b/tests/specs/run/redirect_javascript/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "run --quiet --reload main.js", + "args": "run --allow-import --quiet --reload main.js", "output": "main.out" } diff --git a/tests/specs/test/check_local_by_default/__test__.jsonc b/tests/specs/test/check_local_by_default/__test__.jsonc index 602250082..138d007ad 100644 --- a/tests/specs/test/check_local_by_default/__test__.jsonc +++ b/tests/specs/test/check_local_by_default/__test__.jsonc @@ -1,4 +1,4 @@ { - "args": "test --quiet main.ts", + "args": "test --allow-import --quiet main.ts", "output": "main.out" } diff --git a/tests/specs/test/check_local_by_default2/__test__.jsonc b/tests/specs/test/check_local_by_default2/__test__.jsonc index 59774f938..79068d63f 100644 --- a/tests/specs/test/check_local_by_default2/__test__.jsonc +++ b/tests/specs/test/check_local_by_default2/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "test --quiet main.ts", + "args": "test --allow-import --quiet main.ts", "output": "main.out", "exitCode": 1 } diff --git a/tests/specs/worker/error_worker_permissions_remote/__test__.jsonc b/tests/specs/worker/error_worker_permissions_remote/__test__.jsonc index 06a439fd4..d40e31a49 100644 --- a/tests/specs/worker/error_worker_permissions_remote/__test__.jsonc +++ b/tests/specs/worker/error_worker_permissions_remote/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --reload error_worker_permissions_remote.ts", + "args": "run --reload --allow-import=other.host error_worker_permissions_remote.ts", "output": "error_worker_permissions_remote.ts.out", "exitCode": 1 } diff --git a/tests/specs/worker/error_worker_permissions_remote/error_worker_permissions_remote.ts.out b/tests/specs/worker/error_worker_permissions_remote/error_worker_permissions_remote.ts.out index afecff0a8..8019bb46d 100644 --- a/tests/specs/worker/error_worker_permissions_remote/error_worker_permissions_remote.ts.out +++ b/tests/specs/worker/error_worker_permissions_remote/error_worker_permissions_remote.ts.out @@ -1,2 +1,2 @@ -error: Uncaught (in worker "") Requires net access to "localhost:4545", run again with the --allow-net flag +error: Uncaught (in worker "") Requires import access to "localhost:4545", run again with the --allow-import flag [WILDCARD] diff --git a/tests/specs/worker/worker_permissions_blob_remote/permissions_blob_remote.ts.out b/tests/specs/worker/worker_permissions_blob_remote/permissions_blob_remote.ts.out index 6dc4f0f5f..67b817d6d 100644 --- a/tests/specs/worker/worker_permissions_blob_remote/permissions_blob_remote.ts.out +++ b/tests/specs/worker/worker_permissions_blob_remote/permissions_blob_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in worker "") Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in worker "") Requires import access to "example.com:443", run again with the --allow-import flag at blob:null/[WILDCARD]:1:8 error: Uncaught (in promise) Error: Unhandled error in child worker. at Worker.#pollControl[WILDCARD] diff --git a/tests/specs/worker/worker_permissions_data_remote/permissions_data_remote.ts.out b/tests/specs/worker/worker_permissions_data_remote/permissions_data_remote.ts.out index e7af110bb..0f5a99434 100644 --- a/tests/specs/worker/worker_permissions_data_remote/permissions_data_remote.ts.out +++ b/tests/specs/worker/worker_permissions_data_remote/permissions_data_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in worker "") Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in worker "") Requires import access to "example.com:443", run again with the --allow-import flag at data:application/javascript;base64,aW1wb3J0ICJodHRwczovL2V4YW1wbGUuY29tL3NvbWUvZmlsZS50cyI7:1:8 error: Uncaught (in promise) Error: Unhandled error in child worker. at Worker.#pollControl[WILDCARD] diff --git a/tests/specs/worker/worker_permissions_dynamic_remote/__test__.jsonc b/tests/specs/worker/worker_permissions_dynamic_remote/__test__.jsonc index 8343b17f6..498d9d507 100644 --- a/tests/specs/worker/worker_permissions_dynamic_remote/__test__.jsonc +++ b/tests/specs/worker/worker_permissions_dynamic_remote/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --quiet --reload --allow-net --unstable-worker-options ../../../testdata/workers/permissions_dynamic_remote.ts", - "output": "../../../testdata/workers/permissions_dynamic_remote.ts.out", + "args": "run --quiet --reload --allow-import --unstable-worker-options permissions_dynamic_remote.ts", + "output": "permissions_dynamic_remote.ts.out", "exitCode": 1 } diff --git a/tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts b/tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts new file mode 100644 index 000000000..5f0fdf7a1 --- /dev/null +++ b/tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts @@ -0,0 +1,12 @@ +new Worker( + "http://localhost:4545/workers/dynamic_remote.ts", + { + type: "module", + deno: { + permissions: { + // dynamic_remote.ts will import from example.com + import: false, + }, + }, + }, +); diff --git a/tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts.out b/tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts.out new file mode 100644 index 000000000..fa4232efd --- /dev/null +++ b/tests/specs/worker/worker_permissions_dynamic_remote/permissions_dynamic_remote.ts.out @@ -0,0 +1,6 @@ +error: Uncaught (in worker "") (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag +await import("" + "https://example.com/some/file.ts"); +^ + at async http://localhost:4545/workers/dynamic_remote.ts:2:1 +[WILDCARD]error: Uncaught (in promise) Error: Unhandled error in child worker. + at Worker.#pollControl [WILDCARD] diff --git a/tests/specs/worker/worker_permissions_remote_remote/__test__.jsonc b/tests/specs/worker/worker_permissions_remote_remote/__test__.jsonc index 8cf700158..00fd2a6e4 100644 --- a/tests/specs/worker/worker_permissions_remote_remote/__test__.jsonc +++ b/tests/specs/worker/worker_permissions_remote_remote/__test__.jsonc @@ -1,5 +1,5 @@ { - "args": "run --quiet --reload --allow-net=localhost:4545 ../../../testdata/workers/permissions_remote_remote.ts", + "args": "run --quiet --reload --allow-import=localhost:4545 permissions_remote_remote.ts", "output": "permissions_remote_remote.ts.out", "exitCode": 1 } diff --git a/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts b/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts new file mode 100644 index 000000000..4df2a8a5d --- /dev/null +++ b/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts @@ -0,0 +1,3 @@ +new Worker("http://localhost:4545/workers/static_remote.ts", { + type: "module", +}); diff --git a/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts.out b/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts.out index e5bdfc2dc..423120bb0 100644 --- a/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts.out +++ b/tests/specs/worker/worker_permissions_remote_remote/permissions_remote_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in worker "") Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in worker "") Requires import access to "example.com:443", run again with the --allow-import flag at http://localhost:4545/[WILDCARD]/static_remote.ts:2:8 error: Uncaught (in promise) Error: Unhandled error in child worker. at Worker.#pollControl [WILDCARD] diff --git a/tests/testdata/add.ts b/tests/testdata/add.ts new file mode 100644 index 000000000..8d9b8a22a --- /dev/null +++ b/tests/testdata/add.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number): number { + return a + b; +} diff --git a/tests/testdata/dynamic_import/permissions_blob_local.ts b/tests/testdata/dynamic_import/permissions_blob_local.ts index 9ef4158ce..865c1777a 100644 --- a/tests/testdata/dynamic_import/permissions_blob_local.ts +++ b/tests/testdata/dynamic_import/permissions_blob_local.ts @@ -1,4 +1,4 @@ -// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. +// This file doesn't really exist, but it doesn't matter, a "NotCapable" error should be thrown. const code = `import "file:///${ Deno.build.os == "windows" ? "C:/" : "" }local_file.ts";`; diff --git a/tests/testdata/dynamic_import/permissions_blob_remote.ts b/tests/testdata/dynamic_import/permissions_blob_remote.ts index 1e2c8c21a..569b1f84c 100644 --- a/tests/testdata/dynamic_import/permissions_blob_remote.ts +++ b/tests/testdata/dynamic_import/permissions_blob_remote.ts @@ -1,4 +1,3 @@ -// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. const code = `import "https://example.com/some/file.ts";`; const blob = new Blob([code]); await import(URL.createObjectURL(blob)); diff --git a/tests/testdata/dynamic_import/permissions_blob_remote.ts.out b/tests/testdata/dynamic_import/permissions_blob_remote.ts.out index f436a5eb8..20b6839e4 100644 --- a/tests/testdata/dynamic_import/permissions_blob_remote.ts.out +++ b/tests/testdata/dynamic_import/permissions_blob_remote.ts.out @@ -1,5 +1,5 @@ -error: Uncaught (in promise) TypeError: Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag at blob:null/[WILDCARD]:1:8 await import(URL.createObjectURL(blob)); ^ - at async file:///[WILDCARD]/dynamic_import/permissions_blob_remote.ts:4:1 + at async file:///[WILDCARD]/dynamic_import/permissions_blob_remote.ts:3:1 diff --git a/tests/testdata/dynamic_import/permissions_data_local.ts b/tests/testdata/dynamic_import/permissions_data_local.ts index be4fc1c34..01bff7d7a 100644 --- a/tests/testdata/dynamic_import/permissions_data_local.ts +++ b/tests/testdata/dynamic_import/permissions_data_local.ts @@ -1,4 +1,4 @@ -// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. +// This file doesn't really exist, but it doesn't matter, a "NotCapable" error should be thrown. const code = `import "file:///${ Deno.build.os == "windows" ? "C:/" : "" }local_file.ts";`; diff --git a/tests/testdata/dynamic_import/permissions_data_remote.ts.out b/tests/testdata/dynamic_import/permissions_data_remote.ts.out index 00248e277..67c851205 100644 --- a/tests/testdata/dynamic_import/permissions_data_remote.ts.out +++ b/tests/testdata/dynamic_import/permissions_data_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in promise) TypeError: Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag at data:application/javascript;base64,aW1wb3J0ICJodHRwczovL2V4YW1wbGUuY29tL3NvbWUvZmlsZS50cyI7:1:8 await import(`data:application/javascript;base64,${btoa(code)}`); ^ diff --git a/tests/testdata/dynamic_import/permissions_remote_remote.ts.out b/tests/testdata/dynamic_import/permissions_remote_remote.ts.out index 0e8b0fc1f..2676d7551 100644 --- a/tests/testdata/dynamic_import/permissions_remote_remote.ts.out +++ b/tests/testdata/dynamic_import/permissions_remote_remote.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in promise) TypeError: Requires net access to "example.com:443", run again with the --allow-net flag +error: Uncaught (in promise) TypeError: Requires import access to "example.com:443", run again with the --allow-import flag at http://localhost:4545/dynamic_import/static_remote.ts:2:8 await import( ^ diff --git a/tests/testdata/run/error_015_dynamic_import_permissions.js b/tests/testdata/run/error_015_dynamic_import_permissions.js index 47961cf63..bdf423b59 100644 --- a/tests/testdata/run/error_015_dynamic_import_permissions.js +++ b/tests/testdata/run/error_015_dynamic_import_permissions.js @@ -1,3 +1,3 @@ (async () => { - await import("" + "http://localhost:4545/subdir/mod4.js"); + await import("" + "http://example.com/subdir/mod4.js"); })(); diff --git a/tests/testdata/run/error_015_dynamic_import_permissions.out b/tests/testdata/run/error_015_dynamic_import_permissions.out index 87ce43e9c..15c26b425 100644 --- a/tests/testdata/run/error_015_dynamic_import_permissions.out +++ b/tests/testdata/run/error_015_dynamic_import_permissions.out @@ -1,4 +1,4 @@ -error: Uncaught (in promise) TypeError: Requires net access to "localhost:4545", run again with the --allow-net flag - await import("" + "http://localhost:4545/subdir/mod4.js"); +error: Uncaught (in promise) TypeError: Requires import access to "example.com:80", run again with the --allow-import flag + await import("" + "http://example.com/subdir/mod4.js"); ^ at async file://[WILDCARD]/error_015_dynamic_import_permissions.js:2:3 diff --git a/tests/testdata/run/lock_write_fetch/main.ts b/tests/testdata/run/lock_write_fetch/main.ts index 4ce631311..d8a50a9aa 100644 --- a/tests/testdata/run/lock_write_fetch/main.ts +++ b/tests/testdata/run/lock_write_fetch/main.ts @@ -9,6 +9,7 @@ const fetchProc = await new Deno.Command(Deno.execPath(), { stderr: "null", args: [ "cache", + "--allow-import", "--reload", "--lock=lock_write_fetch.json", "--cert=tls/RootCA.pem", @@ -23,6 +24,7 @@ const fetchCheckProc = await new Deno.Command(Deno.execPath(), { stderr: "null", args: [ "cache", + "--allow-import", "--lock=lock_write_fetch.json", "--cert=tls/RootCA.pem", "run/https_import.ts", @@ -38,6 +40,7 @@ const runProc = await new Deno.Command(Deno.execPath(), { stderr: "null", args: [ "run", + "--allow-import", "--lock=lock_write_fetch.json", "--allow-read", "--cert=tls/RootCA.pem", diff --git a/tests/testdata/run/type_directives_01.ts b/tests/testdata/run/type_directives_01.ts index 71305824c..2129d90b4 100644 --- a/tests/testdata/run/type_directives_01.ts +++ b/tests/testdata/run/type_directives_01.ts @@ -1,3 +1,3 @@ -import * as foo from "http://127.0.0.1:4545/xTypeScriptTypes.js"; +import * as foo from "http://localhost:4545/xTypeScriptTypes.js"; console.log(foo.foo); diff --git a/tests/testdata/run/type_directives_01.ts.out b/tests/testdata/run/type_directives_01.ts.out index 77ed3ae26..466218a96 100644 --- a/tests/testdata/run/type_directives_01.ts.out +++ b/tests/testdata/run/type_directives_01.ts.out @@ -1,3 +1,3 @@ [WILDCARD] -DEBUG TS - host.getSourceFile("http://127.0.0.1:4545/xTypeScriptTypes.d.ts", Latest) +DEBUG TS - host.getSourceFile("http://localhost:4545/xTypeScriptTypes.d.ts", Latest) [WILDCARD] \ No newline at end of file diff --git a/tests/testdata/run/type_headers_deno_types.ts b/tests/testdata/run/type_headers_deno_types.ts index 9670f68cd..197ac1801 100644 --- a/tests/testdata/run/type_headers_deno_types.ts +++ b/tests/testdata/run/type_headers_deno_types.ts @@ -12,7 +12,7 @@ * header. */ -// @deno-types="http://127.0.0.1:4545/run/type_headers_deno_types.foo.d.ts" -import { foo } from "http://127.0.0.1:4545/run/type_headers_deno_types.foo.js"; +// @deno-types="http://localhost:4545/run/type_headers_deno_types.foo.d.ts" +import { foo } from "http://localhost:4545/run/type_headers_deno_types.foo.js"; foo("hello"); diff --git a/tests/testdata/workers/permissions_dynamic_remote.ts b/tests/testdata/workers/permissions_dynamic_remote.ts deleted file mode 100644 index 54a361bc0..000000000 --- a/tests/testdata/workers/permissions_dynamic_remote.ts +++ /dev/null @@ -1,11 +0,0 @@ -new Worker( - "http://localhost:4545/workers/dynamic_remote.ts", - { - type: "module", - deno: { - permissions: { - net: false, - }, - }, - }, -); diff --git a/tests/testdata/workers/permissions_dynamic_remote.ts.out b/tests/testdata/workers/permissions_dynamic_remote.ts.out deleted file mode 100644 index 4fb2c2234..000000000 --- a/tests/testdata/workers/permissions_dynamic_remote.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -error: Uncaught (in worker "") (in promise) TypeError: Requires net access to "example.com:443", run again with the --allow-net flag -await import("" + "https://example.com/some/file.ts"); -^ - at async http://localhost:4545/workers/dynamic_remote.ts:2:1 -[WILDCARD]error: Uncaught (in promise) Error: Unhandled error in child worker. - at Worker.#pollControl [WILDCARD] diff --git a/tests/testdata/workers/permissions_remote_remote.ts b/tests/testdata/workers/permissions_remote_remote.ts deleted file mode 100644 index 4df2a8a5d..000000000 --- a/tests/testdata/workers/permissions_remote_remote.ts +++ /dev/null @@ -1,3 +0,0 @@ -new Worker("http://localhost:4545/workers/static_remote.ts", { - type: "module", -}); diff --git a/tests/testdata/workers/static_remote.ts b/tests/testdata/workers/static_remote.ts index 2d6e820fd..6bb64eccd 100644 --- a/tests/testdata/workers/static_remote.ts +++ b/tests/testdata/workers/static_remote.ts @@ -1,2 +1,2 @@ -// This file doesn't really exist, but it doesn't matter, a "PermissionsDenied" error should be thrown. +// This file doesn't really exist, but it doesn't matter, a "NotCapable" error should be thrown. import "https://example.com/some/file.ts"; -- cgit v1.2.3