From 15a763152f9d392cb80692262f8de5ef8ae15495 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 11 Aug 2021 10:20:47 -0400 Subject: [PATCH] chore: move test files to testdata directory (#11601) --- .dprint.json | 8 +- .gitattributes | 4 +- cli/bench/main.rs | 41 ++++-- cli/bench/throughput.rs | 10 +- cli/config_file.rs | 15 +-- cli/file_fetcher.rs | 100 ++++++--------- cli/fs_util.rs | 8 +- cli/http_util.rs | 54 ++++---- cli/lsp/sources.rs | 7 +- cli/module_graph.rs | 34 ++--- cli/specifier_handler.rs | 17 ++- cli/tests/006_url_imports.ts | 3 - cli/tests/019_media_types.ts | 24 ---- cli/tests/022_info_flag_script.out | 14 -- cli/tests/035_cached_only_flag.out | 1 - cli/tests/037_fetch_multiple.out | 5 - cli/tests/045_proxy_test.ts.out | 6 - cli/tests/048_media_types_jsx.ts | 32 ----- cli/tests/049_info_flag_script_jsx.out | 14 -- cli/tests/053_import_compression/main.ts | 13 -- ...plays_all_overloads_in_details_view.ts.out | 12 -- cli/tests/README.md | 3 - cli/tests/bundle_dynamic_import.ts | 3 - cli/tests/cache_extensionless.out | 2 - cli/tests/cache_random_extension.out | 2 - cli/tests/cafile_info.ts | 24 ---- cli/tests/cafile_info.ts.out | 13 -- cli/tests/cafile_url_imports.ts | 3 - cli/tests/config_types_remote.tsconfig.json | 7 - cli/tests/disallow_http_from_https_js.out | 3 - cli/tests/disallow_http_from_https_ts.out | 3 - .../permissions_remote_remote.ts | 3 - .../permissions_remote_remote.ts.out | 5 - cli/tests/error_001.ts.out | 6 - cli/tests/error_002.ts.out | 6 - cli/tests/error_004_missing_module.ts.out | 2 - .../error_015_dynamic_import_permissions.js | 3 - cli/tests/error_019_stack_function.ts.out | 8 -- cli/tests/error_020_stack_constructor.ts.out | 8 -- cli/tests/error_021_stack_method.ts.out | 8 -- cli/tests/error_022_stack_custom_error.ts.out | 6 - cli/tests/error_023_stack_async.ts.out | 10 -- cli/tests/error_024_stack_promise_all.ts.out | 10 -- cli/tests/error_025_tab_indent.out | 6 - cli/tests/error_026_remote_import_error.ts | 1 - .../error_026_remote_import_error.ts.out | 7 - .../error_missing_module_named_import.ts.out | 2 - cli/tests/error_syntax.js.out | 1 - .../error_syntax_empty_trailing_line.mjs.out | 1 - cli/tests/error_worker_permissions_remote.ts | 4 - cli/tests/fetch/other.ts | 1 - cli/tests/fetch/test.ts | 1 - cli/tests/https_import.ts | 3 - cli/tests/import_file_with_colon.ts | 1 - cli/tests/info_missing_module.out | 6 - cli/tests/info_recursive_imports_test.out | 12 -- cli/tests/inline_js_source_map_2.js | 4 - cli/tests/inline_js_source_map_2.js.out | 2 - ...ne_js_source_map_2_with_inline_contents.js | 4 - ..._js_source_map_with_contents_from_graph.js | 4 - cli/tests/integration/bundle_tests.rs | 62 +++++---- cli/tests/integration/cache_tests.rs | 6 +- cli/tests/integration/compile_tests.rs | 40 +++--- cli/tests/integration/coverage_tests.rs | 24 ++-- cli/tests/integration/fmt_tests.rs | 23 ++-- cli/tests/integration/info_tests.rs | 10 +- cli/tests/integration/inspector_tests.rs | 18 +-- cli/tests/integration/install_tests.rs | 6 +- cli/tests/integration/lsp_tests.rs | 20 +-- cli/tests/integration/mod.rs | 120 +++++++++--------- cli/tests/integration/repl_tests.rs | 3 +- cli/tests/integration/run_tests.rs | 113 ++++++++--------- cli/tests/integration/watcher_tests.rs | 24 ++-- cli/tests/integration/worker_tests.rs | 2 +- cli/tests/localhost_unsafe_ssl.ts.out | 3 - cli/tests/lock_check_err.json | 4 - cli/tests/lock_check_err2.json | 10 -- cli/tests/lock_check_err_with_bundle.json | 5 - cli/tests/lock_check_ok.json | 4 - cli/tests/lock_check_ok2.json | 10 -- cli/tests/lock_dynamic_imports.json | 6 - .../lsp/did_open_params_import_hover.json | 8 -- cli/tests/lsp/did_open_params_large.json | 8 -- cli/tests/main_module.ts.out | 2 - cli/tests/redirect_cache.out | 5 - cli/tests/reference_types_remote.ts | 3 - cli/tests/{ => testdata}/001_hello.js | 0 cli/tests/{ => testdata}/001_hello.js.out | 0 cli/tests/{ => testdata}/002_hello.ts | 0 cli/tests/{ => testdata}/002_hello.ts.out | 0 .../{ => testdata}/003_relative_import.ts | 0 .../{ => testdata}/003_relative_import.ts.out | 0 cli/tests/{ => testdata}/004_set_timeout.ts | 0 .../{ => testdata}/004_set_timeout.ts.out | 0 cli/tests/{ => testdata}/005_more_imports.ts | 0 .../{ => testdata}/005_more_imports.ts.out | 0 cli/tests/testdata/006_url_imports.ts | 3 + .../{ => testdata}/006_url_imports.ts.out | 0 cli/tests/{ => testdata}/012_async.ts | 0 cli/tests/{ => testdata}/012_async.ts.out | 0 .../{ => testdata}/013_dynamic_import.ts | 0 .../{ => testdata}/013_dynamic_import.ts.out | 0 .../{ => testdata}/014_duplicate_import.ts | 0 .../014_duplicate_import.ts.out | 0 .../015_duplicate_parallel_import.js | 0 .../015_duplicate_parallel_import.js.out | 0 cli/tests/{ => testdata}/016_double_await.ts | 0 .../{ => testdata}/016_double_await.ts.out | 0 .../{ => testdata}/017_import_redirect.ts | 0 .../{ => testdata}/017_import_redirect.ts.out | 0 .../017_import_redirect_info.out | 2 +- cli/tests/{ => testdata}/018_async_catch.ts | 0 .../{ => testdata}/018_async_catch.ts.out | 0 cli/tests/testdata/019_media_types.ts | 24 ++++ .../{ => testdata}/019_media_types.ts.out | 0 cli/tests/{ => testdata}/020_json_modules.ts | 0 .../{ => testdata}/020_json_modules.ts.out | 2 +- cli/tests/{ => testdata}/021_mjs_modules.ts | 0 .../{ => testdata}/021_mjs_modules.ts.out | 0 cli/tests/testdata/022_info_flag_script.out | 14 ++ cli/tests/{ => testdata}/023_no_ext | 0 cli/tests/{ => testdata}/023_no_ext.out | 0 .../024_import_no_ext_with_headers.ts | 0 .../024_import_no_ext_with_headers.ts.out | 0 cli/tests/{ => testdata}/025_hrtime.ts | 0 cli/tests/{ => testdata}/025_hrtime.ts.out | 0 .../025_reload_js_type_error.js | 0 .../025_reload_js_type_error.js.out | 0 .../{ => testdata}/026_redirect_javascript.js | 0 .../026_redirect_javascript.js.out | 0 .../{ => testdata}/027_redirect_typescript.ts | 0 .../027_redirect_typescript.ts.out | 0 cli/tests/{ => testdata}/028_args.ts | 0 cli/tests/{ => testdata}/028_args.ts.out | 0 cli/tests/{ => testdata}/029_eval.out | 0 cli/tests/{ => testdata}/030_eval_ts.out | 0 .../{ => testdata}/031_info_ts_error.out | 0 cli/tests/{ => testdata}/031_info_ts_error.ts | 0 cli/tests/{ => testdata}/033_import_map.out | 0 .../{ => testdata}/033_import_map_remote.out | 0 cli/tests/{ => testdata}/034_onload.out | 0 .../{ => testdata}/034_onload/imported.ts | 2 +- cli/tests/{ => testdata}/034_onload/main.ts | 2 +- .../034_onload/nest_imported.ts | 2 +- cli/tests/testdata/035_cached_only_flag.out | 1 + .../{ => testdata}/036_import_map_fetch.out | 0 cli/tests/testdata/037_fetch_multiple.out | 5 + cli/tests/{ => testdata}/038_checkjs.js | 0 cli/tests/{ => testdata}/038_checkjs.js.out | 6 +- .../{ => testdata}/038_checkjs.tsconfig.json | 0 .../{ => testdata}/041_dyn_import_eval.out | 0 cli/tests/{ => testdata}/041_info_flag.out | 0 .../{ => testdata}/041_info_flag_location.out | 0 .../042_dyn_import_evalcontext.ts | 0 .../042_dyn_import_evalcontext.ts.out | 0 cli/tests/{ => testdata}/044_bad_resource.ts | 0 .../{ => testdata}/044_bad_resource.ts.out | 0 cli/tests/testdata/045_mod.ts | 5 + cli/tests/testdata/045_output.ts | 3 + .../045_programmatic_proxy_client.ts | 2 +- cli/tests/{ => testdata}/045_proxy_client.ts | 2 +- cli/tests/{ => testdata}/045_proxy_test.ts | 8 +- cli/tests/testdata/045_proxy_test.ts.out | 6 + cli/tests/{ => testdata}/046_jsx_test.tsx | 0 cli/tests/{ => testdata}/046_jsx_test.tsx.out | 0 cli/tests/{ => testdata}/047_jsx_test.jsx | 0 cli/tests/{ => testdata}/047_jsx_test.jsx.out | 0 cli/tests/testdata/048_media_types_jsx.ts | 32 +++++ .../{ => testdata}/048_media_types_jsx.ts.out | 0 .../testdata/049_info_flag_script_jsx.out | 14 ++ .../{ => testdata}/052_no_remote_flag.out | 2 +- .../{ => testdata}/053_import_compression.out | 0 .../053_import_compression/brotli | 0 .../053_import_compression/gziped | Bin .../testdata/053_import_compression/main.ts | 13 ++ .../{ => testdata}/054_info_local_imports.out | 0 .../{ => testdata}/055_info_file_json.out | 16 +-- .../056_make_temp_file_write_perm.out | 0 .../056_make_temp_file_write_perm.ts | 0 .../058_tasks_microtasks_close.ts | 0 .../058_tasks_microtasks_close.ts.out | 0 .../059_fs_relative_path_perm.ts | 0 .../059_fs_relative_path_perm.ts.out | 0 ..._displays_all_overloads_in_details_view.ts | 0 ...plays_all_overloads_in_details_view.ts.out | 12 ++ .../{ => testdata}/061_permissions_request.ts | 0 .../061_permissions_request.ts.out | 0 .../062_permissions_request_global.ts | 0 .../062_permissions_request_global.ts.out | 0 .../{ => testdata}/063_permissions_revoke.ts | 0 .../063_permissions_revoke.ts.out | 0 .../064_permissions_revoke_global.ts | 0 .../064_permissions_revoke_global.ts.out | 0 .../{ => testdata}/065_import_map_info.out | 0 cli/tests/{ => testdata}/066_prompt.ts | 0 cli/tests/{ => testdata}/066_prompt.ts.out | 0 cli/tests/{ => testdata}/070_location.ts | 0 cli/tests/{ => testdata}/070_location.ts.out | 0 .../{ => testdata}/071_location_unset.ts | 0 .../{ => testdata}/071_location_unset.ts.out | 0 .../072_location_relative_fetch.ts | 0 .../072_location_relative_fetch.ts.out | 0 .../075_import_local_query_hash.ts | 0 .../075_import_local_query_hash.ts.out | 0 .../076_info_json_deps_order.out | 26 ++-- .../076_info_json_deps_order.ts | 0 cli/tests/{ => testdata}/077_fetch_empty.ts | 0 .../{ => testdata}/077_fetch_empty.ts.out | 0 .../{ => testdata}/078_unload_on_exit.ts | 0 .../{ => testdata}/078_unload_on_exit.ts.out | 0 .../079_location_authentication.ts | 0 .../079_location_authentication.ts.out | 0 .../080_deno_emit_permissions.ts | 0 .../080_deno_emit_permissions.ts.out | 0 .../081_location_relative_fetch_redirect.ts | 0 ...81_location_relative_fetch_redirect.ts.out | 0 .../082_prepare_stack_trace_throw.js | 0 .../082_prepare_stack_trace_throw.js.out | 0 .../083_legacy_external_source_map.ts | 0 .../084_worker_custom_inspect.ts | 0 .../084_worker_custom_inspect.ts.out | 0 .../084_worker_custom_inspect_worker.ts | 0 .../085_dynamic_import_async_error.ts | 0 .../085_dynamic_import_async_error.ts.out | 0 .../086_dynamic_import_already_rejected.ts | 0 ...086_dynamic_import_already_rejected.ts.out | 0 cli/tests/{ => testdata}/087_hello.ts | 0 ...087_no_check_imports_not_used_as_values.ts | 0 ...no_check_imports_not_used_as_values.ts.out | 0 .../088_dynamic_import_already_evaluating.ts | 0 ...8_dynamic_import_already_evaluating.ts.out | 0 .../088_dynamic_import_target.ts | 0 .../{ => testdata}/089_run_allow_list.ts | 0 .../{ => testdata}/089_run_allow_list.ts.out | 0 .../090_run_permissions_request.ts | 0 .../090_run_permissions_request.ts.out | 0 .../091_use_define_for_class_fields.ts | 0 .../091_use_define_for_class_fields.ts.out | 0 .../092_import_map_unmapped_bare_specifier.ts | 0 ..._import_map_unmapped_bare_specifier.ts.out | 0 .../095_cache_with_bare_import.ts | 0 .../095_cache_with_bare_import.ts.out | 0 cli/tests/{ => testdata}/Component.tsx | 0 cli/tests/{ => testdata}/DenoWinRunner.cs | 0 cli/tests/{ => testdata}/DenoWinRunner.ps1 | 0 cli/tests/{ => testdata}/async_error.ts | 0 cli/tests/{ => testdata}/async_error.ts.out | 4 +- cli/tests/{ => testdata}/badly_formatted.json | 0 cli/tests/{ => testdata}/badly_formatted.md | 0 cli/tests/{ => testdata}/badly_formatted.mjs | 0 .../{ => testdata}/badly_formatted_fixed.js | 0 .../{ => testdata}/badly_formatted_fixed.json | 0 .../{ => testdata}/badly_formatted_fixed.md | 0 .../{ => testdata}/blob_gc_finalization.js | 0 .../blob_gc_finalization.js.out | 0 cli/tests/{ => testdata}/bundle.test.out | 0 .../bundle/file_tests-fixture01.ts | 0 .../bundle/file_tests-fixture02.ts | 0 .../bundle/file_tests-fixture03.ts | 0 .../bundle/file_tests-fixture04.ts | 0 .../bundle/file_tests-fixture05.ts | 0 .../bundle/file_tests-fixture06.ts | 0 .../bundle/file_tests-fixture07.ts | 0 .../bundle/file_tests-fixture08.ts | 0 .../bundle/file_tests-fixture09.ts | 0 .../bundle/file_tests-fixture10.ts | 0 .../bundle/file_tests-fixture11.ts | 0 .../bundle/file_tests-fixture12.ts | 0 .../bundle/file_tests-fixture13.ts | 0 .../bundle/file_tests-fixture14.ts | 0 .../bundle/file_tests-fixture15.ts | 0 .../bundle/file_tests-subdir-a.ts | 0 .../bundle/file_tests-subdir-b.ts | 0 .../bundle/file_tests-subdir-c.ts | 0 .../bundle/file_tests-subdir-d.ts | 0 .../bundle/file_tests-subdir-e.ts | 0 .../bundle/file_tests-subdir-f.ts | 0 .../bundle/file_tests-subdir-g.ts | 0 .../bundle/file_tests-subdir-h.ts | 0 .../bundle/file_tests-subdir-i.ts | 0 .../bundle/file_tests-subdir-j.ts | 0 .../bundle/file_tests-subdir-k.ts | 0 .../bundle/file_tests-subdir-l.ts | 0 .../bundle/file_tests-subdir-m.ts | 0 .../bundle/file_tests-subdir-n.ts | 0 .../bundle/file_tests-subdir-o.ts | 0 .../bundle/file_tests-subdir-p.ts | 0 .../bundle/file_tests-subdir-q.ts | 0 cli/tests/{ => testdata}/bundle/fixture01.out | 0 cli/tests/{ => testdata}/bundle/fixture02.out | 0 cli/tests/{ => testdata}/bundle/fixture03.out | 0 cli/tests/{ => testdata}/bundle/fixture04.out | 0 cli/tests/{ => testdata}/bundle/fixture05.out | 0 cli/tests/{ => testdata}/bundle/fixture06.out | 0 cli/tests/{ => testdata}/bundle/fixture07.out | 0 cli/tests/{ => testdata}/bundle/fixture08.out | 0 cli/tests/{ => testdata}/bundle/fixture09.out | 0 cli/tests/{ => testdata}/bundle/fixture10.out | 0 cli/tests/{ => testdata}/bundle/fixture11.out | 0 cli/tests/{ => testdata}/bundle/fixture12.out | 0 cli/tests/{ => testdata}/bundle/fixture13.out | 0 cli/tests/{ => testdata}/bundle/fixture14.out | 0 cli/tests/{ => testdata}/bundle/fixture15.out | 0 .../bundle/https_deno.land-x-lib-a.ts | 0 .../bundle/https_deno.land-x-lib-b.js | 0 .../bundle/https_deno.land-x-lib-c.d.ts | 0 .../bundle/https_deno.land-x-lib-c.js | 0 .../bundle/https_deno.land-x-lib-mod.d.ts | 0 .../bundle/https_deno.land-x-lib-mod.js | 0 cli/tests/testdata/bundle_dynamic_import.ts | 3 + cli/tests/{ => testdata}/bundle_im.json | 0 cli/tests/{ => testdata}/bundle_im.ts | 0 cli/tests/{ => testdata}/bundle_jsx.out | 0 cli/tests/testdata/cache_extensionless.out | 2 + cli/tests/testdata/cache_random_extension.out | 2 + cli/tests/testdata/cafile_info.ts | 24 ++++ cli/tests/testdata/cafile_info.ts.out | 13 ++ cli/tests/{ => testdata}/cafile_ts_fetch.ts | 2 +- .../{ => testdata}/cafile_ts_fetch.ts.out | 0 .../cafile_ts_fetch_unsafe_ssl.ts.out | 0 cli/tests/testdata/cafile_url_imports.ts | 3 + .../{ => testdata}/cafile_url_imports.ts.out | 0 .../cafile_url_imports_unsafe_ssl.ts.out | 0 cli/tests/{ => testdata}/cat.ts | 2 +- cli/tests/{ => testdata}/circular1.js | 0 cli/tests/{ => testdata}/circular1.js.out | 0 cli/tests/{ => testdata}/circular2.js | 0 cli/tests/{ => testdata}/cjs_imports.ts | 0 cli/tests/{ => testdata}/cjs_imports.ts.out | 0 cli/tests/{ => testdata}/commonjs.cjs | 0 cli/tests/{ => testdata}/compiler_api_test.ts | 6 +- .../complex_permissions_test.ts | 0 cli/tests/{ => testdata}/config.ts | 0 cli/tests/{ => testdata}/config.ts.out | 2 +- cli/tests/{ => testdata}/config.tsconfig.json | 0 cli/tests/{ => testdata}/config_types.ts | 0 cli/tests/{ => testdata}/config_types.ts.out | 0 .../{ => testdata}/config_types.tsconfig.json | 0 .../config_types_remote.tsconfig.json | 7 + cli/tests/{ => testdata}/coverage/branch.ts | 0 .../{ => testdata}/coverage/branch_test.ts | 0 cli/tests/{ => testdata}/coverage/complex.ts | 0 .../{ => testdata}/coverage/complex_test.ts | 0 .../coverage/expected_branch.lcov | 0 .../coverage/expected_branch.out | 0 .../coverage/expected_complex.lcov | 0 .../coverage/expected_complex.out | 0 cli/tests/{ => testdata}/delayed_error.ts | 0 cli/tests/{ => testdata}/deno_doc.out | 0 cli/tests/{ => testdata}/deno_doc.ts | 0 cli/tests/{ => testdata}/deno_doc_builtin.out | 0 .../{ => testdata}/deno_dom_0.1.3-alpha2.wasm | Bin .../{ => testdata}/deno_land_unsafe_ssl.ts | 0 .../deno_land_unsafe_ssl.ts.out | 0 .../disallow_http_from_https.js | 2 +- .../disallow_http_from_https.ts | 2 +- .../testdata/disallow_http_from_https_js.out | 3 + .../testdata/disallow_http_from_https_ts.out | 3 + cli/tests/{ => testdata}/doc/import_map.json | 0 cli/tests/{ => testdata}/doc/invalid_url.out | 0 cli/tests/{ => testdata}/doc/module/fun.js | 0 cli/tests/{ => testdata}/doc/types_header.out | 0 cli/tests/{ => testdata}/doc/types_header.ts | 0 cli/tests/{ => testdata}/doc/types_hint.out | 0 cli/tests/{ => testdata}/doc/types_hint.ts | 0 cli/tests/{ => testdata}/doc/types_ref.js | 0 cli/tests/{ => testdata}/doc/types_ref.out | 0 .../{ => testdata}/doc/use_import_map.js | 0 .../{ => testdata}/doc/use_import_map.out | 0 cli/tests/{ => testdata}/dynamic_import/b.js | 0 cli/tests/{ => testdata}/dynamic_import/c.js | 0 .../dynamic_import/permissions_blob_local.ts | 0 .../permissions_blob_local.ts.out | 2 +- .../dynamic_import/permissions_blob_remote.ts | 0 .../permissions_blob_remote.ts.out | 2 +- .../dynamic_import/permissions_data_local.ts | 0 .../permissions_data_local.ts.out | 2 +- .../dynamic_import/permissions_data_remote.ts | 0 .../permissions_data_remote.ts.out | 2 +- .../permissions_remote_remote.ts | 3 + .../permissions_remote_remote.ts.out | 5 + .../dynamic_import/static_remote.ts | 0 .../dynamic_import_conditional.js | 0 .../dynamic_import_conditional.js.out | 0 cli/tests/{ => testdata}/echo.ts | 0 cli/tests/{ => testdata}/echo_server.ts | 2 +- cli/tests/{ => testdata}/encoding/utf-16be.ts | Bin cli/tests/{ => testdata}/encoding/utf-16le.ts | Bin cli/tests/{ => testdata}/encoding/utf-8.ts | 0 .../{ => testdata}/encoding/windows-1255 | 0 cli/tests/{ => testdata}/error_001.ts | 0 cli/tests/testdata/error_001.ts.out | 6 + cli/tests/{ => testdata}/error_002.ts | 0 cli/tests/testdata/error_002.ts.out | 6 + .../{ => testdata}/error_003_typescript.ts | 0 .../error_003_typescript.ts.out | 2 +- .../error_004_missing_module.ts | 0 .../testdata/error_004_missing_module.ts.out | 2 + .../error_005_missing_dynamic_import.ts | 0 .../error_005_missing_dynamic_import.ts.out | 2 +- .../error_006_import_ext_failure.ts | 0 .../error_006_import_ext_failure.ts.out | 2 +- cli/tests/{ => testdata}/error_007_any.ts | 0 cli/tests/{ => testdata}/error_007_any.ts.out | 0 cli/tests/{ => testdata}/error_008_checkjs.js | 0 .../{ => testdata}/error_008_checkjs.js.out | 2 +- .../error_009_extensions_error.js | 0 .../error_009_extensions_error.js.out | 0 .../error_009_missing_js_module.disabled | 0 .../error_009_missing_js_module.js | 0 .../error_009_missing_js_module.js.out | 0 .../error_010_nonexistent_arg.disabled | 0 .../error_010_nonexistent_arg.out | 0 .../error_011_bad_module_specifier.ts | 0 .../error_011_bad_module_specifier.ts.out | 0 .../error_012_bad_dynamic_import_specifier.ts | 0 ...or_012_bad_dynamic_import_specifier.ts.out | 0 .../error_013_missing_script.out | 0 .../error_014_catch_dynamic_import_error.js | 0 ...rror_014_catch_dynamic_import_error.js.out | 4 +- .../error_015_dynamic_import_permissions.js | 3 + .../error_015_dynamic_import_permissions.out | 2 +- .../error_016_dynamic_import_permissions2.js | 2 +- .../error_016_dynamic_import_permissions2.out | 2 +- .../error_017_hide_long_source_ts.ts | 0 .../error_017_hide_long_source_ts.ts.out | 2 +- .../error_018_hide_long_source_js.js | 0 .../error_018_hide_long_source_js.js.out | 2 +- .../error_019_stack_function.ts | 0 .../testdata/error_019_stack_function.ts.out | 8 ++ .../error_020_stack_constructor.ts | 0 .../error_020_stack_constructor.ts.out | 8 ++ .../{ => testdata}/error_021_stack_method.ts | 0 .../testdata/error_021_stack_method.ts.out | 8 ++ .../error_022_stack_custom_error.ts | 0 .../error_022_stack_custom_error.ts.out | 6 + .../{ => testdata}/error_023_stack_async.ts | 0 .../testdata/error_023_stack_async.ts.out | 10 ++ .../error_024_stack_promise_all.ts | 0 .../error_024_stack_promise_all.ts.out | 10 ++ cli/tests/{ => testdata}/error_025_tab_indent | 0 cli/tests/testdata/error_025_tab_indent.out | 6 + .../testdata/error_026_remote_import_error.ts | 1 + .../error_026_remote_import_error.ts.out | 7 + .../error_027_bundle_with_bare_import.ts | 0 .../error_027_bundle_with_bare_import.ts.out | 0 .../error_import_map_unable_to_load.out | 0 .../error_local_static_import_from_remote.js | 0 ...ror_local_static_import_from_remote.js.out | 2 +- .../error_local_static_import_from_remote.ts | 0 ...ror_local_static_import_from_remote.ts.out | 2 +- .../error_missing_module_named_import.ts | 0 .../error_missing_module_named_import.ts.out | 2 + cli/tests/{ => testdata}/error_no_check.ts | 0 .../{ => testdata}/error_no_check.ts.out | 0 cli/tests/{ => testdata}/error_syntax.js | 0 cli/tests/testdata/error_syntax.js.out | 1 + .../error_syntax_empty_trailing_line.mjs | 0 .../error_syntax_empty_trailing_line.mjs.out | 1 + .../{ => testdata}/error_type_definitions.ts | 0 .../error_type_definitions.ts.out | 0 .../error_worker_permissions_local.ts | 0 .../error_worker_permissions_local.ts.out | 0 .../error_worker_permissions_remote.ts | 4 + .../error_worker_permissions_remote.ts.out | 0 cli/tests/{ => testdata}/es_private_fields.js | 0 .../{ => testdata}/es_private_fields.js.out | 0 cli/tests/{ => testdata}/esm_imports_a.js | 0 cli/tests/{ => testdata}/esm_imports_b.js | 0 cli/tests/{ => testdata}/exec_path.ts | 0 cli/tests/{ => testdata}/exit_error42.ts | 0 cli/tests/{ => testdata}/exit_error42.ts.out | 0 cli/tests/{ => testdata}/export_type_def.ts | 0 cli/tests/{ => testdata}/fetch/hello.txt | 0 cli/tests/testdata/fetch/other.ts | 1 + cli/tests/testdata/fetch/test.ts | 1 + .../fetch_response_finalization.js | 0 .../fetch_response_finalization.js.out | 0 cli/tests/{ => testdata}/file_exists.ts | 0 .../{ => testdata}/finalization_registry.js | 0 .../finalization_registry.js.out | 0 .../fix_dynamic_import_errors.js | 0 .../fix_dynamic_import_errors.js.out | 0 .../{ => testdata}/fix_emittable_skipped.js | 0 .../fix_emittable_skipped.ts.out | 0 .../{ => testdata}/fix_exotic_specifiers.ts | 0 .../fix_exotic_specifiers.ts.out | 0 cli/tests/{ => testdata}/fix_js_import_js.ts | 0 .../{ => testdata}/fix_js_import_js.ts.out | 0 cli/tests/{ => testdata}/fix_js_imports.ts | 0 .../{ => testdata}/fix_js_imports.ts.out | 0 .../{ => testdata}/fix_tsc_file_exists.out | 0 .../fix_worker_dispatchevent.ts | 0 .../fix_worker_dispatchevent.ts.out | 0 cli/tests/{ => testdata}/fixture.json | 0 .../expected_fmt_check_formatted_files.out | 0 .../fmt/expected_fmt_check_ignore.out | 0 .../fmt/expected_fmt_check_tests_dir.out | 0 ...cted_fmt_check_verbose_formatted_files.out | 0 .../expected_fmt_check_verbose_tests_dir.out | 0 cli/tests/{ => testdata}/fmt/formatted1.js | 0 cli/tests/{ => testdata}/fmt/formatted2.ts | 0 cli/tests/{ => testdata}/fmt/formatted3.md | 0 cli/tests/{ => testdata}/fmt/formatted4.jsonc | 0 cli/tests/{ => testdata}/heapstats.js | 0 cli/tests/{ => testdata}/heapstats.js.out | 0 cli/tests/{ => testdata}/hello.txt | 0 cli/tests/testdata/https_import.ts | 3 + cli/tests/{ => testdata}/https_import.ts.out | 0 cli/tests/{ => testdata}/if_main.ts | 0 cli/tests/{ => testdata}/if_main.ts.out | 0 cli/tests/{ => testdata}/ignore_require.js | 0 cli/tests/{ => testdata}/import_blob_url.ts | 0 .../{ => testdata}/import_blob_url.ts.out | 0 .../import_blob_url_error_stack.ts | 0 .../import_blob_url_error_stack.ts.out | 2 +- .../import_blob_url_import_relative.ts | 0 .../import_blob_url_import_relative.ts.out | 2 +- .../{ => testdata}/import_blob_url_imports.ts | 2 +- .../import_blob_url_imports.ts.out | 0 .../{ => testdata}/import_blob_url_jsx.ts | 0 .../{ => testdata}/import_blob_url_jsx.ts.out | 0 cli/tests/{ => testdata}/import_data_url.ts | 0 .../{ => testdata}/import_data_url.ts.out | 0 .../import_data_url_error_stack.ts | 0 .../import_data_url_error_stack.ts.out | 2 +- .../import_data_url_import_relative.ts | 0 .../import_data_url_import_relative.ts.out | 0 .../{ => testdata}/import_data_url_imports.ts | 4 +- .../import_data_url_imports.ts.out | 0 .../{ => testdata}/import_data_url_jsx.ts | 0 .../{ => testdata}/import_data_url_jsx.ts.out | 0 .../{ => testdata}/import_dynamic_data_url.ts | 0 .../import_dynamic_data_url.ts.out | 0 cli/tests/testdata/import_file_with_colon.ts | 1 + .../import_file_with_colon.ts.out | 0 .../import_maps/import_map.json | 0 .../import_maps/import_map_remote.json | 0 .../import_maps/lodash/lodash.ts | 0 .../import_maps/lodash/other_file.ts | 0 .../import_maps/moment/moment.ts | 0 .../import_maps/moment/other_file.ts | 0 .../import_maps/scope/scoped.ts | 0 .../import_maps/scoped_moment.ts | 0 cli/tests/{ => testdata}/import_maps/test.ts | 0 .../{ => testdata}/import_maps/test_remote.ts | 0 cli/tests/{ => testdata}/import_maps/vue.ts | 0 cli/tests/{ => testdata}/import_meta.ts | 0 cli/tests/{ => testdata}/import_meta.ts.out | 0 cli/tests/{ => testdata}/import_meta2.ts | 0 .../info/data_null_error/data_null_error.out | 0 .../info/data_null_error/mod.ts | 0 .../info/data_null_error/types.d.ts | 0 .../{ => testdata}/info/types_header.out | 0 cli/tests/{ => testdata}/info_json.out | 0 .../{ => testdata}/info_json_location.out | 0 cli/tests/testdata/info_missing_module.out | 6 + .../testdata/info_recursive_imports_test.out | 12 ++ .../info_recursive_imports_test.ts | 0 cli/tests/{ => testdata}/info_type_import.out | 0 cli/tests/{ => testdata}/info_type_import.ts | 0 .../{ => testdata}/inline_js_source_map.ts | 0 cli/tests/testdata/inline_js_source_map_2.js | 4 + .../testdata/inline_js_source_map_2.js.out | 2 + .../{ => testdata}/inline_js_source_map_2.ts | 0 ...ne_js_source_map_2_with_inline_contents.js | 4 + ...s_source_map_2_with_inline_contents.js.out | 2 +- ..._js_source_map_with_contents_from_graph.js | 4 + ...source_map_with_contents_from_graph.js.out | 2 +- cli/tests/{ => testdata}/inspector1.js | 0 cli/tests/{ => testdata}/inspector2.js | 0 cli/tests/{ => testdata}/inspector3.js | 0 cli/tests/{ => testdata}/inspector4.js | 0 cli/tests/{ => testdata}/js_import_detect.ts | 0 .../{ => testdata}/js_import_detect.ts.out | 0 .../{ => testdata}/jsx_import_from_ts.App.jsx | 0 .../{ => testdata}/jsx_import_from_ts.ts | 0 .../{ => testdata}/jsx_import_from_ts.ts.out | 0 .../{ => testdata}/lib_dom_asynciterable.ts | 0 .../lib_dom_asynciterable.ts.out | 0 cli/tests/{ => testdata}/lib_ref.ts | 0 cli/tests/{ => testdata}/lib_ref.ts.out | 0 cli/tests/{ => testdata}/lib_runtime_api.ts | 0 .../{ => testdata}/lib_runtime_api.ts.out | 0 cli/tests/{ => testdata}/lint/expected.out | 0 .../lint/expected_from_stdin.out | 0 .../lint/expected_from_stdin_json.out | 0 .../{ => testdata}/lint/expected_glob.out | 0 .../{ => testdata}/lint/expected_ignore.out | 0 .../{ => testdata}/lint/expected_json.out | 0 .../{ => testdata}/lint/expected_quiet.out | 0 .../{ => testdata}/lint/expected_rules.out | 0 .../{ => testdata}/lint/expected_verbose.out | 0 cli/tests/{ => testdata}/lint/file1.js | 0 cli/tests/{ => testdata}/lint/file2.ts | 0 cli/tests/{ => testdata}/lint/ignored_file.ts | 0 cli/tests/{ => testdata}/lint/malformed.js | 0 cli/tests/{ => testdata}/listen_tls_alpn.ts | 4 +- .../testdata/localhost_unsafe_ssl.ts.out | 3 + cli/tests/testdata/lock_check_err.json | 4 + cli/tests/{ => testdata}/lock_check_err.out | 2 +- cli/tests/testdata/lock_check_err2.json | 10 ++ cli/tests/{ => testdata}/lock_check_err2.out | 2 +- .../testdata/lock_check_err_with_bundle.json | 5 + .../lock_check_err_with_bundle.out | 2 +- cli/tests/testdata/lock_check_ok.json | 4 + cli/tests/testdata/lock_check_ok2.json | 10 ++ cli/tests/testdata/lock_dynamic_imports.json | 6 + .../{ => testdata}/lock_dynamic_imports.out | 2 +- cli/tests/{ => testdata}/lock_write_fetch.ts | 0 .../{ => testdata}/lock_write_fetch.ts.out | 0 .../lock_write_requires_lock.out | 0 cli/tests/{ => testdata}/lsp/a.d.ts | 0 cli/tests/{ => testdata}/lsp/b.d.ts | 0 .../lsp/code_action_ignore_lint_params.json | 0 .../lsp/code_action_ignore_lint_response.json | 0 .../lsp/code_action_params.json | 0 .../lsp/code_action_params_cache.json | 0 .../lsp/code_action_params_deadlock.json | 0 .../lsp/code_action_params_imports.json | 0 .../lsp/code_action_params_refactor.json | 0 .../lsp/code_action_resolve_params.json | 0 .../code_action_resolve_params_imports.json | 0 .../code_action_resolve_params_refactor.json | 0 .../lsp/code_action_resolve_response.json | 0 .../code_action_resolve_response_imports.json | 0 ...code_action_resolve_response_refactor.json | 0 .../lsp/code_action_response.json | 0 .../lsp/code_action_response_cache.json | 0 .../lsp/code_action_response_imports.json | 0 .../lsp/code_action_response_no_disabled.json | 0 .../lsp/code_action_response_refactor.json | 0 .../lsp/code_lens_resolve_response.json | 0 .../lsp/code_lens_resolve_response_impl.json | 0 .../lsp/code_lens_response.json | 0 .../lsp/code_lens_response_changed.json | 0 .../lsp/code_lens_response_impl.json | 0 .../lsp/code_lens_response_test.json | 0 .../completion_request_params_optional.json | 0 .../completion_request_response_empty.json | 0 .../lsp/completion_resolve_params.json | 0 .../completion_resolve_params_optional.json | 0 .../completion_resolve_params_registry.json | 0 .../lsp/completion_resolve_response.json | 0 .../completion_resolve_response_registry.json | 0 .../lsp/diagnostics_deno_deps.json | 0 .../lsp/diagnostics_deno_types.json | 0 .../lsp/did_open_params_deno_types.json | 0 .../lsp/did_open_params_doc_symbol.json | 0 .../lsp/did_open_params_import_hover.json | 8 ++ .../testdata/lsp/did_open_params_large.json | 8 ++ .../lsp/did_open_params_semantic_tokens.json | 0 .../lsp/did_open_params_test_code_lens.json | 0 .../lsp/document_symbol_response.json | 0 .../lsp/formatting_mbc_response.json | 0 cli/tests/{ => testdata}/lsp/import-map.json | 0 .../lsp/incoming_calls_params.json | 0 .../lsp/incoming_calls_response.json | 0 .../{ => testdata}/lsp/initialize_params.json | 0 .../initialize_params_bad_config_option.json | 0 .../lsp/initialize_params_ca_no_disabled.json | 0 .../lsp/initialize_params_code_lens_test.json | 0 ...ialize_params_code_lens_test_disabled.json | 0 .../initialize_params_did_config_change.json | 0 .../lsp/initialize_params_disabled.json | 0 .../lsp/initialize_params_registry.json | 0 .../lsp/initialize_params_unstable.json | 0 .../{ => testdata}/lsp/lib.tsconfig.json | 0 .../lsp/outgoing_calls_params.json | 0 .../lsp/outgoing_calls_response.json | 0 .../lsp/prepare_call_hierarchy_response.json | 0 .../lsp/registries/a_latest.json | 0 .../lsp/registries/a_v1.0.0.json | 0 .../lsp/registries/a_v1.0.1.json | 0 .../lsp/registries/a_v2.0.0.json | 0 .../lsp/registries/a_versions.json | 0 .../lsp/registries/b_latest.json | 0 .../lsp/registries/b_v0.0.1.json | 0 .../lsp/registries/b_v0.0.2.json | 0 .../lsp/registries/b_v0.0.3.json | 0 .../lsp/registries/b_versions.json | 0 .../registries/deno-import-intellisense.json | 10 +- .../lsp/registries/modules.json | 0 .../{ => testdata}/lsp/rename_response.json | 0 .../lsp/selection_range_response.json | 0 .../{ => testdata}/lsp/types.tsconfig.json | 0 cli/tests/{ => testdata}/main_module.ts | 0 cli/tests/testdata/main_module.ts.out | 2 + cli/tests/{ => testdata}/main_module2.ts | 0 .../module_graph/file_tests-a.mjs | 0 .../module_graph/file_tests-b-mod.js | 0 .../module_graph/file_tests-b.ts | 0 .../module_graph/file_tests-c-mod.ts | 0 .../file_tests-checkwithconfig.ts | 0 .../module_graph/file_tests-diag.ts | 0 .../module_graph/file_tests-dynamicimport.ts | 0 .../module_graph/file_tests-importjson.ts | 0 .../module_graph/file_tests-importremap.ts | 0 .../module_graph/file_tests-main.ts | 0 .../module_graph/file_tests-some.json | 0 .../module_graph/file_typesref.d.ts | 0 .../module_graph/file_typesref.js | 0 .../https_deno.land-std-http-server.ts | 0 .../module_graph/https_deno.land-x-a-mod.ts | 0 .../module_graph/https_deno.land-x-a.ts | 0 .../https_deno.land-x-import_map.ts | 0 .../module_graph/https_deno.land-x-jquery.js | 0 .../module_graph/https_deno.land-x-lib-a.ts | 0 .../module_graph/https_deno.land-x-lib-b.js | 0 .../module_graph/https_deno.land-x-lib-c.d.ts | 0 .../module_graph/https_deno.land-x-lib-c.js | 0 .../https_deno.land-x-lib-mod.d.ts | 0 .../module_graph/https_deno.land-x-lib-mod.js | 0 .../module_graph/https_deno.land-x-mod.ts | 0 .../https_deno.land-x-transpile.tsx | 0 .../https_unpkg.com-lodash-index.js | 0 .../{ => testdata}/module_graph/lockfile.json | 0 .../module_graph/lockfile_fail.json | 0 .../{ => testdata}/module_graph/tsconfig.json | 0 .../module_graph/tsconfig_01.json | 0 .../{ => testdata}/no_check_decorators.ts | 0 .../{ => testdata}/no_check_decorators.ts.out | 0 cli/tests/{ => testdata}/no_color.js | 0 cli/tests/{ => testdata}/no_mem_cache.js | 0 cli/tests/{ => testdata}/no_mem_cache.js.out | 0 cli/tests/{ => testdata}/no_validate_asm.js | 0 .../{ => testdata}/performance_stats.out | 0 cli/tests/{ => testdata}/permission_test.ts | 2 +- .../preserve_imports.tsconfig.json | 0 cli/tests/{ => testdata}/proto_exploit.js | 0 cli/tests/{ => testdata}/proto_exploit.js.out | 0 cli/tests/{ => testdata}/raw_mode.ts | 0 cli/tests/{ => testdata}/raw_mode_cbreak.ts | 0 .../{ => testdata}/recursive_imports/A.ts | 0 .../{ => testdata}/recursive_imports/B.ts | 0 .../{ => testdata}/recursive_imports/C.ts | 0 .../recursive_imports/common.ts | 0 cli/tests/testdata/redirect_cache.out | 5 + cli/tests/{ => testdata}/reference_types.ts | 0 .../{ => testdata}/reference_types.ts.out | 0 cli/tests/testdata/reference_types_remote.ts | 3 + .../reference_types_remote.ts.out | 0 cli/tests/{ => testdata}/resolve_dns.ts | 0 cli/tests/{ => testdata}/resolve_dns.ts.out | 0 .../{ => testdata}/runtime_decorators.ts | 0 .../{ => testdata}/runtime_decorators.ts.out | 0 cli/tests/{ => testdata}/seed_random.js | 0 cli/tests/{ => testdata}/seed_random.js.out | 0 .../single_compile_with_reload.ts | 0 .../single_compile_with_reload.ts.out | 0 .../single_compile_with_reload_dyn.ts | 0 .../single_compile_with_reload_worker.ts | 0 .../{ => testdata}/standalone_compiler_ops.ts | 0 cli/tests/{ => testdata}/standalone_error.ts | 0 cli/tests/{ => testdata}/standalone_import.ts | 0 .../standalone_import_datauri.ts | 0 .../standalone_runtime_flags.ts | 0 cli/tests/{ => testdata}/std_lint.out | 0 cli/tests/{ => testdata}/stdout_write_all.out | 0 cli/tests/{ => testdata}/stdout_write_all.ts | 0 cli/tests/{ => testdata}/subdir/amd_like.js | 0 .../{ => testdata}/subdir/auto_print_hello.ts | 0 cli/tests/{ => testdata}/subdir/circular1.ts | 0 cli/tests/{ => testdata}/subdir/circular2.ts | 0 cli/tests/{ => testdata}/subdir/comment.ts | 0 cli/tests/{ => testdata}/subdir/config.json | 0 .../{ => testdata}/subdir/emittable.d.ts | 0 cli/tests/{ => testdata}/subdir/empty.ts | 0 .../subdir/evil_remote_import.js | 0 .../{ => testdata}/subdir/foo_types.d.ts | 0 .../{ => testdata}/subdir/form_urlencoded.txt | 0 .../subdir/indirect_import_error.js | 0 .../{ => testdata}/subdir/indirect_throws.js | 0 cli/tests/{ => testdata}/subdir/json_1.json | 0 cli/tests/{ => testdata}/subdir/json_2.json | 0 cli/tests/{ => testdata}/subdir/main.ts | 0 .../{ => testdata}/subdir/mismatch_ext.ts | 0 cli/tests/{ => testdata}/subdir/mod1.ts | 0 cli/tests/{ => testdata}/subdir/mod2.ts | 0 cli/tests/{ => testdata}/subdir/mod3.js | 0 cli/tests/{ => testdata}/subdir/mod4.js | 0 cli/tests/{ => testdata}/subdir/mod5.mjs | 0 cli/tests/{ => testdata}/subdir/mod6.js | 0 .../{ => testdata}/subdir/more_decorators.ts | 0 .../subdir/mt_application_ecmascript.j2.js | 0 .../mt_application_ecmascript_jsx.j2.jsx | 0 .../subdir/mt_application_x_javascript.j4.js | 0 .../mt_application_x_javascript_jsx.j4.jsx | 0 .../subdir/mt_application_x_typescript.t4.ts | 0 .../mt_application_x_typescript_tsx.t4.tsx | 0 .../{ => testdata}/subdir/mt_javascript.js | 0 .../subdir/mt_javascript_jsx.jsx | 0 .../subdir/mt_text_ecmascript.j3.js | 0 .../subdir/mt_text_ecmascript_jsx.j3.jsx | 0 .../subdir/mt_text_javascript.j1.js | 0 .../subdir/mt_text_javascript_jsx.j1.jsx | 0 .../subdir/mt_text_typescript.t1.ts | 0 .../subdir/mt_text_typescript_tsx.t1.tsx | 0 .../{ => testdata}/subdir/mt_video_mp2t.t3.ts | 0 .../subdir/mt_video_mp2t_tsx.t3.tsx | 0 .../{ => testdata}/subdir/mt_video_vdn.t2.ts | 0 .../subdir/mt_video_vdn_tsx.t2.tsx | 0 cli/tests/{ => testdata}/subdir/no_ext | 0 cli/tests/{ => testdata}/subdir/no_js_ext | 0 cli/tests/{ => testdata}/subdir/polyfill.ts | 0 .../{ => testdata}/subdir/print_hello.ts | 0 .../{ => testdata}/subdir/redirects/a.ts | 0 .../{ => testdata}/subdir/redirects/b.ts | 0 .../subdir/redirects/redirect1.js | 0 .../subdir/redirects/redirect1.ts | 0 .../subdir/redirects/redirect2.js | 0 .../subdir/redirects/redirect3.js | 0 .../subdir/redirects/redirect4.ts | 0 .../{ => testdata}/subdir/single_module.ts | 0 .../subdir/subdir2/dynamic_import.ts | 0 .../{ => testdata}/subdir/subdir2/mod2.ts | 0 .../subdir/test_worker_basic.js | 0 cli/tests/{ => testdata}/subdir/throws.js | 0 cli/tests/{ => testdata}/subdir/tla.ts | 0 .../{ => testdata}/subdir/type_and_code.ts | 0 .../{ => testdata}/subdir/type_reference.d.ts | 0 .../{ => testdata}/subdir/type_reference.js | 0 cli/tests/{ => testdata}/subdir/types.d.ts | 0 .../{ => testdata}/subdir/unknown_ext.deno | 0 cli/tests/{ => testdata}/swc_syntax_error.ts | 0 .../{ => testdata}/swc_syntax_error.ts.out | 0 cli/tests/{ => testdata}/symlink_to_subdir | 0 cli/tests/{ => testdata}/test/allow_all.out | 0 cli/tests/{ => testdata}/test/allow_all.ts | 2 +- cli/tests/{ => testdata}/test/allow_none.out | 0 cli/tests/{ => testdata}/test/allow_none.ts | 2 +- .../{ => testdata}/test/clear_timeout.out | 0 .../{ => testdata}/test/clear_timeout.ts | 0 cli/tests/{ => testdata}/test/doc.out | 0 cli/tests/{ => testdata}/test/doc.ts | 0 .../{ => testdata}/test/doc_markdown.out | 0 .../{ => testdata}/test/doc_markdown/doc.md | 0 .../{ => testdata}/test/exit_sanitizer.out | 0 .../{ => testdata}/test/exit_sanitizer.ts | 0 cli/tests/{ => testdata}/test/fail.out | 0 cli/tests/{ => testdata}/test/fail.ts | 0 cli/tests/{ => testdata}/test/fail_fast.out | 0 cli/tests/{ => testdata}/test/fail_fast.ts | 0 .../test/fail_fast_with_val.out | 0 .../{ => testdata}/test/fail_fast_with_val.ts | 0 .../{ => testdata}/test/finally_timeout.out | 0 .../{ => testdata}/test/finally_timeout.ts | 0 cli/tests/{ => testdata}/test/ignore.out | 0 cli/tests/{ => testdata}/test/ignore.ts | 0 .../test/ignore_permissions.out | 0 .../{ => testdata}/test/ignore_permissions.ts | 0 cli/tests/{ => testdata}/test/meta.out | 0 cli/tests/{ => testdata}/test/meta.ts | 0 cli/tests/{ => testdata}/test/no_check.out | 0 cli/tests/{ => testdata}/test/no_check.ts | 0 cli/tests/{ => testdata}/test/no_color.ts | 0 cli/tests/{ => testdata}/test/no_run.out | 0 cli/tests/{ => testdata}/test/no_run.ts | 0 cli/tests/{ => testdata}/test/only.out | 0 cli/tests/{ => testdata}/test/only.ts | 0 cli/tests/{ => testdata}/test/pass.out | 0 cli/tests/{ => testdata}/test/pass.ts | 0 cli/tests/{ => testdata}/test/quiet.out | 0 cli/tests/{ => testdata}/test/quiet.ts | 0 cli/tests/{ => testdata}/test/shuffle.out | 0 .../{ => testdata}/test/shuffle/bar_test.ts | 0 .../{ => testdata}/test/shuffle/baz_test.ts | 0 .../{ => testdata}/test/shuffle/foo_test.ts | 0 .../test/unhandled_rejection.out | 0 .../test/unhandled_rejection.ts | 0 .../test/unresolved_promise.out | 0 .../{ => testdata}/test/unresolved_promise.ts | 0 cli/tests/{ => testdata}/text_decoder_perf.js | 0 .../{ => testdata}/text_encoder_into_perf.js | 0 cli/tests/{ => testdata}/text_encoder_perf.js | 0 cli/tests/{ => testdata}/tla/a.js | 0 cli/tests/{ => testdata}/tla/b.js | 0 cli/tests/{ => testdata}/tla/c.js | 0 cli/tests/{ => testdata}/tla/d.js | 0 cli/tests/{ => testdata}/tla/order.js | 0 cli/tests/{ => testdata}/tla/parent.js | 0 cli/tests/{ => testdata}/tla2/a.js | 0 cli/tests/{ => testdata}/tla2/b.js | 0 cli/tests/{ => testdata}/tla3/b.js | 0 cli/tests/{ => testdata}/tla3/timeout_loop.js | 0 cli/tests/{ => testdata}/tls.out | 0 cli/tests/{ => testdata}/tls/README.md | 0 cli/tests/{ => testdata}/tls/RootCA.crt | 0 cli/tests/{ => testdata}/tls/RootCA.key | 0 cli/tests/{ => testdata}/tls/RootCA.pem | 0 cli/tests/{ => testdata}/tls/domains.txt | 0 cli/tests/{ => testdata}/tls/localhost.crt | 0 cli/tests/{ => testdata}/tls/localhost.key | 0 cli/tests/{ => testdata}/tls_connecttls.js | 11 +- cli/tests/{ => testdata}/tls_starttls.js | 11 +- cli/tests/{ => testdata}/top_level_await.js | 0 cli/tests/{ => testdata}/top_level_await.out | 0 cli/tests/{ => testdata}/top_level_await.ts | 0 .../top_level_await_circular.js | 0 .../top_level_await_circular.out | 2 +- .../{ => testdata}/top_level_await_loop.js | 0 .../{ => testdata}/top_level_await_loop.out | 0 .../{ => testdata}/top_level_await_nested.out | 0 .../top_level_await_nested/a.js | 0 .../top_level_await_nested/b.js | 0 .../top_level_await_nested/main.js | 0 .../{ => testdata}/top_level_await_order.js | 0 .../{ => testdata}/top_level_await_order.out | 0 .../top_level_await_unresolved.js | 0 .../top_level_await_unresolved.out | 0 .../{ => testdata}/top_level_for_await.js | 0 .../{ => testdata}/top_level_for_await.out | 0 .../{ => testdata}/top_level_for_await.ts | 0 cli/tests/{ => testdata}/ts_decorators.ts | 0 cli/tests/{ => testdata}/ts_decorators.ts.out | 0 .../{ => testdata}/ts_decorators_bundle.out | 0 .../{ => testdata}/ts_decorators_bundle.ts | 0 cli/tests/testdata/ts_import_from_js.deps.js | 2 + cli/tests/{ => testdata}/ts_import_from_js.js | 0 .../{ => testdata}/ts_import_from_js.js.out | 0 cli/tests/{ => testdata}/ts_type_imports.ts | 0 .../{ => testdata}/ts_type_imports.ts.out | 0 .../{ => testdata}/ts_type_imports_foo.ts | 0 .../{ => testdata}/ts_type_only_import.d.ts | 0 .../{ => testdata}/ts_type_only_import.ts | 0 .../{ => testdata}/ts_type_only_import.ts.out | 0 cli/tests/{ => testdata}/ts_with_generic.ts | 0 cli/tests/{ => testdata}/tsc/a.js | 0 cli/tests/{ => testdata}/tsc/d.ts | 0 .../{ => testdata}/tsc/node_modules/b.js | 0 .../{ => testdata}/tsc/node_modules/c.js | 0 cli/tests/{ => testdata}/tsc/test.js | 0 cli/tests/{ => testdata}/tsc2/file_exportc.ts | 0 cli/tests/{ => testdata}/tsc2/file_libref.ts | 0 cli/tests/{ => testdata}/tsc2/file_main.ts | 0 .../{ => testdata}/tsc2/file_reexports.ts | 0 .../tsc2/https_deno.land-x-a.ts | 0 .../tsc2/https_deno.land-x-b.ts | 0 .../tsc2/https_deno.land-x-c.d.ts | 0 .../tsc2/https_deno.land-x-c.js | 0 .../tsc2/https_deno.land-x-mod.ts | 0 .../{ => testdata}/tsconfig.decorators.json | 0 cli/tests/{ => testdata}/tsx_imports.ts | 0 cli/tests/{ => testdata}/tsx_imports.ts.out | 0 cli/tests/{ => testdata}/type_definitions.ts | 0 .../{ => testdata}/type_definitions.ts.out | 0 .../{ => testdata}/type_definitions/bar.d.ts | 0 .../{ => testdata}/type_definitions/bar.js | 0 .../{ => testdata}/type_definitions/fizz.d.ts | 0 .../{ => testdata}/type_definitions/fizz.js | 0 .../{ => testdata}/type_definitions/foo.d.ts | 0 .../{ => testdata}/type_definitions/foo.js | 0 .../{ => testdata}/type_definitions/qat.ts | 0 .../type_definitions_for_export.ts | 0 .../type_definitions_for_export.ts.out | 0 .../{ => testdata}/type_directives_01.ts | 0 .../{ => testdata}/type_directives_01.ts.out | 0 .../{ => testdata}/type_directives_02.ts | 0 cli/tests/testdata/type_directives_02.ts.out | 3 + .../{ => testdata}/type_directives_js_main.js | 0 .../type_directives_js_main.js.out | 2 +- .../type_directives_redirect.ts | 0 .../type_directives_redirect.ts.out | 0 .../{ => testdata}/type_headers_deno_types.ts | 0 .../type_headers_deno_types.ts.out | 0 cli/tests/{ => testdata}/types.out | 0 cli/tests/{ => testdata}/unbuffered_stderr.ts | 0 .../{ => testdata}/unbuffered_stderr.ts.out | 0 cli/tests/{ => testdata}/unbuffered_stdout.ts | 0 .../{ => testdata}/unbuffered_stdout.ts.out | 0 cli/tests/{ => testdata}/unstable.js | 0 cli/tests/{ => testdata}/unstable.ts | 0 .../{ => testdata}/unstable_disabled.out | 2 +- .../{ => testdata}/unstable_disabled_js.out | 0 cli/tests/{ => testdata}/unstable_enabled.out | 0 .../{ => testdata}/unstable_enabled_js.out | 0 cli/tests/{ => testdata}/unstable_worker.ts | 0 .../{ => testdata}/unstable_worker.ts.out | 0 .../unsupported_dynamic_import_scheme.out | 0 cli/tests/{ => testdata}/v8_flags.js | 0 cli/tests/{ => testdata}/v8_flags.js.out | 0 .../{ => testdata}/v8_flags_unrecognized.out | 0 cli/tests/{ => testdata}/v8_help.out | 0 cli/tests/{ => testdata}/wasm.ts | 0 cli/tests/{ => testdata}/wasm.ts.out | 0 cli/tests/{ => testdata}/wasm_async.js | 0 cli/tests/{ => testdata}/wasm_async.out | 0 cli/tests/{ => testdata}/wasm_shared.out | 0 cli/tests/{ => testdata}/wasm_shared.ts | 0 cli/tests/{ => testdata}/wasm_unreachable.js | 0 cli/tests/{ => testdata}/wasm_unreachable.out | 2 +- cli/tests/{ => testdata}/weakref.ts | 0 cli/tests/{ => testdata}/weakref.ts.out | 0 .../webgpu_computepass_shader.wgsl | 0 .../{ => testdata}/webgpu_hellotriangle.out | Bin .../webgpu_hellotriangle_shader.wgsl | 0 cli/tests/{ => testdata}/websocket_test.ts | 4 +- .../{ => testdata}/websocketstream_test.ts | 2 +- cli/tests/{ => testdata}/worker_close_race.js | 0 .../{ => testdata}/worker_close_race.js.out | 0 .../worker_event_handler_test.js | 0 .../worker_event_handler_test.js.out | 0 .../workers/bench_large_message.ts | 0 .../workers/bench_round_robin.ts | 5 +- .../{ => testdata}/workers/bench_startup.ts | 0 .../{ => testdata}/workers/bench_worker.ts | 0 .../workers/broadcast_channel.ts | 0 .../{ => testdata}/workers/busy_worker.js | 0 .../workers/close_race_worker.js | 0 .../{ => testdata}/workers/deno_worker.ts | 0 .../{ => testdata}/workers/dynamic_remote.ts | 0 cli/tests/{ => testdata}/workers/error.ts | 0 .../{ => testdata}/workers/event_worker.js | 0 .../workers/event_worker_scope.js | 0 .../{ => testdata}/workers/fetching_worker.js | 2 +- .../{ => testdata}/workers/http_worker.js | 0 .../workers/immediately_close_worker.js | 0 .../{ => testdata}/workers/message_port.ts | 0 .../{ => testdata}/workers/nested_worker.js | 0 .../workers/no_permissions_worker.js | 0 .../{ => testdata}/workers/non_deno_worker.js | 0 .../workers/nonexistent_worker.out | 2 +- .../workers/nonexistent_worker.ts | 0 .../parent_read_check_granular_worker.js | 0 .../workers/parent_read_check_worker.js | 0 .../workers/permissions_blob_local.ts | 0 .../workers/permissions_blob_local.ts.out | 0 .../workers/permissions_blob_remote.ts | 0 .../workers/permissions_blob_remote.ts.out | 0 .../workers/permissions_data_local.ts | 0 .../workers/permissions_data_local.ts.out | 0 .../workers/permissions_data_remote.ts | 0 .../workers/permissions_data_remote.ts.out | 0 .../workers/permissions_dynamic_remote.ts | 2 +- .../workers/permissions_dynamic_remote.ts.out | 2 +- .../workers/permissions_remote_remote.ts | 3 + .../workers/permissions_remote_remote.ts.out | 2 +- .../{ => testdata}/workers/post_undefined.ts | 0 .../{ => testdata}/workers/racy_worker.js | 0 .../workers/read_check_granular_worker.js | 0 .../workers/read_check_worker.js | 0 .../workers/shared_array_buffer.ts | 0 .../{ => testdata}/workers/sibling_worker.js | 0 .../{ => testdata}/workers/static_remote.ts | 0 cli/tests/{ => testdata}/workers/test.ts | 10 +- cli/tests/{ => testdata}/workers/test.ts.out | 0 .../{ => testdata}/workers/test_worker.js | 0 .../{ => testdata}/workers/test_worker.ts | 0 .../{ => testdata}/workers/throwing_worker.js | 0 .../{ => testdata}/workers/worker_crypto.js | 0 .../{ => testdata}/workers/worker_error.ts | 0 .../workers/worker_error.ts.out | 0 .../workers/worker_event_handlers.js | 0 .../{ => testdata}/workers/worker_globals.ts | 0 .../workers/worker_large_message.js | 0 .../{ => testdata}/workers/worker_location.ts | 0 .../workers/worker_nested_error.ts | 0 .../workers/worker_nested_error.ts.out | 0 .../workers/worker_structured_cloning.ts | 0 .../{ => testdata}/workers/worker_types.ts | 0 .../{ => testdata}/workers/worker_unstable.ts | 0 .../workers/worker_with_top_level_await.ts | 0 cli/tests/{ => testdata}/x_deno_warning.js | 0 cli/tests/ts_import_from_js.deps.js | 2 - cli/tests/type_directives_02.ts.out | 3 - cli/tests/unit/README.md | 2 +- cli/tests/unit/body_test.ts | 2 +- cli/tests/unit/broadcast_channel_test.ts | 5 +- cli/tests/unit/fetch_test.ts | 48 +++---- cli/tests/unit/files_test.ts | 26 ++-- cli/tests/unit/http_test.ts | 6 +- cli/tests/unit/read_dir_test.ts | 12 +- cli/tests/unit/read_file_test.ts | 22 ++-- cli/tests/unit/read_text_file_test.ts | 14 +- cli/tests/unit/real_path_test.ts | 8 +- cli/tests/unit/resources_test.ts | 2 +- cli/tests/unit/stat_test.ts | 54 ++++---- cli/tests/unit/tls_test.ts | 72 ++++++----- cli/tests/unit/tty_test.ts | 4 +- cli/tests/unit/wasm_test.ts | 2 +- cli/tests/unit/webgpu_test.ts | 9 +- .../workers/permissions_remote_remote.ts | 3 - cli/tools/installer.rs | 91 +++++++------ cli/tools/test_runner.rs | 7 +- cli/tsc.rs | 8 +- cli/tsc/99_main_compiler.js | 4 +- runtime/worker.rs | 10 +- test_util/src/lib.rs | 85 ++++++------- tools/lint.js | 14 +- 1089 files changed, 1150 insertions(+), 1160 deletions(-) delete mode 100644 cli/tests/006_url_imports.ts delete mode 100644 cli/tests/019_media_types.ts delete mode 100644 cli/tests/022_info_flag_script.out delete mode 100644 cli/tests/035_cached_only_flag.out delete mode 100644 cli/tests/037_fetch_multiple.out delete mode 100644 cli/tests/045_proxy_test.ts.out delete mode 100644 cli/tests/048_media_types_jsx.ts delete mode 100644 cli/tests/049_info_flag_script_jsx.out delete mode 100644 cli/tests/053_import_compression/main.ts delete mode 100644 cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts.out delete mode 100644 cli/tests/README.md delete mode 100644 cli/tests/bundle_dynamic_import.ts delete mode 100644 cli/tests/cache_extensionless.out delete mode 100644 cli/tests/cache_random_extension.out delete mode 100644 cli/tests/cafile_info.ts delete mode 100644 cli/tests/cafile_info.ts.out delete mode 100644 cli/tests/cafile_url_imports.ts delete mode 100644 cli/tests/config_types_remote.tsconfig.json delete mode 100644 cli/tests/disallow_http_from_https_js.out delete mode 100644 cli/tests/disallow_http_from_https_ts.out delete mode 100644 cli/tests/dynamic_import/permissions_remote_remote.ts delete mode 100644 cli/tests/dynamic_import/permissions_remote_remote.ts.out delete mode 100644 cli/tests/error_001.ts.out delete mode 100644 cli/tests/error_002.ts.out delete mode 100644 cli/tests/error_004_missing_module.ts.out delete mode 100644 cli/tests/error_015_dynamic_import_permissions.js delete mode 100644 cli/tests/error_019_stack_function.ts.out delete mode 100644 cli/tests/error_020_stack_constructor.ts.out delete mode 100644 cli/tests/error_021_stack_method.ts.out delete mode 100644 cli/tests/error_022_stack_custom_error.ts.out delete mode 100644 cli/tests/error_023_stack_async.ts.out delete mode 100644 cli/tests/error_024_stack_promise_all.ts.out delete mode 100644 cli/tests/error_025_tab_indent.out delete mode 100644 cli/tests/error_026_remote_import_error.ts delete mode 100644 cli/tests/error_026_remote_import_error.ts.out delete mode 100644 cli/tests/error_missing_module_named_import.ts.out delete mode 100644 cli/tests/error_syntax.js.out delete mode 100644 cli/tests/error_syntax_empty_trailing_line.mjs.out delete mode 100644 cli/tests/error_worker_permissions_remote.ts delete mode 100644 cli/tests/fetch/other.ts delete mode 100644 cli/tests/fetch/test.ts delete mode 100644 cli/tests/https_import.ts delete mode 100644 cli/tests/import_file_with_colon.ts delete mode 100644 cli/tests/info_missing_module.out delete mode 100644 cli/tests/info_recursive_imports_test.out delete mode 100644 cli/tests/inline_js_source_map_2.js delete mode 100644 cli/tests/inline_js_source_map_2.js.out delete mode 100644 cli/tests/inline_js_source_map_2_with_inline_contents.js delete mode 100644 cli/tests/inline_js_source_map_with_contents_from_graph.js delete mode 100644 cli/tests/localhost_unsafe_ssl.ts.out delete mode 100644 cli/tests/lock_check_err.json delete mode 100644 cli/tests/lock_check_err2.json delete mode 100644 cli/tests/lock_check_err_with_bundle.json delete mode 100644 cli/tests/lock_check_ok.json delete mode 100644 cli/tests/lock_check_ok2.json delete mode 100644 cli/tests/lock_dynamic_imports.json delete mode 100644 cli/tests/lsp/did_open_params_import_hover.json delete mode 100644 cli/tests/lsp/did_open_params_large.json delete mode 100644 cli/tests/main_module.ts.out delete mode 100644 cli/tests/redirect_cache.out delete mode 100644 cli/tests/reference_types_remote.ts rename cli/tests/{ => testdata}/001_hello.js (100%) rename cli/tests/{ => testdata}/001_hello.js.out (100%) rename cli/tests/{ => testdata}/002_hello.ts (100%) rename cli/tests/{ => testdata}/002_hello.ts.out (100%) rename cli/tests/{ => testdata}/003_relative_import.ts (100%) rename cli/tests/{ => testdata}/003_relative_import.ts.out (100%) rename cli/tests/{ => testdata}/004_set_timeout.ts (100%) rename cli/tests/{ => testdata}/004_set_timeout.ts.out (100%) rename cli/tests/{ => testdata}/005_more_imports.ts (100%) rename cli/tests/{ => testdata}/005_more_imports.ts.out (100%) create mode 100644 cli/tests/testdata/006_url_imports.ts rename cli/tests/{ => testdata}/006_url_imports.ts.out (100%) rename cli/tests/{ => testdata}/012_async.ts (100%) rename cli/tests/{ => testdata}/012_async.ts.out (100%) rename cli/tests/{ => testdata}/013_dynamic_import.ts (100%) rename cli/tests/{ => testdata}/013_dynamic_import.ts.out (100%) rename cli/tests/{ => testdata}/014_duplicate_import.ts (100%) rename cli/tests/{ => testdata}/014_duplicate_import.ts.out (100%) rename cli/tests/{ => testdata}/015_duplicate_parallel_import.js (100%) rename cli/tests/{ => testdata}/015_duplicate_parallel_import.js.out (100%) rename cli/tests/{ => testdata}/016_double_await.ts (100%) rename cli/tests/{ => testdata}/016_double_await.ts.out (100%) rename cli/tests/{ => testdata}/017_import_redirect.ts (100%) rename cli/tests/{ => testdata}/017_import_redirect.ts.out (100%) rename cli/tests/{ => testdata}/017_import_redirect_info.out (79%) rename cli/tests/{ => testdata}/018_async_catch.ts (100%) rename cli/tests/{ => testdata}/018_async_catch.ts.out (100%) create mode 100644 cli/tests/testdata/019_media_types.ts rename cli/tests/{ => testdata}/019_media_types.ts.out (100%) rename cli/tests/{ => testdata}/020_json_modules.ts (100%) rename cli/tests/{ => testdata}/020_json_modules.ts.out (68%) rename cli/tests/{ => testdata}/021_mjs_modules.ts (100%) rename cli/tests/{ => testdata}/021_mjs_modules.ts.out (100%) create mode 100644 cli/tests/testdata/022_info_flag_script.out rename cli/tests/{ => testdata}/023_no_ext (100%) rename cli/tests/{ => testdata}/023_no_ext.out (100%) rename cli/tests/{ => testdata}/024_import_no_ext_with_headers.ts (100%) rename cli/tests/{ => testdata}/024_import_no_ext_with_headers.ts.out (100%) rename cli/tests/{ => testdata}/025_hrtime.ts (100%) rename cli/tests/{ => testdata}/025_hrtime.ts.out (100%) rename cli/tests/{ => testdata}/025_reload_js_type_error.js (100%) rename cli/tests/{ => testdata}/025_reload_js_type_error.js.out (100%) rename cli/tests/{ => testdata}/026_redirect_javascript.js (100%) rename cli/tests/{ => testdata}/026_redirect_javascript.js.out (100%) rename cli/tests/{ => testdata}/027_redirect_typescript.ts (100%) rename cli/tests/{ => testdata}/027_redirect_typescript.ts.out (100%) rename cli/tests/{ => testdata}/028_args.ts (100%) rename cli/tests/{ => testdata}/028_args.ts.out (100%) rename cli/tests/{ => testdata}/029_eval.out (100%) rename cli/tests/{ => testdata}/030_eval_ts.out (100%) rename cli/tests/{ => testdata}/031_info_ts_error.out (100%) rename cli/tests/{ => testdata}/031_info_ts_error.ts (100%) rename cli/tests/{ => testdata}/033_import_map.out (100%) rename cli/tests/{ => testdata}/033_import_map_remote.out (100%) rename cli/tests/{ => testdata}/034_onload.out (100%) rename cli/tests/{ => testdata}/034_onload/imported.ts (80%) rename cli/tests/{ => testdata}/034_onload/main.ts (89%) rename cli/tests/{ => testdata}/034_onload/nest_imported.ts (78%) create mode 100644 cli/tests/testdata/035_cached_only_flag.out rename cli/tests/{ => testdata}/036_import_map_fetch.out (100%) create mode 100644 cli/tests/testdata/037_fetch_multiple.out rename cli/tests/{ => testdata}/038_checkjs.js (100%) rename cli/tests/{ => testdata}/038_checkjs.js.out (76%) rename cli/tests/{ => testdata}/038_checkjs.tsconfig.json (100%) rename cli/tests/{ => testdata}/041_dyn_import_eval.out (100%) rename cli/tests/{ => testdata}/041_info_flag.out (100%) rename cli/tests/{ => testdata}/041_info_flag_location.out (100%) rename cli/tests/{ => testdata}/042_dyn_import_evalcontext.ts (100%) rename cli/tests/{ => testdata}/042_dyn_import_evalcontext.ts.out (100%) rename cli/tests/{ => testdata}/044_bad_resource.ts (100%) rename cli/tests/{ => testdata}/044_bad_resource.ts.out (100%) create mode 100644 cli/tests/testdata/045_mod.ts create mode 100644 cli/tests/testdata/045_output.ts rename cli/tests/{ => testdata}/045_programmatic_proxy_client.ts (85%) rename cli/tests/{ => testdata}/045_proxy_client.ts (71%) rename cli/tests/{ => testdata}/045_proxy_test.ts (91%) create mode 100644 cli/tests/testdata/045_proxy_test.ts.out rename cli/tests/{ => testdata}/046_jsx_test.tsx (100%) rename cli/tests/{ => testdata}/046_jsx_test.tsx.out (100%) rename cli/tests/{ => testdata}/047_jsx_test.jsx (100%) rename cli/tests/{ => testdata}/047_jsx_test.jsx.out (100%) create mode 100644 cli/tests/testdata/048_media_types_jsx.ts rename cli/tests/{ => testdata}/048_media_types_jsx.ts.out (100%) create mode 100644 cli/tests/testdata/049_info_flag_script_jsx.out rename cli/tests/{ => testdata}/052_no_remote_flag.out (51%) rename cli/tests/{ => testdata}/053_import_compression.out (100%) rename cli/tests/{ => testdata}/053_import_compression/brotli (100%) rename cli/tests/{ => testdata}/053_import_compression/gziped (100%) create mode 100644 cli/tests/testdata/053_import_compression/main.ts rename cli/tests/{ => testdata}/054_info_local_imports.out (100%) rename cli/tests/{ => testdata}/055_info_file_json.out (60%) rename cli/tests/{ => testdata}/056_make_temp_file_write_perm.out (100%) rename cli/tests/{ => testdata}/056_make_temp_file_write_perm.ts (100%) rename cli/tests/{ => testdata}/058_tasks_microtasks_close.ts (100%) rename cli/tests/{ => testdata}/058_tasks_microtasks_close.ts.out (100%) rename cli/tests/{ => testdata}/059_fs_relative_path_perm.ts (100%) rename cli/tests/{ => testdata}/059_fs_relative_path_perm.ts.out (100%) rename cli/tests/{ => testdata}/060_deno_doc_displays_all_overloads_in_details_view.ts (100%) create mode 100644 cli/tests/testdata/060_deno_doc_displays_all_overloads_in_details_view.ts.out rename cli/tests/{ => testdata}/061_permissions_request.ts (100%) rename cli/tests/{ => testdata}/061_permissions_request.ts.out (100%) rename cli/tests/{ => testdata}/062_permissions_request_global.ts (100%) rename cli/tests/{ => testdata}/062_permissions_request_global.ts.out (100%) rename cli/tests/{ => testdata}/063_permissions_revoke.ts (100%) rename cli/tests/{ => testdata}/063_permissions_revoke.ts.out (100%) rename cli/tests/{ => testdata}/064_permissions_revoke_global.ts (100%) rename cli/tests/{ => testdata}/064_permissions_revoke_global.ts.out (100%) rename cli/tests/{ => testdata}/065_import_map_info.out (100%) rename cli/tests/{ => testdata}/066_prompt.ts (100%) rename cli/tests/{ => testdata}/066_prompt.ts.out (100%) rename cli/tests/{ => testdata}/070_location.ts (100%) rename cli/tests/{ => testdata}/070_location.ts.out (100%) rename cli/tests/{ => testdata}/071_location_unset.ts (100%) rename cli/tests/{ => testdata}/071_location_unset.ts.out (100%) rename cli/tests/{ => testdata}/072_location_relative_fetch.ts (100%) rename cli/tests/{ => testdata}/072_location_relative_fetch.ts.out (100%) rename cli/tests/{ => testdata}/075_import_local_query_hash.ts (100%) rename cli/tests/{ => testdata}/075_import_local_query_hash.ts.out (100%) rename cli/tests/{ => testdata}/076_info_json_deps_order.out (61%) rename cli/tests/{ => testdata}/076_info_json_deps_order.ts (100%) rename cli/tests/{ => testdata}/077_fetch_empty.ts (100%) rename cli/tests/{ => testdata}/077_fetch_empty.ts.out (100%) rename cli/tests/{ => testdata}/078_unload_on_exit.ts (100%) rename cli/tests/{ => testdata}/078_unload_on_exit.ts.out (100%) rename cli/tests/{ => testdata}/079_location_authentication.ts (100%) rename cli/tests/{ => testdata}/079_location_authentication.ts.out (100%) rename cli/tests/{ => testdata}/080_deno_emit_permissions.ts (100%) rename cli/tests/{ => testdata}/080_deno_emit_permissions.ts.out (100%) rename cli/tests/{ => testdata}/081_location_relative_fetch_redirect.ts (100%) rename cli/tests/{ => testdata}/081_location_relative_fetch_redirect.ts.out (100%) rename cli/tests/{ => testdata}/082_prepare_stack_trace_throw.js (100%) rename cli/tests/{ => testdata}/082_prepare_stack_trace_throw.js.out (100%) rename cli/tests/{ => testdata}/083_legacy_external_source_map.ts (100%) rename cli/tests/{ => testdata}/084_worker_custom_inspect.ts (100%) rename cli/tests/{ => testdata}/084_worker_custom_inspect.ts.out (100%) rename cli/tests/{ => testdata}/084_worker_custom_inspect_worker.ts (100%) rename cli/tests/{ => testdata}/085_dynamic_import_async_error.ts (100%) rename cli/tests/{ => testdata}/085_dynamic_import_async_error.ts.out (100%) rename cli/tests/{ => testdata}/086_dynamic_import_already_rejected.ts (100%) rename cli/tests/{ => testdata}/086_dynamic_import_already_rejected.ts.out (100%) rename cli/tests/{ => testdata}/087_hello.ts (100%) rename cli/tests/{ => testdata}/087_no_check_imports_not_used_as_values.ts (100%) rename cli/tests/{ => testdata}/087_no_check_imports_not_used_as_values.ts.out (100%) rename cli/tests/{ => testdata}/088_dynamic_import_already_evaluating.ts (100%) rename cli/tests/{ => testdata}/088_dynamic_import_already_evaluating.ts.out (100%) rename cli/tests/{ => testdata}/088_dynamic_import_target.ts (100%) rename cli/tests/{ => testdata}/089_run_allow_list.ts (100%) rename cli/tests/{ => testdata}/089_run_allow_list.ts.out (100%) rename cli/tests/{ => testdata}/090_run_permissions_request.ts (100%) rename cli/tests/{ => testdata}/090_run_permissions_request.ts.out (100%) rename cli/tests/{ => testdata}/091_use_define_for_class_fields.ts (100%) rename cli/tests/{ => testdata}/091_use_define_for_class_fields.ts.out (100%) rename cli/tests/{ => testdata}/092_import_map_unmapped_bare_specifier.ts (100%) rename cli/tests/{ => testdata}/092_import_map_unmapped_bare_specifier.ts.out (100%) rename cli/tests/{ => testdata}/095_cache_with_bare_import.ts (100%) rename cli/tests/{ => testdata}/095_cache_with_bare_import.ts.out (100%) rename cli/tests/{ => testdata}/Component.tsx (100%) rename cli/tests/{ => testdata}/DenoWinRunner.cs (100%) rename cli/tests/{ => testdata}/DenoWinRunner.ps1 (100%) rename cli/tests/{ => testdata}/async_error.ts (100%) rename cli/tests/{ => testdata}/async_error.ts.out (55%) rename cli/tests/{ => testdata}/badly_formatted.json (100%) rename cli/tests/{ => testdata}/badly_formatted.md (100%) rename cli/tests/{ => testdata}/badly_formatted.mjs (100%) rename cli/tests/{ => testdata}/badly_formatted_fixed.js (100%) rename cli/tests/{ => testdata}/badly_formatted_fixed.json (100%) rename cli/tests/{ => testdata}/badly_formatted_fixed.md (100%) rename cli/tests/{ => testdata}/blob_gc_finalization.js (100%) rename cli/tests/{ => testdata}/blob_gc_finalization.js.out (100%) rename cli/tests/{ => testdata}/bundle.test.out (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture01.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture02.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture03.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture04.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture05.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture06.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture07.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture08.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture09.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture10.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture11.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture12.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture13.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture14.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-fixture15.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-a.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-b.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-c.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-d.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-e.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-f.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-g.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-h.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-i.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-j.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-k.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-l.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-m.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-n.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-o.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-p.ts (100%) rename cli/tests/{ => testdata}/bundle/file_tests-subdir-q.ts (100%) rename cli/tests/{ => testdata}/bundle/fixture01.out (100%) rename cli/tests/{ => testdata}/bundle/fixture02.out (100%) rename cli/tests/{ => testdata}/bundle/fixture03.out (100%) rename cli/tests/{ => testdata}/bundle/fixture04.out (100%) rename cli/tests/{ => testdata}/bundle/fixture05.out (100%) rename cli/tests/{ => testdata}/bundle/fixture06.out (100%) rename cli/tests/{ => testdata}/bundle/fixture07.out (100%) rename cli/tests/{ => testdata}/bundle/fixture08.out (100%) rename cli/tests/{ => testdata}/bundle/fixture09.out (100%) rename cli/tests/{ => testdata}/bundle/fixture10.out (100%) rename cli/tests/{ => testdata}/bundle/fixture11.out (100%) rename cli/tests/{ => testdata}/bundle/fixture12.out (100%) rename cli/tests/{ => testdata}/bundle/fixture13.out (100%) rename cli/tests/{ => testdata}/bundle/fixture14.out (100%) rename cli/tests/{ => testdata}/bundle/fixture15.out (100%) rename cli/tests/{ => testdata}/bundle/https_deno.land-x-lib-a.ts (100%) rename cli/tests/{ => testdata}/bundle/https_deno.land-x-lib-b.js (100%) rename cli/tests/{ => testdata}/bundle/https_deno.land-x-lib-c.d.ts (100%) rename cli/tests/{ => testdata}/bundle/https_deno.land-x-lib-c.js (100%) rename cli/tests/{ => testdata}/bundle/https_deno.land-x-lib-mod.d.ts (100%) rename cli/tests/{ => testdata}/bundle/https_deno.land-x-lib-mod.js (100%) create mode 100644 cli/tests/testdata/bundle_dynamic_import.ts rename cli/tests/{ => testdata}/bundle_im.json (100%) rename cli/tests/{ => testdata}/bundle_im.ts (100%) rename cli/tests/{ => testdata}/bundle_jsx.out (100%) create mode 100644 cli/tests/testdata/cache_extensionless.out create mode 100644 cli/tests/testdata/cache_random_extension.out create mode 100644 cli/tests/testdata/cafile_info.ts create mode 100644 cli/tests/testdata/cafile_info.ts.out rename cli/tests/{ => testdata}/cafile_ts_fetch.ts (50%) rename cli/tests/{ => testdata}/cafile_ts_fetch.ts.out (100%) rename cli/tests/{ => testdata}/cafile_ts_fetch_unsafe_ssl.ts.out (100%) create mode 100644 cli/tests/testdata/cafile_url_imports.ts rename cli/tests/{ => testdata}/cafile_url_imports.ts.out (100%) rename cli/tests/{ => testdata}/cafile_url_imports_unsafe_ssl.ts.out (100%) rename cli/tests/{ => testdata}/cat.ts (77%) rename cli/tests/{ => testdata}/circular1.js (100%) rename cli/tests/{ => testdata}/circular1.js.out (100%) rename cli/tests/{ => testdata}/circular2.js (100%) rename cli/tests/{ => testdata}/cjs_imports.ts (100%) rename cli/tests/{ => testdata}/cjs_imports.ts.out (100%) rename cli/tests/{ => testdata}/commonjs.cjs (100%) rename cli/tests/{ => testdata}/compiler_api_test.ts (98%) rename cli/tests/{ => testdata}/complex_permissions_test.ts (100%) rename cli/tests/{ => testdata}/config.ts (100%) rename cli/tests/{ => testdata}/config.ts.out (86%) rename cli/tests/{ => testdata}/config.tsconfig.json (100%) rename cli/tests/{ => testdata}/config_types.ts (100%) rename cli/tests/{ => testdata}/config_types.ts.out (100%) rename cli/tests/{ => testdata}/config_types.tsconfig.json (100%) create mode 100644 cli/tests/testdata/config_types_remote.tsconfig.json rename cli/tests/{ => testdata}/coverage/branch.ts (100%) rename cli/tests/{ => testdata}/coverage/branch_test.ts (100%) rename cli/tests/{ => testdata}/coverage/complex.ts (100%) rename cli/tests/{ => testdata}/coverage/complex_test.ts (100%) rename cli/tests/{ => testdata}/coverage/expected_branch.lcov (100%) rename cli/tests/{ => testdata}/coverage/expected_branch.out (100%) rename cli/tests/{ => testdata}/coverage/expected_complex.lcov (100%) rename cli/tests/{ => testdata}/coverage/expected_complex.out (100%) rename cli/tests/{ => testdata}/delayed_error.ts (100%) rename cli/tests/{ => testdata}/deno_doc.out (100%) rename cli/tests/{ => testdata}/deno_doc.ts (100%) rename cli/tests/{ => testdata}/deno_doc_builtin.out (100%) rename cli/tests/{ => testdata}/deno_dom_0.1.3-alpha2.wasm (100%) rename cli/tests/{ => testdata}/deno_land_unsafe_ssl.ts (100%) rename cli/tests/{ => testdata}/deno_land_unsafe_ssl.ts.out (100%) rename cli/tests/{ => testdata}/disallow_http_from_https.js (57%) rename cli/tests/{ => testdata}/disallow_http_from_https.ts (57%) create mode 100644 cli/tests/testdata/disallow_http_from_https_js.out create mode 100644 cli/tests/testdata/disallow_http_from_https_ts.out rename cli/tests/{ => testdata}/doc/import_map.json (100%) rename cli/tests/{ => testdata}/doc/invalid_url.out (100%) rename cli/tests/{ => testdata}/doc/module/fun.js (100%) rename cli/tests/{ => testdata}/doc/types_header.out (100%) rename cli/tests/{ => testdata}/doc/types_header.ts (100%) rename cli/tests/{ => testdata}/doc/types_hint.out (100%) rename cli/tests/{ => testdata}/doc/types_hint.ts (100%) rename cli/tests/{ => testdata}/doc/types_ref.js (100%) rename cli/tests/{ => testdata}/doc/types_ref.out (100%) rename cli/tests/{ => testdata}/doc/use_import_map.js (100%) rename cli/tests/{ => testdata}/doc/use_import_map.out (100%) rename cli/tests/{ => testdata}/dynamic_import/b.js (100%) rename cli/tests/{ => testdata}/dynamic_import/c.js (100%) rename cli/tests/{ => testdata}/dynamic_import/permissions_blob_local.ts (100%) rename cli/tests/{ => testdata}/dynamic_import/permissions_blob_local.ts.out (70%) rename cli/tests/{ => testdata}/dynamic_import/permissions_blob_remote.ts (100%) rename cli/tests/{ => testdata}/dynamic_import/permissions_blob_remote.ts.out (68%) rename cli/tests/{ => testdata}/dynamic_import/permissions_data_local.ts (100%) rename cli/tests/{ => testdata}/dynamic_import/permissions_data_local.ts.out (74%) rename cli/tests/{ => testdata}/dynamic_import/permissions_data_remote.ts (100%) rename cli/tests/{ => testdata}/dynamic_import/permissions_data_remote.ts.out (76%) create mode 100644 cli/tests/testdata/dynamic_import/permissions_remote_remote.ts create mode 100644 cli/tests/testdata/dynamic_import/permissions_remote_remote.ts.out rename cli/tests/{ => testdata}/dynamic_import/static_remote.ts (100%) rename cli/tests/{ => testdata}/dynamic_import_conditional.js (100%) rename cli/tests/{ => testdata}/dynamic_import_conditional.js.out (100%) rename cli/tests/{ => testdata}/echo.ts (100%) rename cli/tests/{ => testdata}/echo_server.ts (85%) rename cli/tests/{ => testdata}/encoding/utf-16be.ts (100%) rename cli/tests/{ => testdata}/encoding/utf-16le.ts (100%) rename cli/tests/{ => testdata}/encoding/utf-8.ts (100%) rename cli/tests/{ => testdata}/encoding/windows-1255 (100%) rename cli/tests/{ => testdata}/error_001.ts (100%) create mode 100644 cli/tests/testdata/error_001.ts.out rename cli/tests/{ => testdata}/error_002.ts (100%) create mode 100644 cli/tests/testdata/error_002.ts.out rename cli/tests/{ => testdata}/error_003_typescript.ts (100%) rename cli/tests/{ => testdata}/error_003_typescript.ts.out (84%) rename cli/tests/{ => testdata}/error_004_missing_module.ts (100%) create mode 100644 cli/tests/testdata/error_004_missing_module.ts.out rename cli/tests/{ => testdata}/error_005_missing_dynamic_import.ts (100%) rename cli/tests/{ => testdata}/error_005_missing_dynamic_import.ts.out (85%) rename cli/tests/{ => testdata}/error_006_import_ext_failure.ts (100%) rename cli/tests/{ => testdata}/error_006_import_ext_failure.ts.out (62%) rename cli/tests/{ => testdata}/error_007_any.ts (100%) rename cli/tests/{ => testdata}/error_007_any.ts.out (100%) rename cli/tests/{ => testdata}/error_008_checkjs.js (100%) rename cli/tests/{ => testdata}/error_008_checkjs.js.out (66%) rename cli/tests/{ => testdata}/error_009_extensions_error.js (100%) rename cli/tests/{ => testdata}/error_009_extensions_error.js.out (100%) rename cli/tests/{ => testdata}/error_009_missing_js_module.disabled (100%) rename cli/tests/{ => testdata}/error_009_missing_js_module.js (100%) rename cli/tests/{ => testdata}/error_009_missing_js_module.js.out (100%) rename cli/tests/{ => testdata}/error_010_nonexistent_arg.disabled (100%) rename cli/tests/{ => testdata}/error_010_nonexistent_arg.out (100%) rename cli/tests/{ => testdata}/error_011_bad_module_specifier.ts (100%) rename cli/tests/{ => testdata}/error_011_bad_module_specifier.ts.out (100%) rename cli/tests/{ => testdata}/error_012_bad_dynamic_import_specifier.ts (100%) rename cli/tests/{ => testdata}/error_012_bad_dynamic_import_specifier.ts.out (100%) rename cli/tests/{ => testdata}/error_013_missing_script.out (100%) rename cli/tests/{ => testdata}/error_014_catch_dynamic_import_error.js (100%) rename cli/tests/{ => testdata}/error_014_catch_dynamic_import_error.js.out (86%) create mode 100644 cli/tests/testdata/error_015_dynamic_import_permissions.js rename cli/tests/{ => testdata}/error_015_dynamic_import_permissions.out (74%) rename cli/tests/{ => testdata}/error_016_dynamic_import_permissions2.js (64%) rename cli/tests/{ => testdata}/error_016_dynamic_import_permissions2.out (67%) rename cli/tests/{ => testdata}/error_017_hide_long_source_ts.ts (100%) rename cli/tests/{ => testdata}/error_017_hide_long_source_ts.ts.out (52%) rename cli/tests/{ => testdata}/error_018_hide_long_source_js.js (100%) rename cli/tests/{ => testdata}/error_018_hide_long_source_js.js.out (50%) rename cli/tests/{ => testdata}/error_019_stack_function.ts (100%) create mode 100644 cli/tests/testdata/error_019_stack_function.ts.out rename cli/tests/{ => testdata}/error_020_stack_constructor.ts (100%) create mode 100644 cli/tests/testdata/error_020_stack_constructor.ts.out rename cli/tests/{ => testdata}/error_021_stack_method.ts (100%) create mode 100644 cli/tests/testdata/error_021_stack_method.ts.out rename cli/tests/{ => testdata}/error_022_stack_custom_error.ts (100%) create mode 100644 cli/tests/testdata/error_022_stack_custom_error.ts.out rename cli/tests/{ => testdata}/error_023_stack_async.ts (100%) create mode 100644 cli/tests/testdata/error_023_stack_async.ts.out rename cli/tests/{ => testdata}/error_024_stack_promise_all.ts (100%) create mode 100644 cli/tests/testdata/error_024_stack_promise_all.ts.out rename cli/tests/{ => testdata}/error_025_tab_indent (100%) create mode 100644 cli/tests/testdata/error_025_tab_indent.out create mode 100644 cli/tests/testdata/error_026_remote_import_error.ts create mode 100644 cli/tests/testdata/error_026_remote_import_error.ts.out rename cli/tests/{ => testdata}/error_027_bundle_with_bare_import.ts (100%) rename cli/tests/{ => testdata}/error_027_bundle_with_bare_import.ts.out (100%) rename cli/tests/{ => testdata}/error_import_map_unable_to_load.out (100%) rename cli/tests/{ => testdata}/error_local_static_import_from_remote.js (100%) rename cli/tests/{ => testdata}/error_local_static_import_from_remote.js.out (64%) rename cli/tests/{ => testdata}/error_local_static_import_from_remote.ts (100%) rename cli/tests/{ => testdata}/error_local_static_import_from_remote.ts.out (64%) rename cli/tests/{ => testdata}/error_missing_module_named_import.ts (100%) create mode 100644 cli/tests/testdata/error_missing_module_named_import.ts.out rename cli/tests/{ => testdata}/error_no_check.ts (100%) rename cli/tests/{ => testdata}/error_no_check.ts.out (100%) rename cli/tests/{ => testdata}/error_syntax.js (100%) create mode 100644 cli/tests/testdata/error_syntax.js.out rename cli/tests/{ => testdata}/error_syntax_empty_trailing_line.mjs (100%) create mode 100644 cli/tests/testdata/error_syntax_empty_trailing_line.mjs.out rename cli/tests/{ => testdata}/error_type_definitions.ts (100%) rename cli/tests/{ => testdata}/error_type_definitions.ts.out (100%) rename cli/tests/{ => testdata}/error_worker_permissions_local.ts (100%) rename cli/tests/{ => testdata}/error_worker_permissions_local.ts.out (100%) create mode 100644 cli/tests/testdata/error_worker_permissions_remote.ts rename cli/tests/{ => testdata}/error_worker_permissions_remote.ts.out (100%) rename cli/tests/{ => testdata}/es_private_fields.js (100%) rename cli/tests/{ => testdata}/es_private_fields.js.out (100%) rename cli/tests/{ => testdata}/esm_imports_a.js (100%) rename cli/tests/{ => testdata}/esm_imports_b.js (100%) rename cli/tests/{ => testdata}/exec_path.ts (100%) rename cli/tests/{ => testdata}/exit_error42.ts (100%) rename cli/tests/{ => testdata}/exit_error42.ts.out (100%) rename cli/tests/{ => testdata}/export_type_def.ts (100%) rename cli/tests/{ => testdata}/fetch/hello.txt (100%) create mode 100644 cli/tests/testdata/fetch/other.ts create mode 100644 cli/tests/testdata/fetch/test.ts rename cli/tests/{ => testdata}/fetch_response_finalization.js (100%) rename cli/tests/{ => testdata}/fetch_response_finalization.js.out (100%) rename cli/tests/{ => testdata}/file_exists.ts (100%) rename cli/tests/{ => testdata}/finalization_registry.js (100%) rename cli/tests/{ => testdata}/finalization_registry.js.out (100%) rename cli/tests/{ => testdata}/fix_dynamic_import_errors.js (100%) rename cli/tests/{ => testdata}/fix_dynamic_import_errors.js.out (100%) rename cli/tests/{ => testdata}/fix_emittable_skipped.js (100%) rename cli/tests/{ => testdata}/fix_emittable_skipped.ts.out (100%) rename cli/tests/{ => testdata}/fix_exotic_specifiers.ts (100%) rename cli/tests/{ => testdata}/fix_exotic_specifiers.ts.out (100%) rename cli/tests/{ => testdata}/fix_js_import_js.ts (100%) rename cli/tests/{ => testdata}/fix_js_import_js.ts.out (100%) rename cli/tests/{ => testdata}/fix_js_imports.ts (100%) rename cli/tests/{ => testdata}/fix_js_imports.ts.out (100%) rename cli/tests/{ => testdata}/fix_tsc_file_exists.out (100%) rename cli/tests/{ => testdata}/fix_worker_dispatchevent.ts (100%) rename cli/tests/{ => testdata}/fix_worker_dispatchevent.ts.out (100%) rename cli/tests/{ => testdata}/fixture.json (100%) rename cli/tests/{ => testdata}/fmt/expected_fmt_check_formatted_files.out (100%) rename cli/tests/{ => testdata}/fmt/expected_fmt_check_ignore.out (100%) rename cli/tests/{ => testdata}/fmt/expected_fmt_check_tests_dir.out (100%) rename cli/tests/{ => testdata}/fmt/expected_fmt_check_verbose_formatted_files.out (100%) rename cli/tests/{ => testdata}/fmt/expected_fmt_check_verbose_tests_dir.out (100%) rename cli/tests/{ => testdata}/fmt/formatted1.js (100%) rename cli/tests/{ => testdata}/fmt/formatted2.ts (100%) rename cli/tests/{ => testdata}/fmt/formatted3.md (100%) rename cli/tests/{ => testdata}/fmt/formatted4.jsonc (100%) rename cli/tests/{ => testdata}/heapstats.js (100%) rename cli/tests/{ => testdata}/heapstats.js.out (100%) rename cli/tests/{ => testdata}/hello.txt (100%) create mode 100644 cli/tests/testdata/https_import.ts rename cli/tests/{ => testdata}/https_import.ts.out (100%) rename cli/tests/{ => testdata}/if_main.ts (100%) rename cli/tests/{ => testdata}/if_main.ts.out (100%) rename cli/tests/{ => testdata}/ignore_require.js (100%) rename cli/tests/{ => testdata}/import_blob_url.ts (100%) rename cli/tests/{ => testdata}/import_blob_url.ts.out (100%) rename cli/tests/{ => testdata}/import_blob_url_error_stack.ts (100%) rename cli/tests/{ => testdata}/import_blob_url_error_stack.ts.out (67%) rename cli/tests/{ => testdata}/import_blob_url_import_relative.ts (100%) rename cli/tests/{ => testdata}/import_blob_url_import_relative.ts.out (62%) rename cli/tests/{ => testdata}/import_blob_url_imports.ts (67%) rename cli/tests/{ => testdata}/import_blob_url_imports.ts.out (100%) rename cli/tests/{ => testdata}/import_blob_url_jsx.ts (100%) rename cli/tests/{ => testdata}/import_blob_url_jsx.ts.out (100%) rename cli/tests/{ => testdata}/import_data_url.ts (100%) rename cli/tests/{ => testdata}/import_data_url.ts.out (100%) rename cli/tests/{ => testdata}/import_data_url_error_stack.ts (100%) rename cli/tests/{ => testdata}/import_data_url_error_stack.ts.out (79%) rename cli/tests/{ => testdata}/import_data_url_import_relative.ts (100%) rename cli/tests/{ => testdata}/import_data_url_import_relative.ts.out (100%) rename cli/tests/{ => testdata}/import_data_url_imports.ts (53%) rename cli/tests/{ => testdata}/import_data_url_imports.ts.out (100%) rename cli/tests/{ => testdata}/import_data_url_jsx.ts (100%) rename cli/tests/{ => testdata}/import_data_url_jsx.ts.out (100%) rename cli/tests/{ => testdata}/import_dynamic_data_url.ts (100%) rename cli/tests/{ => testdata}/import_dynamic_data_url.ts.out (100%) create mode 100644 cli/tests/testdata/import_file_with_colon.ts rename cli/tests/{ => testdata}/import_file_with_colon.ts.out (100%) rename cli/tests/{ => testdata}/import_maps/import_map.json (100%) rename cli/tests/{ => testdata}/import_maps/import_map_remote.json (100%) rename cli/tests/{ => testdata}/import_maps/lodash/lodash.ts (100%) rename cli/tests/{ => testdata}/import_maps/lodash/other_file.ts (100%) rename cli/tests/{ => testdata}/import_maps/moment/moment.ts (100%) rename cli/tests/{ => testdata}/import_maps/moment/other_file.ts (100%) rename cli/tests/{ => testdata}/import_maps/scope/scoped.ts (100%) rename cli/tests/{ => testdata}/import_maps/scoped_moment.ts (100%) rename cli/tests/{ => testdata}/import_maps/test.ts (100%) rename cli/tests/{ => testdata}/import_maps/test_remote.ts (100%) rename cli/tests/{ => testdata}/import_maps/vue.ts (100%) rename cli/tests/{ => testdata}/import_meta.ts (100%) rename cli/tests/{ => testdata}/import_meta.ts.out (100%) rename cli/tests/{ => testdata}/import_meta2.ts (100%) rename cli/tests/{ => testdata}/info/data_null_error/data_null_error.out (100%) rename cli/tests/{ => testdata}/info/data_null_error/mod.ts (100%) rename cli/tests/{ => testdata}/info/data_null_error/types.d.ts (100%) rename cli/tests/{ => testdata}/info/types_header.out (100%) rename cli/tests/{ => testdata}/info_json.out (100%) rename cli/tests/{ => testdata}/info_json_location.out (100%) create mode 100644 cli/tests/testdata/info_missing_module.out create mode 100644 cli/tests/testdata/info_recursive_imports_test.out rename cli/tests/{ => testdata}/info_recursive_imports_test.ts (100%) rename cli/tests/{ => testdata}/info_type_import.out (100%) rename cli/tests/{ => testdata}/info_type_import.ts (100%) rename cli/tests/{ => testdata}/inline_js_source_map.ts (100%) create mode 100644 cli/tests/testdata/inline_js_source_map_2.js create mode 100644 cli/tests/testdata/inline_js_source_map_2.js.out rename cli/tests/{ => testdata}/inline_js_source_map_2.ts (100%) create mode 100644 cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js rename cli/tests/{ => testdata}/inline_js_source_map_2_with_inline_contents.js.out (58%) create mode 100644 cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js rename cli/tests/{ => testdata}/inline_js_source_map_with_contents_from_graph.js.out (57%) rename cli/tests/{ => testdata}/inspector1.js (100%) rename cli/tests/{ => testdata}/inspector2.js (100%) rename cli/tests/{ => testdata}/inspector3.js (100%) rename cli/tests/{ => testdata}/inspector4.js (100%) rename cli/tests/{ => testdata}/js_import_detect.ts (100%) rename cli/tests/{ => testdata}/js_import_detect.ts.out (100%) rename cli/tests/{ => testdata}/jsx_import_from_ts.App.jsx (100%) rename cli/tests/{ => testdata}/jsx_import_from_ts.ts (100%) rename cli/tests/{ => testdata}/jsx_import_from_ts.ts.out (100%) rename cli/tests/{ => testdata}/lib_dom_asynciterable.ts (100%) rename cli/tests/{ => testdata}/lib_dom_asynciterable.ts.out (100%) rename cli/tests/{ => testdata}/lib_ref.ts (100%) rename cli/tests/{ => testdata}/lib_ref.ts.out (100%) rename cli/tests/{ => testdata}/lib_runtime_api.ts (100%) rename cli/tests/{ => testdata}/lib_runtime_api.ts.out (100%) rename cli/tests/{ => testdata}/lint/expected.out (100%) rename cli/tests/{ => testdata}/lint/expected_from_stdin.out (100%) rename cli/tests/{ => testdata}/lint/expected_from_stdin_json.out (100%) rename cli/tests/{ => testdata}/lint/expected_glob.out (100%) rename cli/tests/{ => testdata}/lint/expected_ignore.out (100%) rename cli/tests/{ => testdata}/lint/expected_json.out (100%) rename cli/tests/{ => testdata}/lint/expected_quiet.out (100%) rename cli/tests/{ => testdata}/lint/expected_rules.out (100%) rename cli/tests/{ => testdata}/lint/expected_verbose.out (100%) rename cli/tests/{ => testdata}/lint/file1.js (100%) rename cli/tests/{ => testdata}/lint/file2.ts (100%) rename cli/tests/{ => testdata}/lint/ignored_file.ts (100%) rename cli/tests/{ => testdata}/lint/malformed.js (100%) rename cli/tests/{ => testdata}/listen_tls_alpn.ts (68%) create mode 100644 cli/tests/testdata/localhost_unsafe_ssl.ts.out create mode 100644 cli/tests/testdata/lock_check_err.json rename cli/tests/{ => testdata}/lock_check_err.out (65%) create mode 100644 cli/tests/testdata/lock_check_err2.json rename cli/tests/{ => testdata}/lock_check_err2.out (62%) create mode 100644 cli/tests/testdata/lock_check_err_with_bundle.json rename cli/tests/{ => testdata}/lock_check_err_with_bundle.out (67%) create mode 100644 cli/tests/testdata/lock_check_ok.json create mode 100644 cli/tests/testdata/lock_check_ok2.json create mode 100644 cli/tests/testdata/lock_dynamic_imports.json rename cli/tests/{ => testdata}/lock_dynamic_imports.out (66%) rename cli/tests/{ => testdata}/lock_write_fetch.ts (100%) rename cli/tests/{ => testdata}/lock_write_fetch.ts.out (100%) rename cli/tests/{ => testdata}/lock_write_requires_lock.out (100%) rename cli/tests/{ => testdata}/lsp/a.d.ts (100%) rename cli/tests/{ => testdata}/lsp/b.d.ts (100%) rename cli/tests/{ => testdata}/lsp/code_action_ignore_lint_params.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_ignore_lint_response.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_params.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_params_cache.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_params_deadlock.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_params_imports.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_params_refactor.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_resolve_params.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_resolve_params_imports.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_resolve_params_refactor.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_resolve_response.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_resolve_response_imports.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_resolve_response_refactor.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_response.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_response_cache.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_response_imports.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_response_no_disabled.json (100%) rename cli/tests/{ => testdata}/lsp/code_action_response_refactor.json (100%) rename cli/tests/{ => testdata}/lsp/code_lens_resolve_response.json (100%) rename cli/tests/{ => testdata}/lsp/code_lens_resolve_response_impl.json (100%) rename cli/tests/{ => testdata}/lsp/code_lens_response.json (100%) rename cli/tests/{ => testdata}/lsp/code_lens_response_changed.json (100%) rename cli/tests/{ => testdata}/lsp/code_lens_response_impl.json (100%) rename cli/tests/{ => testdata}/lsp/code_lens_response_test.json (100%) rename cli/tests/{ => testdata}/lsp/completion_request_params_optional.json (100%) rename cli/tests/{ => testdata}/lsp/completion_request_response_empty.json (100%) rename cli/tests/{ => testdata}/lsp/completion_resolve_params.json (100%) rename cli/tests/{ => testdata}/lsp/completion_resolve_params_optional.json (100%) rename cli/tests/{ => testdata}/lsp/completion_resolve_params_registry.json (100%) rename cli/tests/{ => testdata}/lsp/completion_resolve_response.json (100%) rename cli/tests/{ => testdata}/lsp/completion_resolve_response_registry.json (100%) rename cli/tests/{ => testdata}/lsp/diagnostics_deno_deps.json (100%) rename cli/tests/{ => testdata}/lsp/diagnostics_deno_types.json (100%) rename cli/tests/{ => testdata}/lsp/did_open_params_deno_types.json (100%) rename cli/tests/{ => testdata}/lsp/did_open_params_doc_symbol.json (100%) create mode 100644 cli/tests/testdata/lsp/did_open_params_import_hover.json create mode 100644 cli/tests/testdata/lsp/did_open_params_large.json rename cli/tests/{ => testdata}/lsp/did_open_params_semantic_tokens.json (100%) rename cli/tests/{ => testdata}/lsp/did_open_params_test_code_lens.json (100%) rename cli/tests/{ => testdata}/lsp/document_symbol_response.json (100%) rename cli/tests/{ => testdata}/lsp/formatting_mbc_response.json (100%) rename cli/tests/{ => testdata}/lsp/import-map.json (100%) rename cli/tests/{ => testdata}/lsp/incoming_calls_params.json (100%) rename cli/tests/{ => testdata}/lsp/incoming_calls_response.json (100%) rename cli/tests/{ => testdata}/lsp/initialize_params.json (100%) rename cli/tests/{ => testdata}/lsp/initialize_params_bad_config_option.json (100%) rename cli/tests/{ => testdata}/lsp/initialize_params_ca_no_disabled.json (100%) rename cli/tests/{ => testdata}/lsp/initialize_params_code_lens_test.json (100%) rename cli/tests/{ => testdata}/lsp/initialize_params_code_lens_test_disabled.json (100%) rename cli/tests/{ => testdata}/lsp/initialize_params_did_config_change.json (100%) rename cli/tests/{ => testdata}/lsp/initialize_params_disabled.json (100%) rename cli/tests/{ => testdata}/lsp/initialize_params_registry.json (100%) rename cli/tests/{ => testdata}/lsp/initialize_params_unstable.json (100%) rename cli/tests/{ => testdata}/lsp/lib.tsconfig.json (100%) rename cli/tests/{ => testdata}/lsp/outgoing_calls_params.json (100%) rename cli/tests/{ => testdata}/lsp/outgoing_calls_response.json (100%) rename cli/tests/{ => testdata}/lsp/prepare_call_hierarchy_response.json (100%) rename cli/tests/{ => testdata}/lsp/registries/a_latest.json (100%) rename cli/tests/{ => testdata}/lsp/registries/a_v1.0.0.json (100%) rename cli/tests/{ => testdata}/lsp/registries/a_v1.0.1.json (100%) rename cli/tests/{ => testdata}/lsp/registries/a_v2.0.0.json (100%) rename cli/tests/{ => testdata}/lsp/registries/a_versions.json (100%) rename cli/tests/{ => testdata}/lsp/registries/b_latest.json (100%) rename cli/tests/{ => testdata}/lsp/registries/b_v0.0.1.json (100%) rename cli/tests/{ => testdata}/lsp/registries/b_v0.0.2.json (100%) rename cli/tests/{ => testdata}/lsp/registries/b_v0.0.3.json (100%) rename cli/tests/{ => testdata}/lsp/registries/b_versions.json (100%) rename cli/tests/{ => testdata}/lsp/registries/deno-import-intellisense.json (52%) rename cli/tests/{ => testdata}/lsp/registries/modules.json (100%) rename cli/tests/{ => testdata}/lsp/rename_response.json (100%) rename cli/tests/{ => testdata}/lsp/selection_range_response.json (100%) rename cli/tests/{ => testdata}/lsp/types.tsconfig.json (100%) rename cli/tests/{ => testdata}/main_module.ts (100%) create mode 100644 cli/tests/testdata/main_module.ts.out rename cli/tests/{ => testdata}/main_module2.ts (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-a.mjs (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-b-mod.js (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-b.ts (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-c-mod.ts (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-checkwithconfig.ts (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-diag.ts (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-dynamicimport.ts (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-importjson.ts (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-importremap.ts (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-main.ts (100%) rename cli/tests/{ => testdata}/module_graph/file_tests-some.json (100%) rename cli/tests/{ => testdata}/module_graph/file_typesref.d.ts (100%) rename cli/tests/{ => testdata}/module_graph/file_typesref.js (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-std-http-server.ts (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-a-mod.ts (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-a.ts (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-import_map.ts (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-jquery.js (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-lib-a.ts (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-lib-b.js (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-lib-c.d.ts (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-lib-c.js (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-lib-mod.d.ts (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-lib-mod.js (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-mod.ts (100%) rename cli/tests/{ => testdata}/module_graph/https_deno.land-x-transpile.tsx (100%) rename cli/tests/{ => testdata}/module_graph/https_unpkg.com-lodash-index.js (100%) rename cli/tests/{ => testdata}/module_graph/lockfile.json (100%) rename cli/tests/{ => testdata}/module_graph/lockfile_fail.json (100%) rename cli/tests/{ => testdata}/module_graph/tsconfig.json (100%) rename cli/tests/{ => testdata}/module_graph/tsconfig_01.json (100%) rename cli/tests/{ => testdata}/no_check_decorators.ts (100%) rename cli/tests/{ => testdata}/no_check_decorators.ts.out (100%) rename cli/tests/{ => testdata}/no_color.js (100%) rename cli/tests/{ => testdata}/no_mem_cache.js (100%) rename cli/tests/{ => testdata}/no_mem_cache.js.out (100%) rename cli/tests/{ => testdata}/no_validate_asm.js (100%) rename cli/tests/{ => testdata}/performance_stats.out (100%) rename cli/tests/{ => testdata}/permission_test.ts (95%) rename cli/tests/{ => testdata}/preserve_imports.tsconfig.json (100%) rename cli/tests/{ => testdata}/proto_exploit.js (100%) rename cli/tests/{ => testdata}/proto_exploit.js.out (100%) rename cli/tests/{ => testdata}/raw_mode.ts (100%) rename cli/tests/{ => testdata}/raw_mode_cbreak.ts (100%) rename cli/tests/{ => testdata}/recursive_imports/A.ts (100%) rename cli/tests/{ => testdata}/recursive_imports/B.ts (100%) rename cli/tests/{ => testdata}/recursive_imports/C.ts (100%) rename cli/tests/{ => testdata}/recursive_imports/common.ts (100%) create mode 100644 cli/tests/testdata/redirect_cache.out rename cli/tests/{ => testdata}/reference_types.ts (100%) rename cli/tests/{ => testdata}/reference_types.ts.out (100%) create mode 100644 cli/tests/testdata/reference_types_remote.ts rename cli/tests/{ => testdata}/reference_types_remote.ts.out (100%) rename cli/tests/{ => testdata}/resolve_dns.ts (100%) rename cli/tests/{ => testdata}/resolve_dns.ts.out (100%) rename cli/tests/{ => testdata}/runtime_decorators.ts (100%) rename cli/tests/{ => testdata}/runtime_decorators.ts.out (100%) rename cli/tests/{ => testdata}/seed_random.js (100%) rename cli/tests/{ => testdata}/seed_random.js.out (100%) rename cli/tests/{ => testdata}/single_compile_with_reload.ts (100%) rename cli/tests/{ => testdata}/single_compile_with_reload.ts.out (100%) rename cli/tests/{ => testdata}/single_compile_with_reload_dyn.ts (100%) rename cli/tests/{ => testdata}/single_compile_with_reload_worker.ts (100%) rename cli/tests/{ => testdata}/standalone_compiler_ops.ts (100%) rename cli/tests/{ => testdata}/standalone_error.ts (100%) rename cli/tests/{ => testdata}/standalone_import.ts (100%) rename cli/tests/{ => testdata}/standalone_import_datauri.ts (100%) rename cli/tests/{ => testdata}/standalone_runtime_flags.ts (100%) rename cli/tests/{ => testdata}/std_lint.out (100%) rename cli/tests/{ => testdata}/stdout_write_all.out (100%) rename cli/tests/{ => testdata}/stdout_write_all.ts (100%) rename cli/tests/{ => testdata}/subdir/amd_like.js (100%) rename cli/tests/{ => testdata}/subdir/auto_print_hello.ts (100%) rename cli/tests/{ => testdata}/subdir/circular1.ts (100%) rename cli/tests/{ => testdata}/subdir/circular2.ts (100%) rename cli/tests/{ => testdata}/subdir/comment.ts (100%) rename cli/tests/{ => testdata}/subdir/config.json (100%) rename cli/tests/{ => testdata}/subdir/emittable.d.ts (100%) rename cli/tests/{ => testdata}/subdir/empty.ts (100%) rename cli/tests/{ => testdata}/subdir/evil_remote_import.js (100%) rename cli/tests/{ => testdata}/subdir/foo_types.d.ts (100%) rename cli/tests/{ => testdata}/subdir/form_urlencoded.txt (100%) rename cli/tests/{ => testdata}/subdir/indirect_import_error.js (100%) rename cli/tests/{ => testdata}/subdir/indirect_throws.js (100%) rename cli/tests/{ => testdata}/subdir/json_1.json (100%) rename cli/tests/{ => testdata}/subdir/json_2.json (100%) rename cli/tests/{ => testdata}/subdir/main.ts (100%) rename cli/tests/{ => testdata}/subdir/mismatch_ext.ts (100%) rename cli/tests/{ => testdata}/subdir/mod1.ts (100%) rename cli/tests/{ => testdata}/subdir/mod2.ts (100%) rename cli/tests/{ => testdata}/subdir/mod3.js (100%) rename cli/tests/{ => testdata}/subdir/mod4.js (100%) rename cli/tests/{ => testdata}/subdir/mod5.mjs (100%) rename cli/tests/{ => testdata}/subdir/mod6.js (100%) rename cli/tests/{ => testdata}/subdir/more_decorators.ts (100%) rename cli/tests/{ => testdata}/subdir/mt_application_ecmascript.j2.js (100%) rename cli/tests/{ => testdata}/subdir/mt_application_ecmascript_jsx.j2.jsx (100%) rename cli/tests/{ => testdata}/subdir/mt_application_x_javascript.j4.js (100%) rename cli/tests/{ => testdata}/subdir/mt_application_x_javascript_jsx.j4.jsx (100%) rename cli/tests/{ => testdata}/subdir/mt_application_x_typescript.t4.ts (100%) rename cli/tests/{ => testdata}/subdir/mt_application_x_typescript_tsx.t4.tsx (100%) rename cli/tests/{ => testdata}/subdir/mt_javascript.js (100%) rename cli/tests/{ => testdata}/subdir/mt_javascript_jsx.jsx (100%) rename cli/tests/{ => testdata}/subdir/mt_text_ecmascript.j3.js (100%) rename cli/tests/{ => testdata}/subdir/mt_text_ecmascript_jsx.j3.jsx (100%) rename cli/tests/{ => testdata}/subdir/mt_text_javascript.j1.js (100%) rename cli/tests/{ => testdata}/subdir/mt_text_javascript_jsx.j1.jsx (100%) rename cli/tests/{ => testdata}/subdir/mt_text_typescript.t1.ts (100%) rename cli/tests/{ => testdata}/subdir/mt_text_typescript_tsx.t1.tsx (100%) rename cli/tests/{ => testdata}/subdir/mt_video_mp2t.t3.ts (100%) rename cli/tests/{ => testdata}/subdir/mt_video_mp2t_tsx.t3.tsx (100%) rename cli/tests/{ => testdata}/subdir/mt_video_vdn.t2.ts (100%) rename cli/tests/{ => testdata}/subdir/mt_video_vdn_tsx.t2.tsx (100%) rename cli/tests/{ => testdata}/subdir/no_ext (100%) rename cli/tests/{ => testdata}/subdir/no_js_ext (100%) rename cli/tests/{ => testdata}/subdir/polyfill.ts (100%) rename cli/tests/{ => testdata}/subdir/print_hello.ts (100%) rename cli/tests/{ => testdata}/subdir/redirects/a.ts (100%) rename cli/tests/{ => testdata}/subdir/redirects/b.ts (100%) rename cli/tests/{ => testdata}/subdir/redirects/redirect1.js (100%) rename cli/tests/{ => testdata}/subdir/redirects/redirect1.ts (100%) rename cli/tests/{ => testdata}/subdir/redirects/redirect2.js (100%) rename cli/tests/{ => testdata}/subdir/redirects/redirect3.js (100%) rename cli/tests/{ => testdata}/subdir/redirects/redirect4.ts (100%) rename cli/tests/{ => testdata}/subdir/single_module.ts (100%) rename cli/tests/{ => testdata}/subdir/subdir2/dynamic_import.ts (100%) rename cli/tests/{ => testdata}/subdir/subdir2/mod2.ts (100%) rename cli/tests/{ => testdata}/subdir/test_worker_basic.js (100%) rename cli/tests/{ => testdata}/subdir/throws.js (100%) rename cli/tests/{ => testdata}/subdir/tla.ts (100%) rename cli/tests/{ => testdata}/subdir/type_and_code.ts (100%) rename cli/tests/{ => testdata}/subdir/type_reference.d.ts (100%) rename cli/tests/{ => testdata}/subdir/type_reference.js (100%) rename cli/tests/{ => testdata}/subdir/types.d.ts (100%) rename cli/tests/{ => testdata}/subdir/unknown_ext.deno (100%) rename cli/tests/{ => testdata}/swc_syntax_error.ts (100%) rename cli/tests/{ => testdata}/swc_syntax_error.ts.out (100%) rename cli/tests/{ => testdata}/symlink_to_subdir (100%) rename cli/tests/{ => testdata}/test/allow_all.out (100%) rename cli/tests/{ => testdata}/test/allow_all.ts (88%) rename cli/tests/{ => testdata}/test/allow_none.out (100%) rename cli/tests/{ => testdata}/test/allow_none.ts (78%) rename cli/tests/{ => testdata}/test/clear_timeout.out (100%) rename cli/tests/{ => testdata}/test/clear_timeout.ts (100%) rename cli/tests/{ => testdata}/test/doc.out (100%) rename cli/tests/{ => testdata}/test/doc.ts (100%) rename cli/tests/{ => testdata}/test/doc_markdown.out (100%) rename cli/tests/{ => testdata}/test/doc_markdown/doc.md (100%) rename cli/tests/{ => testdata}/test/exit_sanitizer.out (100%) rename cli/tests/{ => testdata}/test/exit_sanitizer.ts (100%) rename cli/tests/{ => testdata}/test/fail.out (100%) rename cli/tests/{ => testdata}/test/fail.ts (100%) rename cli/tests/{ => testdata}/test/fail_fast.out (100%) rename cli/tests/{ => testdata}/test/fail_fast.ts (100%) rename cli/tests/{ => testdata}/test/fail_fast_with_val.out (100%) rename cli/tests/{ => testdata}/test/fail_fast_with_val.ts (100%) rename cli/tests/{ => testdata}/test/finally_timeout.out (100%) rename cli/tests/{ => testdata}/test/finally_timeout.ts (100%) rename cli/tests/{ => testdata}/test/ignore.out (100%) rename cli/tests/{ => testdata}/test/ignore.ts (100%) rename cli/tests/{ => testdata}/test/ignore_permissions.out (100%) rename cli/tests/{ => testdata}/test/ignore_permissions.ts (100%) rename cli/tests/{ => testdata}/test/meta.out (100%) rename cli/tests/{ => testdata}/test/meta.ts (100%) rename cli/tests/{ => testdata}/test/no_check.out (100%) rename cli/tests/{ => testdata}/test/no_check.ts (100%) rename cli/tests/{ => testdata}/test/no_color.ts (100%) rename cli/tests/{ => testdata}/test/no_run.out (100%) rename cli/tests/{ => testdata}/test/no_run.ts (100%) rename cli/tests/{ => testdata}/test/only.out (100%) rename cli/tests/{ => testdata}/test/only.ts (100%) rename cli/tests/{ => testdata}/test/pass.out (100%) rename cli/tests/{ => testdata}/test/pass.ts (100%) rename cli/tests/{ => testdata}/test/quiet.out (100%) rename cli/tests/{ => testdata}/test/quiet.ts (100%) rename cli/tests/{ => testdata}/test/shuffle.out (100%) rename cli/tests/{ => testdata}/test/shuffle/bar_test.ts (100%) rename cli/tests/{ => testdata}/test/shuffle/baz_test.ts (100%) rename cli/tests/{ => testdata}/test/shuffle/foo_test.ts (100%) rename cli/tests/{ => testdata}/test/unhandled_rejection.out (100%) rename cli/tests/{ => testdata}/test/unhandled_rejection.ts (100%) rename cli/tests/{ => testdata}/test/unresolved_promise.out (100%) rename cli/tests/{ => testdata}/test/unresolved_promise.ts (100%) rename cli/tests/{ => testdata}/text_decoder_perf.js (100%) rename cli/tests/{ => testdata}/text_encoder_into_perf.js (100%) rename cli/tests/{ => testdata}/text_encoder_perf.js (100%) rename cli/tests/{ => testdata}/tla/a.js (100%) rename cli/tests/{ => testdata}/tla/b.js (100%) rename cli/tests/{ => testdata}/tla/c.js (100%) rename cli/tests/{ => testdata}/tla/d.js (100%) rename cli/tests/{ => testdata}/tla/order.js (100%) rename cli/tests/{ => testdata}/tla/parent.js (100%) rename cli/tests/{ => testdata}/tla2/a.js (100%) rename cli/tests/{ => testdata}/tla2/b.js (100%) rename cli/tests/{ => testdata}/tla3/b.js (100%) rename cli/tests/{ => testdata}/tla3/timeout_loop.js (100%) rename cli/tests/{ => testdata}/tls.out (100%) rename cli/tests/{ => testdata}/tls/README.md (100%) rename cli/tests/{ => testdata}/tls/RootCA.crt (100%) rename cli/tests/{ => testdata}/tls/RootCA.key (100%) rename cli/tests/{ => testdata}/tls/RootCA.pem (100%) rename cli/tests/{ => testdata}/tls/domains.txt (100%) rename cli/tests/{ => testdata}/tls/localhost.crt (100%) rename cli/tests/{ => testdata}/tls/localhost.key (100%) rename cli/tests/{ => testdata}/tls_connecttls.js (84%) rename cli/tests/{ => testdata}/tls_starttls.js (84%) rename cli/tests/{ => testdata}/top_level_await.js (100%) rename cli/tests/{ => testdata}/top_level_await.out (100%) rename cli/tests/{ => testdata}/top_level_await.ts (100%) rename cli/tests/{ => testdata}/top_level_await_circular.js (100%) rename cli/tests/{ => testdata}/top_level_await_circular.out (90%) rename cli/tests/{ => testdata}/top_level_await_loop.js (100%) rename cli/tests/{ => testdata}/top_level_await_loop.out (100%) rename cli/tests/{ => testdata}/top_level_await_nested.out (100%) rename cli/tests/{ => testdata}/top_level_await_nested/a.js (100%) rename cli/tests/{ => testdata}/top_level_await_nested/b.js (100%) rename cli/tests/{ => testdata}/top_level_await_nested/main.js (100%) rename cli/tests/{ => testdata}/top_level_await_order.js (100%) rename cli/tests/{ => testdata}/top_level_await_order.out (100%) rename cli/tests/{ => testdata}/top_level_await_unresolved.js (100%) rename cli/tests/{ => testdata}/top_level_await_unresolved.out (100%) rename cli/tests/{ => testdata}/top_level_for_await.js (100%) rename cli/tests/{ => testdata}/top_level_for_await.out (100%) rename cli/tests/{ => testdata}/top_level_for_await.ts (100%) rename cli/tests/{ => testdata}/ts_decorators.ts (100%) rename cli/tests/{ => testdata}/ts_decorators.ts.out (100%) rename cli/tests/{ => testdata}/ts_decorators_bundle.out (100%) rename cli/tests/{ => testdata}/ts_decorators_bundle.ts (100%) create mode 100644 cli/tests/testdata/ts_import_from_js.deps.js rename cli/tests/{ => testdata}/ts_import_from_js.js (100%) rename cli/tests/{ => testdata}/ts_import_from_js.js.out (100%) rename cli/tests/{ => testdata}/ts_type_imports.ts (100%) rename cli/tests/{ => testdata}/ts_type_imports.ts.out (100%) rename cli/tests/{ => testdata}/ts_type_imports_foo.ts (100%) rename cli/tests/{ => testdata}/ts_type_only_import.d.ts (100%) rename cli/tests/{ => testdata}/ts_type_only_import.ts (100%) rename cli/tests/{ => testdata}/ts_type_only_import.ts.out (100%) rename cli/tests/{ => testdata}/ts_with_generic.ts (100%) rename cli/tests/{ => testdata}/tsc/a.js (100%) rename cli/tests/{ => testdata}/tsc/d.ts (100%) rename cli/tests/{ => testdata}/tsc/node_modules/b.js (100%) rename cli/tests/{ => testdata}/tsc/node_modules/c.js (100%) rename cli/tests/{ => testdata}/tsc/test.js (100%) rename cli/tests/{ => testdata}/tsc2/file_exportc.ts (100%) rename cli/tests/{ => testdata}/tsc2/file_libref.ts (100%) rename cli/tests/{ => testdata}/tsc2/file_main.ts (100%) rename cli/tests/{ => testdata}/tsc2/file_reexports.ts (100%) rename cli/tests/{ => testdata}/tsc2/https_deno.land-x-a.ts (100%) rename cli/tests/{ => testdata}/tsc2/https_deno.land-x-b.ts (100%) rename cli/tests/{ => testdata}/tsc2/https_deno.land-x-c.d.ts (100%) rename cli/tests/{ => testdata}/tsc2/https_deno.land-x-c.js (100%) rename cli/tests/{ => testdata}/tsc2/https_deno.land-x-mod.ts (100%) rename cli/tests/{ => testdata}/tsconfig.decorators.json (100%) rename cli/tests/{ => testdata}/tsx_imports.ts (100%) rename cli/tests/{ => testdata}/tsx_imports.ts.out (100%) rename cli/tests/{ => testdata}/type_definitions.ts (100%) rename cli/tests/{ => testdata}/type_definitions.ts.out (100%) rename cli/tests/{ => testdata}/type_definitions/bar.d.ts (100%) rename cli/tests/{ => testdata}/type_definitions/bar.js (100%) rename cli/tests/{ => testdata}/type_definitions/fizz.d.ts (100%) rename cli/tests/{ => testdata}/type_definitions/fizz.js (100%) rename cli/tests/{ => testdata}/type_definitions/foo.d.ts (100%) rename cli/tests/{ => testdata}/type_definitions/foo.js (100%) rename cli/tests/{ => testdata}/type_definitions/qat.ts (100%) rename cli/tests/{ => testdata}/type_definitions_for_export.ts (100%) rename cli/tests/{ => testdata}/type_definitions_for_export.ts.out (100%) rename cli/tests/{ => testdata}/type_directives_01.ts (100%) rename cli/tests/{ => testdata}/type_directives_01.ts.out (100%) rename cli/tests/{ => testdata}/type_directives_02.ts (100%) create mode 100644 cli/tests/testdata/type_directives_02.ts.out rename cli/tests/{ => testdata}/type_directives_js_main.js (100%) rename cli/tests/{ => testdata}/type_directives_js_main.js.out (63%) rename cli/tests/{ => testdata}/type_directives_redirect.ts (100%) rename cli/tests/{ => testdata}/type_directives_redirect.ts.out (100%) rename cli/tests/{ => testdata}/type_headers_deno_types.ts (100%) rename cli/tests/{ => testdata}/type_headers_deno_types.ts.out (100%) rename cli/tests/{ => testdata}/types.out (100%) rename cli/tests/{ => testdata}/unbuffered_stderr.ts (100%) rename cli/tests/{ => testdata}/unbuffered_stderr.ts.out (100%) rename cli/tests/{ => testdata}/unbuffered_stdout.ts (100%) rename cli/tests/{ => testdata}/unbuffered_stdout.ts.out (100%) rename cli/tests/{ => testdata}/unstable.js (100%) rename cli/tests/{ => testdata}/unstable.ts (100%) rename cli/tests/{ => testdata}/unstable_disabled.out (83%) rename cli/tests/{ => testdata}/unstable_disabled_js.out (100%) rename cli/tests/{ => testdata}/unstable_enabled.out (100%) rename cli/tests/{ => testdata}/unstable_enabled_js.out (100%) rename cli/tests/{ => testdata}/unstable_worker.ts (100%) rename cli/tests/{ => testdata}/unstable_worker.ts.out (100%) rename cli/tests/{ => testdata}/unsupported_dynamic_import_scheme.out (100%) rename cli/tests/{ => testdata}/v8_flags.js (100%) rename cli/tests/{ => testdata}/v8_flags.js.out (100%) rename cli/tests/{ => testdata}/v8_flags_unrecognized.out (100%) rename cli/tests/{ => testdata}/v8_help.out (100%) rename cli/tests/{ => testdata}/wasm.ts (100%) rename cli/tests/{ => testdata}/wasm.ts.out (100%) rename cli/tests/{ => testdata}/wasm_async.js (100%) rename cli/tests/{ => testdata}/wasm_async.out (100%) rename cli/tests/{ => testdata}/wasm_shared.out (100%) rename cli/tests/{ => testdata}/wasm_shared.ts (100%) rename cli/tests/{ => testdata}/wasm_unreachable.js (100%) rename cli/tests/{ => testdata}/wasm_unreachable.out (59%) rename cli/tests/{ => testdata}/weakref.ts (100%) rename cli/tests/{ => testdata}/weakref.ts.out (100%) rename cli/tests/{ => testdata}/webgpu_computepass_shader.wgsl (100%) rename cli/tests/{ => testdata}/webgpu_hellotriangle.out (100%) rename cli/tests/{ => testdata}/webgpu_hellotriangle_shader.wgsl (100%) rename cli/tests/{ => testdata}/websocket_test.ts (98%) rename cli/tests/{ => testdata}/websocketstream_test.ts (97%) rename cli/tests/{ => testdata}/worker_close_race.js (100%) rename cli/tests/{ => testdata}/worker_close_race.js.out (100%) rename cli/tests/{ => testdata}/worker_event_handler_test.js (100%) rename cli/tests/{ => testdata}/worker_event_handler_test.js.out (100%) rename cli/tests/{ => testdata}/workers/bench_large_message.ts (100%) rename cli/tests/{ => testdata}/workers/bench_round_robin.ts (95%) rename cli/tests/{ => testdata}/workers/bench_startup.ts (100%) rename cli/tests/{ => testdata}/workers/bench_worker.ts (100%) rename cli/tests/{ => testdata}/workers/broadcast_channel.ts (100%) rename cli/tests/{ => testdata}/workers/busy_worker.js (100%) rename cli/tests/{ => testdata}/workers/close_race_worker.js (100%) rename cli/tests/{ => testdata}/workers/deno_worker.ts (100%) rename cli/tests/{ => testdata}/workers/dynamic_remote.ts (100%) rename cli/tests/{ => testdata}/workers/error.ts (100%) rename cli/tests/{ => testdata}/workers/event_worker.js (100%) rename cli/tests/{ => testdata}/workers/event_worker_scope.js (100%) rename cli/tests/{ => testdata}/workers/fetching_worker.js (53%) rename cli/tests/{ => testdata}/workers/http_worker.js (100%) rename cli/tests/{ => testdata}/workers/immediately_close_worker.js (100%) rename cli/tests/{ => testdata}/workers/message_port.ts (100%) rename cli/tests/{ => testdata}/workers/nested_worker.js (100%) rename cli/tests/{ => testdata}/workers/no_permissions_worker.js (100%) rename cli/tests/{ => testdata}/workers/non_deno_worker.js (100%) rename cli/tests/{ => testdata}/workers/nonexistent_worker.out (77%) rename cli/tests/{ => testdata}/workers/nonexistent_worker.ts (100%) rename cli/tests/{ => testdata}/workers/parent_read_check_granular_worker.js (100%) rename cli/tests/{ => testdata}/workers/parent_read_check_worker.js (100%) rename cli/tests/{ => testdata}/workers/permissions_blob_local.ts (100%) rename cli/tests/{ => testdata}/workers/permissions_blob_local.ts.out (100%) rename cli/tests/{ => testdata}/workers/permissions_blob_remote.ts (100%) rename cli/tests/{ => testdata}/workers/permissions_blob_remote.ts.out (100%) rename cli/tests/{ => testdata}/workers/permissions_data_local.ts (100%) rename cli/tests/{ => testdata}/workers/permissions_data_local.ts.out (100%) rename cli/tests/{ => testdata}/workers/permissions_data_remote.ts (100%) rename cli/tests/{ => testdata}/workers/permissions_data_remote.ts.out (100%) rename cli/tests/{ => testdata}/workers/permissions_dynamic_remote.ts (64%) rename cli/tests/{ => testdata}/workers/permissions_dynamic_remote.ts.out (80%) create mode 100644 cli/tests/testdata/workers/permissions_remote_remote.ts rename cli/tests/{ => testdata}/workers/permissions_remote_remote.ts.out (76%) rename cli/tests/{ => testdata}/workers/post_undefined.ts (100%) rename cli/tests/{ => testdata}/workers/racy_worker.js (100%) rename cli/tests/{ => testdata}/workers/read_check_granular_worker.js (100%) rename cli/tests/{ => testdata}/workers/read_check_worker.js (100%) rename cli/tests/{ => testdata}/workers/shared_array_buffer.ts (100%) rename cli/tests/{ => testdata}/workers/sibling_worker.js (100%) rename cli/tests/{ => testdata}/workers/static_remote.ts (100%) rename cli/tests/{ => testdata}/workers/test.ts (98%) rename cli/tests/{ => testdata}/workers/test.ts.out (100%) rename cli/tests/{ => testdata}/workers/test_worker.js (100%) rename cli/tests/{ => testdata}/workers/test_worker.ts (100%) rename cli/tests/{ => testdata}/workers/throwing_worker.js (100%) rename cli/tests/{ => testdata}/workers/worker_crypto.js (100%) rename cli/tests/{ => testdata}/workers/worker_error.ts (100%) rename cli/tests/{ => testdata}/workers/worker_error.ts.out (100%) rename cli/tests/{ => testdata}/workers/worker_event_handlers.js (100%) rename cli/tests/{ => testdata}/workers/worker_globals.ts (100%) rename cli/tests/{ => testdata}/workers/worker_large_message.js (100%) rename cli/tests/{ => testdata}/workers/worker_location.ts (100%) rename cli/tests/{ => testdata}/workers/worker_nested_error.ts (100%) rename cli/tests/{ => testdata}/workers/worker_nested_error.ts.out (100%) rename cli/tests/{ => testdata}/workers/worker_structured_cloning.ts (100%) rename cli/tests/{ => testdata}/workers/worker_types.ts (100%) rename cli/tests/{ => testdata}/workers/worker_unstable.ts (100%) rename cli/tests/{ => testdata}/workers/worker_with_top_level_await.ts (100%) rename cli/tests/{ => testdata}/x_deno_warning.js (100%) delete mode 100644 cli/tests/ts_import_from_js.deps.js delete mode 100644 cli/tests/type_directives_02.ts.out delete mode 100644 cli/tests/workers/permissions_remote_remote.ts diff --git a/.dprint.json b/.dprint.json index aaf191b77d..91c827fc1a 100644 --- a/.dprint.json +++ b/.dprint.json @@ -21,10 +21,10 @@ "cli/dts/lib.scripthost.d.ts", "cli/dts/lib.webworker*.d.ts", "cli/dts/typescript.d.ts", - "cli/tests/encoding", - "cli/tests/inline_js_source_map*", - "cli/tests/badly_formatted.md", - "cli/tests/badly_formatted.json", + "cli/tests/testdata/encoding", + "cli/tests/testdata/inline_js_source_map*", + "cli/tests/testdata/badly_formatted.md", + "cli/tests/testdata/badly_formatted.json", "cli/tsc/*typescript.js", "test_util/std", "test_util/wpt", diff --git a/.gitattributes b/.gitattributes index 00d74b7849..08ef3b672d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,11 +2,11 @@ * text=auto eol=lf *.png -text -/cli/tests/encoding/* -text +/cli/tests/testdata/encoding/* -text # Tell git which symlinks point to files, and which ones point to directories. # This is relevant for Windows only, and requires git >= 2.19.2 to work. -/cli/tests/symlink_to_subdir symlink=dir +/cli/tests/testdata/symlink_to_subdir symlink=dir # Tell github these are vendored files. # Doesn't include them in the language statistics. diff --git a/cli/bench/main.rs b/cli/bench/main.rs index e6d7353971..06e2d59bb6 100644 --- a/cli/bench/main.rs +++ b/cli/bench/main.rs @@ -36,29 +36,46 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option)] = &[ // invalidating that cache. ( "cold_hello", - &["run", "--reload", "cli/tests/002_hello.ts"], + &["run", "--reload", "cli/tests/testdata/002_hello.ts"], None, ), ( "cold_relative_import", - &["run", "--reload", "cli/tests/003_relative_import.ts"], + &[ + "run", + "--reload", + "cli/tests/testdata/003_relative_import.ts", + ], None, ), - ("hello", &["run", "cli/tests/002_hello.ts"], None), + ("hello", &["run", "cli/tests/testdata/002_hello.ts"], None), ( "relative_import", - &["run", "cli/tests/003_relative_import.ts"], + &["run", "cli/tests/testdata/003_relative_import.ts"], None, ), - ("error_001", &["run", "cli/tests/error_001.ts"], Some(1)), + ( + "error_001", + &["run", "cli/tests/testdata/error_001.ts"], + Some(1), + ), ( "no_check_hello", - &["run", "--reload", "--no-check", "cli/tests/002_hello.ts"], + &[ + "run", + "--reload", + "--no-check", + "cli/tests/testdata/002_hello.ts", + ], None, ), ( "workers_startup", - &["run", "--allow-read", "cli/tests/workers/bench_startup.ts"], + &[ + "run", + "--allow-read", + "cli/tests/testdata/workers/bench_startup.ts", + ], None, ), ( @@ -66,7 +83,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option)] = &[ &[ "run", "--allow-read", - "cli/tests/workers/bench_round_robin.ts", + "cli/tests/testdata/workers/bench_round_robin.ts", ], None, ), @@ -75,23 +92,23 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option)] = &[ &[ "run", "--allow-read", - "cli/tests/workers/bench_large_message.ts", + "cli/tests/testdata/workers/bench_large_message.ts", ], None, ), ( "text_decoder", - &["run", "cli/tests/text_decoder_perf.js"], + &["run", "cli/tests/testdata/text_decoder_perf.js"], None, ), ( "text_encoder", - &["run", "cli/tests/text_encoder_perf.js"], + &["run", "cli/tests/testdata/text_encoder_perf.js"], None, ), ( "text_encoder_into", - &["run", "cli/tests/text_encoder_into_perf.js"], + &["run", "cli/tests/testdata/text_encoder_into_perf.js"], None, ), ( diff --git a/cli/bench/throughput.rs b/cli/bench/throughput.rs index de18089bb6..0420889efd 100644 --- a/cli/bench/throughput.rs +++ b/cli/bench/throughput.rs @@ -14,7 +14,7 @@ const CLIENT_ADDR: &str = "127.0.0.1 4544"; pub(crate) fn cat(deno_exe: &Path, megs: usize) -> f64 { let size = megs * MB; let shell_cmd = format!( - "{} run --allow-read cli/tests/cat.ts /dev/zero | head -c {}", + "{} run --allow-read cli/tests/testdata/cat.ts /dev/zero | head -c {}", deno_exe.to_str().unwrap(), size ); @@ -47,12 +47,8 @@ pub(crate) fn tcp(deno_exe: &Path, megs: usize) -> Result { // Run deno echo server in the background. let mut echo_server = Command::new(deno_exe.to_str().unwrap()) - .args(&[ - "run", - "--allow-net", - "cli/tests/echo_server.ts", - SERVER_ADDR, - ]) + .args(&["run", "--allow-net", "echo_server.ts", SERVER_ADDR]) + .current_dir(test_util::testdata_path()) .spawn()?; std::thread::sleep(Duration::from_secs(5)); // wait for deno to wake up. TODO racy. diff --git a/cli/config_file.rs b/cli/config_file.rs index 5ea92447b6..e366be77ca 100644 --- a/cli/config_file.rs +++ b/cli/config_file.rs @@ -279,12 +279,12 @@ pub struct ConfigFile { } impl ConfigFile { - pub fn read(path_str: &str) -> Result { - let path = Path::new(path_str); + pub fn read(path_ref: impl AsRef) -> Result { + let path = Path::new(path_ref.as_ref()); let config_file = if path.is_absolute() { path.to_path_buf() } else { - std::env::current_dir()?.join(path_str) + std::env::current_dir()?.join(path_ref) }; let config_path = canonicalize_path(&config_file).map_err(|_| { @@ -349,16 +349,15 @@ mod tests { #[test] fn read_config_file_relative() { - let config_file = ConfigFile::read("tests/module_graph/tsconfig.json") - .expect("Failed to load config file"); + let config_file = + ConfigFile::read("tests/testdata/module_graph/tsconfig.json") + .expect("Failed to load config file"); assert!(config_file.json.compiler_options.is_some()); } #[test] fn read_config_file_absolute() { - let path = std::env::current_dir() - .unwrap() - .join("tests/module_graph/tsconfig.json"); + let path = test_util::testdata_path().join("module_graph/tsconfig.json"); let config_file = ConfigFile::read(path.to_str().unwrap()) .expect("Failed to load config file"); assert!(config_file.json.compiler_options.is_some()); diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs index 7029b96208..41c645c3a5 100644 --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -663,8 +663,7 @@ mod tests { charset: &str, expected: &str, ) { - let url_str = - format!("http://127.0.0.1:4545/cli/tests/encoding/{}", fixture); + let url_str = format!("http://127.0.0.1:4545/encoding/{}", fixture); let specifier = resolve_url(&url_str).unwrap(); let (file, headers) = test_fetch_remote(&specifier).await; assert_eq!(file.source, expected); @@ -676,8 +675,7 @@ mod tests { } async fn test_fetch_local_encoded(charset: &str, expected: String) { - let p = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join(format!("tests/encoding/{}.ts", charset)); + let p = test_util::testdata_path().join(format!("encoding/{}.ts", charset)); let specifier = resolve_url_or_path(p.to_str().unwrap()).unwrap(); let (file, _) = test_fetch(&specifier).await; assert_eq!(file.source, expected); @@ -910,10 +908,9 @@ mod tests { async fn test_get_source() { let _http_server_guard = test_util::http_server(); let (file_fetcher, _) = setup(CacheSetting::Use, None); - let specifier = resolve_url( - "http://localhost:4548/cli/tests/subdir/redirects/redirect1.js", - ) - .unwrap(); + let specifier = + resolve_url("http://localhost:4548/subdir/redirects/redirect1.js") + .unwrap(); let result = file_fetcher .fetch(&specifier, &mut Permissions::allow_all()) @@ -926,10 +923,8 @@ mod tests { assert_eq!(file.source, "export const redirect = 1;\n"); assert_eq!( file.specifier, - resolve_url( - "http://localhost:4545/cli/tests/subdir/redirects/redirect1.js" - ) - .unwrap() + resolve_url("http://localhost:4545/subdir/redirects/redirect1.js") + .unwrap() ); } @@ -999,8 +994,7 @@ mod tests { let (file_fetcher_01, _) = setup(CacheSetting::Use, Some(temp_dir.clone())); let (file_fetcher_02, _) = setup(CacheSetting::Use, Some(temp_dir.clone())); let specifier = - resolve_url_or_path("http://localhost:4545/cli/tests/subdir/mod2.ts") - .unwrap(); + resolve_url_or_path("http://localhost:4545/subdir/mod2.ts").unwrap(); let result = file_fetcher .fetch(&specifier, &mut Permissions::allow_all()) @@ -1098,8 +1092,7 @@ mod tests { ) .expect("could not create file fetcher"); let specifier = - resolve_url("http://localhost:4545/cli/tests/subdir/mismatch_ext.ts") - .unwrap(); + resolve_url("http://localhost:4545/subdir/mismatch_ext.ts").unwrap(); let cache_filename = file_fetcher_01 .http_cache .get_cache_filename(&specifier) @@ -1148,18 +1141,16 @@ mod tests { async fn test_fetch_redirected() { let _http_server_guard = test_util::http_server(); let (file_fetcher, _) = setup(CacheSetting::Use, None); - let specifier = resolve_url( - "http://localhost:4546/cli/tests/subdir/redirects/redirect1.js", - ) - .unwrap(); + let specifier = + resolve_url("http://localhost:4546/subdir/redirects/redirect1.js") + .unwrap(); let cached_filename = file_fetcher .http_cache .get_cache_filename(&specifier) .unwrap(); - let redirected_specifier = resolve_url( - "http://localhost:4545/cli/tests/subdir/redirects/redirect1.js", - ) - .unwrap(); + let redirected_specifier = + resolve_url("http://localhost:4545/subdir/redirects/redirect1.js") + .unwrap(); let redirected_cached_filename = file_fetcher .http_cache .get_cache_filename(&redirected_specifier) @@ -1183,7 +1174,7 @@ mod tests { .expect("could not get file"); assert_eq!( headers.get("location").unwrap(), - "http://localhost:4545/cli/tests/subdir/redirects/redirect1.js" + "http://localhost:4545/subdir/redirects/redirect1.js" ); assert_eq!( @@ -1201,26 +1192,23 @@ mod tests { async fn test_fetch_multiple_redirects() { let _http_server_guard = test_util::http_server(); let (file_fetcher, _) = setup(CacheSetting::Use, None); - let specifier = resolve_url( - "http://localhost:4548/cli/tests/subdir/redirects/redirect1.js", - ) - .unwrap(); + let specifier = + resolve_url("http://localhost:4548/subdir/redirects/redirect1.js") + .unwrap(); let cached_filename = file_fetcher .http_cache .get_cache_filename(&specifier) .unwrap(); - let redirected_01_specifier = resolve_url( - "http://localhost:4546/cli/tests/subdir/redirects/redirect1.js", - ) - .unwrap(); + let redirected_01_specifier = + resolve_url("http://localhost:4546/subdir/redirects/redirect1.js") + .unwrap(); let redirected_01_cached_filename = file_fetcher .http_cache .get_cache_filename(&redirected_01_specifier) .unwrap(); - let redirected_02_specifier = resolve_url( - "http://localhost:4545/cli/tests/subdir/redirects/redirect1.js", - ) - .unwrap(); + let redirected_02_specifier = + resolve_url("http://localhost:4545/subdir/redirects/redirect1.js") + .unwrap(); let redirected_02_cached_filename = file_fetcher .http_cache .get_cache_filename(&redirected_02_specifier) @@ -1244,7 +1232,7 @@ mod tests { .expect("could not get file"); assert_eq!( headers.get("location").unwrap(), - "http://localhost:4546/cli/tests/subdir/redirects/redirect1.js" + "http://localhost:4546/subdir/redirects/redirect1.js" ); assert_eq!( @@ -1258,7 +1246,7 @@ mod tests { .expect("could not get file"); assert_eq!( headers.get("location").unwrap(), - "http://localhost:4545/cli/tests/subdir/redirects/redirect1.js" + "http://localhost:4545/subdir/redirects/redirect1.js" ); assert_eq!( @@ -1289,11 +1277,9 @@ mod tests { ) .expect("could not create file fetcher"); let specifier = - resolve_url("http://localhost:4548/cli/tests/subdir/mismatch_ext.ts") - .unwrap(); + resolve_url("http://localhost:4548/subdir/mismatch_ext.ts").unwrap(); let redirected_specifier = - resolve_url("http://localhost:4546/cli/tests/subdir/mismatch_ext.ts") - .unwrap(); + resolve_url("http://localhost:4546/subdir/mismatch_ext.ts").unwrap(); let redirected_cache_filename = file_fetcher_01 .http_cache .get_cache_filename(&redirected_specifier) @@ -1342,10 +1328,9 @@ mod tests { async fn test_fetcher_limits_redirects() { let _http_server_guard = test_util::http_server(); let (file_fetcher, _) = setup(CacheSetting::Use, None); - let specifier = resolve_url( - "http://localhost:4548/cli/tests/subdir/redirects/redirect1.js", - ) - .unwrap(); + let specifier = + resolve_url("http://localhost:4548/subdir/redirects/redirect1.js") + .unwrap(); let result = file_fetcher .fetch_remote(&specifier, &mut Permissions::allow_all(), 2) @@ -1369,17 +1354,16 @@ mod tests { let _http_server_guard = test_util::http_server(); let (file_fetcher, _) = setup(CacheSetting::Use, None); let specifier = resolve_url( - "http://localhost:4550/REDIRECT/cli/tests/subdir/redirects/redirect1.js", + "http://localhost:4550/REDIRECT/subdir/redirects/redirect1.js", ) .unwrap(); let cached_filename = file_fetcher .http_cache .get_cache_filename(&specifier) .unwrap(); - let redirected_specifier = resolve_url( - "http://localhost:4550/cli/tests/subdir/redirects/redirect1.js", - ) - .unwrap(); + let redirected_specifier = + resolve_url("http://localhost:4550/subdir/redirects/redirect1.js") + .unwrap(); let redirected_cached_filename = file_fetcher .http_cache .get_cache_filename(&redirected_specifier) @@ -1403,7 +1387,7 @@ mod tests { .expect("could not get file"); assert_eq!( headers.get("location").unwrap(), - "/cli/tests/subdir/redirects/redirect1.js" + "/subdir/redirects/redirect1.js" ); assert_eq!( @@ -1431,8 +1415,7 @@ mod tests { None, ) .expect("could not create file fetcher"); - let specifier = - resolve_url("http://localhost:4545/cli/tests/002_hello.ts").unwrap(); + let specifier = resolve_url("http://localhost:4545/002_hello.ts").unwrap(); let result = file_fetcher .fetch(&specifier, &mut Permissions::allow_all()) @@ -1440,7 +1423,7 @@ mod tests { assert!(result.is_err()); let err = result.unwrap_err(); assert_eq!(get_custom_error_class(&err), Some("NoRemote")); - assert_eq!(err.to_string(), "A remote specifier was requested: \"http://localhost:4545/cli/tests/002_hello.ts\", but --no-remote is specified."); + assert_eq!(err.to_string(), "A remote specifier was requested: \"http://localhost:4545/002_hello.ts\", but --no-remote is specified."); } #[tokio::test] @@ -1468,8 +1451,7 @@ mod tests { None, ) .expect("could not create file fetcher"); - let specifier = - resolve_url("http://localhost:4545/cli/tests/002_hello.ts").unwrap(); + let specifier = resolve_url("http://localhost:4545/002_hello.ts").unwrap(); let result = file_fetcher_01 .fetch(&specifier, &mut Permissions::allow_all()) @@ -1477,7 +1459,7 @@ mod tests { assert!(result.is_err()); let err = result.unwrap_err(); assert_eq!(get_custom_error_class(&err), Some("NotFound")); - assert_eq!(err.to_string(), "Specifier not found in cache: \"http://localhost:4545/cli/tests/002_hello.ts\", --cached-only is specified."); + assert_eq!(err.to_string(), "Specifier not found in cache: \"http://localhost:4545/002_hello.ts\", --cached-only is specified."); let result = file_fetcher_02 .fetch(&specifier, &mut Permissions::allow_all()) diff --git a/cli/fs_util.rs b/cli/fs_util.rs index 4fcae38f40..6103a08334 100644 --- a/cli/fs_util.rs +++ b/cli/fs_util.rs @@ -234,8 +234,8 @@ mod tests { assert!(!is_supported_ext(Path::new("tests/subdir/redirects"))); assert!(!is_supported_ext(Path::new("README.md"))); assert!(is_supported_ext(Path::new("lib/typescript.d.ts"))); - assert!(is_supported_ext(Path::new("cli/tests/001_hello.js"))); - assert!(is_supported_ext(Path::new("cli/tests/002_hello.ts"))); + assert!(is_supported_ext(Path::new("testdata/001_hello.js"))); + assert!(is_supported_ext(Path::new("testdata/002_hello.ts"))); assert!(is_supported_ext(Path::new("foo.jsx"))); assert!(is_supported_ext(Path::new("foo.tsx"))); assert!(is_supported_ext(Path::new("foo.TS"))); @@ -252,8 +252,8 @@ mod tests { assert!(is_supported_ext_fmt(Path::new("README.md"))); assert!(is_supported_ext_fmt(Path::new("readme.MD"))); assert!(is_supported_ext_fmt(Path::new("lib/typescript.d.ts"))); - assert!(is_supported_ext_fmt(Path::new("cli/tests/001_hello.js"))); - assert!(is_supported_ext_fmt(Path::new("cli/tests/002_hello.ts"))); + assert!(is_supported_ext_fmt(Path::new("testdata/001_hello.js"))); + assert!(is_supported_ext_fmt(Path::new("testdata/002_hello.ts"))); assert!(is_supported_ext_fmt(Path::new("foo.jsx"))); assert!(is_supported_ext_fmt(Path::new("foo.tsx"))); assert!(is_supported_ext_fmt(Path::new("foo.TS"))); diff --git a/cli/http_util.rs b/cli/http_util.rs index 89ba4fb93e..46ec73cc75 100644 --- a/cli/http_util.rs +++ b/cli/http_util.rs @@ -152,8 +152,7 @@ mod tests { async fn test_fetch_string() { let _http_server_guard = test_util::http_server(); // Relies on external http server. See target/debug/test_server - let url = - Url::parse("http://127.0.0.1:4545/cli/tests/fixture.json").unwrap(); + let url = Url::parse("http://127.0.0.1:4545/fixture.json").unwrap(); let client = create_test_client(None); let result = fetch_once(FetchOnceArgs { client, @@ -176,10 +175,8 @@ mod tests { async fn test_fetch_gzip() { let _http_server_guard = test_util::http_server(); // Relies on external http server. See target/debug/test_server - let url = Url::parse( - "http://127.0.0.1:4545/cli/tests/053_import_compression/gziped", - ) - .unwrap(); + let url = Url::parse("http://127.0.0.1:4545/053_import_compression/gziped") + .unwrap(); let client = create_test_client(None); let result = fetch_once(FetchOnceArgs { client, @@ -239,10 +236,8 @@ mod tests { async fn test_fetch_brotli() { let _http_server_guard = test_util::http_server(); // Relies on external http server. See target/debug/test_server - let url = Url::parse( - "http://127.0.0.1:4545/cli/tests/053_import_compression/brotli", - ) - .unwrap(); + let url = Url::parse("http://127.0.0.1:4545/053_import_compression/brotli") + .unwrap(); let client = create_test_client(None); let result = fetch_once(FetchOnceArgs { client, @@ -269,11 +264,9 @@ mod tests { async fn test_fetch_once_with_redirect() { let _http_server_guard = test_util::http_server(); // Relies on external http server. See target/debug/test_server - let url = - Url::parse("http://127.0.0.1:4546/cli/tests/fixture.json").unwrap(); + let url = Url::parse("http://127.0.0.1:4546/fixture.json").unwrap(); // Dns resolver substitutes `127.0.0.1` with `localhost` - let target_url = - Url::parse("http://localhost:4545/cli/tests/fixture.json").unwrap(); + let target_url = Url::parse("http://localhost:4545/fixture.json").unwrap(); let client = create_test_client(None); let result = fetch_once(FetchOnceArgs { client, @@ -331,16 +324,15 @@ mod tests { async fn test_fetch_with_cafile_string() { let _http_server_guard = test_util::http_server(); // Relies on external http server. See target/debug/test_server - let url = - Url::parse("https://localhost:5545/cli/tests/fixture.json").unwrap(); + let url = Url::parse("https://localhost:5545/fixture.json").unwrap(); let client = create_http_client( version::get_user_agent(), None, Some( read( - test_util::root_path() - .join("cli/tests/tls/RootCA.pem") + test_util::testdata_path() + .join("tls/RootCA.pem") .to_str() .unwrap(), ) @@ -431,17 +423,16 @@ mod tests { async fn test_fetch_with_cafile_gzip() { let _http_server_guard = test_util::http_server(); // Relies on external http server. See target/debug/test_server - let url = Url::parse( - "https://localhost:5545/cli/tests/053_import_compression/gziped", - ) - .unwrap(); + let url = + Url::parse("https://localhost:5545/053_import_compression/gziped") + .unwrap(); let client = create_http_client( version::get_user_agent(), None, Some( read( - test_util::root_path() - .join("cli/tests/tls/RootCA.pem") + test_util::testdata_path() + .join("tls/RootCA.pem") .to_str() .unwrap(), ) @@ -480,8 +471,8 @@ mod tests { None, Some( read( - test_util::root_path() - .join("cli/tests/tls/RootCA.pem") + test_util::testdata_path() + .join("tls/RootCA.pem") .to_str() .unwrap(), ) @@ -525,17 +516,16 @@ mod tests { async fn test_fetch_with_cafile_brotli() { let _http_server_guard = test_util::http_server(); // Relies on external http server. See target/debug/test_server - let url = Url::parse( - "https://localhost:5545/cli/tests/053_import_compression/brotli", - ) - .unwrap(); + let url = + Url::parse("https://localhost:5545/053_import_compression/brotli") + .unwrap(); let client = create_http_client( version::get_user_agent(), None, Some( read( - test_util::root_path() - .join("cli/tests/tls/RootCA.pem") + test_util::testdata_path() + .join("tls/RootCA.pem") .to_str() .unwrap(), ) diff --git a/cli/lsp/sources.rs b/cli/lsp/sources.rs index 8be1420d47..a3f0ae750f 100644 --- a/cli/lsp/sources.rs +++ b/cli/lsp/sources.rs @@ -575,7 +575,6 @@ mod tests { use deno_core::resolve_path; use deno_core::resolve_url; use deno_core::serde_json::json; - use std::env; use tempfile::TempDir; fn setup() -> (Sources, PathBuf) { @@ -588,8 +587,7 @@ mod tests { #[test] fn test_sources_get_script_version() { let (sources, _) = setup(); - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let tests = c.join("tests"); + let tests = test_util::testdata_path(); let specifier = resolve_path(&tests.join("001_hello.js").to_string_lossy()).unwrap(); let actual = sources.get_script_version(&specifier); @@ -599,8 +597,7 @@ mod tests { #[test] fn test_sources_get_text() { let (sources, _) = setup(); - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let tests = c.join("tests"); + let tests = test_util::testdata_path(); let specifier = resolve_path(&tests.join("001_hello.js").to_string_lossy()).unwrap(); let actual = sources.get_source(&specifier); diff --git a/cli/module_graph.rs b/cli/module_graph.rs index 26c20f21dd..44939e68f6 100644 --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -2069,7 +2069,6 @@ pub mod tests { use crate::specifier_handler::MemoryHandler; use deno_core::futures::future; use deno_core::parking_lot::Mutex; - use std::env; use std::fs; use std::path::PathBuf; @@ -2190,8 +2189,7 @@ pub mod tests { async fn setup( specifier: ModuleSpecifier, ) -> (Graph, Arc>) { - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let fixtures = c.join("tests/module_graph"); + let fixtures = test_util::testdata_path().join("module_graph"); let handler = Arc::new(Mutex::new(MockSpecifierHandler { fixtures, ..MockSpecifierHandler::default() @@ -2314,8 +2312,7 @@ pub mod tests { ("file:///tests/fixture14.ts", "fixture14.out"), ("file:///tests/fixture15.ts", "fixture15.out"), ]; - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let fixtures = c.join("tests/bundle"); + let fixtures = test_util::testdata_path().join("bundle"); for (specifier, expected_str) in tests { let specifier = resolve_url_or_path(specifier).unwrap(); @@ -2474,8 +2471,10 @@ pub mod tests { let specifier = resolve_url_or_path("file:///tests/checkwithconfig.ts") .expect("could not resolve module"); let (graph, handler) = setup(specifier.clone()).await; - let config_file = - ConfigFile::read("tests/module_graph/tsconfig_01.json").unwrap(); + let config_file = ConfigFile::read( + test_util::testdata_path().join("module_graph/tsconfig_01.json"), + ) + .unwrap(); let result_info = graph .check(CheckOptions { debug: false, @@ -2496,8 +2495,10 @@ pub mod tests { // let's do it all over again to ensure that the versions are determinstic let (graph, handler) = setup(specifier).await; - let config_file = - ConfigFile::read("tests/module_graph/tsconfig_01.json").unwrap(); + let config_file = ConfigFile::read( + test_util::testdata_path().join("module_graph/tsconfig_01.json"), + ) + .unwrap(); let result_info = graph .check(CheckOptions { debug: false, @@ -2651,8 +2652,7 @@ pub mod tests { async fn test_graph_import_json() { let specifier = resolve_url_or_path("file:///tests/importjson.ts") .expect("could not resolve module"); - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let fixtures = c.join("tests/module_graph"); + let fixtures = test_util::testdata_path().join("module_graph"); let handler = Arc::new(Mutex::new(MockSpecifierHandler { fixtures, ..MockSpecifierHandler::default() @@ -2726,8 +2726,10 @@ pub mod tests { let specifier = resolve_url_or_path("https://deno.land/x/transpile.tsx") .expect("could not resolve module"); let (mut graph, handler) = setup(specifier).await; - let config_file = - ConfigFile::read("tests/module_graph/tsconfig.json").unwrap(); + let config_file = ConfigFile::read( + test_util::testdata_path().join("module_graph/tsconfig.json"), + ) + .unwrap(); let result_info = graph .transpile(TranspileOptions { debug: false, @@ -2756,8 +2758,7 @@ pub mod tests { #[tokio::test] async fn test_graph_import_map_remote_to_local() { - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let fixtures = c.join("tests/module_graph"); + let fixtures = test_util::testdata_path().join("module_graph"); let maybe_import_map = Some( ImportMap::from_json( "file:///tests/importmap.json", @@ -2783,8 +2784,7 @@ pub mod tests { #[tokio::test] async fn test_graph_with_lockfile() { - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let fixtures = c.join("tests/module_graph"); + let fixtures = test_util::testdata_path().join("module_graph"); let lockfile_path = fixtures.join("lockfile.json"); let lockfile = Lockfile::new(lockfile_path, false).expect("could not load lockfile"); diff --git a/cli/specifier_handler.rs b/cli/specifier_handler.rs index ddc3adc7e1..cd785f015e 100644 --- a/cli/specifier_handler.rs +++ b/cli/specifier_handler.rs @@ -572,7 +572,6 @@ pub mod tests { use crate::http_cache::HttpCache; use deno_core::resolve_url_or_path; use deno_runtime::deno_web::BlobStore; - use std::env; use tempfile::TempDir; macro_rules! map ( @@ -618,8 +617,7 @@ pub mod tests { let _http_server_guard = test_util::http_server(); let (_, mut file_fetcher) = setup(); let specifier = - resolve_url_or_path("http://localhost:4545/cli/tests/subdir/mod2.ts") - .unwrap(); + resolve_url_or_path("http://localhost:4545/subdir/mod2.ts").unwrap(); let cached_module: CachedModule = file_fetcher .fetch(specifier.clone(), None, false) .await @@ -639,8 +637,7 @@ pub mod tests { let _http_server_guard = test_util::http_server(); let (_, mut file_fetcher) = setup(); let specifier = - resolve_url_or_path("http://localhost:4545/cli/tests/subdir/mod2.ts") - .unwrap(); + resolve_url_or_path("http://localhost:4545/subdir/mod2.ts").unwrap(); let cached_module: CachedModule = file_fetcher .fetch(specifier.clone(), None, false) .await @@ -665,14 +662,16 @@ pub mod tests { let _http_server_guard = test_util::http_server(); let (_, mut file_fetcher) = setup(); let specifier = - resolve_url_or_path("http://localhost:4545/cli/tests/subdir/mod2.ts") - .unwrap(); + resolve_url_or_path("http://localhost:4545/subdir/mod2.ts").unwrap(); let cached_module: CachedModule = file_fetcher.fetch(specifier, None, false).await.unwrap(); assert!(cached_module.is_remote); - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); let specifier = resolve_url_or_path( - c.join("tests/subdir/mod1.ts").as_os_str().to_str().unwrap(), + test_util::testdata_path() + .join("subdir/mod1.ts") + .as_os_str() + .to_str() + .unwrap(), ) .unwrap(); let cached_module: CachedModule = diff --git a/cli/tests/006_url_imports.ts b/cli/tests/006_url_imports.ts deleted file mode 100644 index 109cb603e3..0000000000 --- a/cli/tests/006_url_imports.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello } from "http://localhost:4545/cli/tests/subdir/mod2.ts"; -printHello(); -console.log("success"); diff --git a/cli/tests/019_media_types.ts b/cli/tests/019_media_types.ts deleted file mode 100644 index 523639be41..0000000000 --- a/cli/tests/019_media_types.ts +++ /dev/null @@ -1,24 +0,0 @@ -// When run against the test HTTP server, it will serve different media types -// based on the URL containing `.t#.` strings, which exercises the different -// mapping of media types end to end. - -import { loaded as loadedTs1 } from "http://localhost:4545/cli/tests/subdir/mt_text_typescript.t1.ts"; -import { loaded as loadedTs2 } from "http://localhost:4545/cli/tests/subdir/mt_video_vdn.t2.ts"; -import { loaded as loadedTs3 } from "http://localhost:4545/cli/tests/subdir/mt_video_mp2t.t3.ts"; -import { loaded as loadedTs4 } from "http://localhost:4545/cli/tests/subdir/mt_application_x_typescript.t4.ts"; -import { loaded as loadedJs1 } from "http://localhost:4545/cli/tests/subdir/mt_text_javascript.j1.js"; -import { loaded as loadedJs2 } from "http://localhost:4545/cli/tests/subdir/mt_application_ecmascript.j2.js"; -import { loaded as loadedJs3 } from "http://localhost:4545/cli/tests/subdir/mt_text_ecmascript.j3.js"; -import { loaded as loadedJs4 } from "http://localhost:4545/cli/tests/subdir/mt_application_x_javascript.j4.js"; - -console.log( - "success", - loadedTs1, - loadedTs2, - loadedTs3, - loadedTs4, - loadedJs1, - loadedJs2, - loadedJs3, - loadedJs4, -); diff --git a/cli/tests/022_info_flag_script.out b/cli/tests/022_info_flag_script.out deleted file mode 100644 index 878b0fa08f..0000000000 --- a/cli/tests/022_info_flag_script.out +++ /dev/null @@ -1,14 +0,0 @@ -[WILDCARD] -local: [WILDCARD]http[WILDCARD]127.0.0.1_PORT4545[WILDCARD] -type: TypeScript -dependencies: 8 unique (total [WILDCARD]) - -http://127.0.0.1:4545/cli/tests/019_media_types.ts ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_application_ecmascript.j2.js ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_application_x_javascript.j4.js ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_application_x_typescript.t4.ts ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_text_ecmascript.j3.js ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_text_javascript.j1.js ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_text_typescript.t1.ts ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_video_mp2t.t3.ts ([WILDCARD]) -└── http://localhost:4545/cli/tests/subdir/mt_video_vdn.t2.ts ([WILDCARD]) diff --git a/cli/tests/035_cached_only_flag.out b/cli/tests/035_cached_only_flag.out deleted file mode 100644 index 0c4992799f..0000000000 --- a/cli/tests/035_cached_only_flag.out +++ /dev/null @@ -1 +0,0 @@ -error: Specifier not found in cache: "http://127.0.0.1:4545/cli/tests/019_media_types.ts", --cached-only is specified. diff --git a/cli/tests/037_fetch_multiple.out b/cli/tests/037_fetch_multiple.out deleted file mode 100644 index 2497cfa76c..0000000000 --- a/cli/tests/037_fetch_multiple.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://localhost:4545/cli/tests/subdir/mod2.ts -Download http://localhost:4545/cli/tests/subdir/print_hello.ts -Check [WILDCARD]/fetch/test.ts -Download http://localhost:4545/cli/tests/subdir/mt_text_typescript.t1.ts -Check [WILDCARD]/fetch/other.ts diff --git a/cli/tests/045_proxy_test.ts.out b/cli/tests/045_proxy_test.ts.out deleted file mode 100644 index 4957c93073..0000000000 --- a/cli/tests/045_proxy_test.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -Proxy server listening on [WILDCARD] -Proxy request to: http://localhost:4545/test_util/std/examples/colors.ts -Proxy request to: http://localhost:4545/test_util/std/examples/colors.ts -Proxy request to: http://localhost:4545/test_util/std/fmt/colors.ts -Proxy request to: http://localhost:4545/test_util/std/examples/colors.ts -proxy-authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= diff --git a/cli/tests/048_media_types_jsx.ts b/cli/tests/048_media_types_jsx.ts deleted file mode 100644 index 0449630006..0000000000 --- a/cli/tests/048_media_types_jsx.ts +++ /dev/null @@ -1,32 +0,0 @@ -// When run against the test HTTP server, it will serve different media types -// based on the URL containing `.t#.` strings, which exercises the different -// mapping of media types end to end. -import { loaded as loadedTsx1 } from "http://localhost:4545/cli/tests/subdir/mt_text_typescript_tsx.t1.tsx"; -import { loaded as loadedTsx2 } from "http://localhost:4545/cli/tests/subdir/mt_video_vdn_tsx.t2.tsx"; -import { loaded as loadedTsx3 } from "http://localhost:4545/cli/tests/subdir/mt_video_mp2t_tsx.t3.tsx"; -import { loaded as loadedTsx4 } from "http://localhost:4545/cli/tests/subdir/mt_application_x_typescript_tsx.t4.tsx"; -import { loaded as loadedJsx1 } from "http://localhost:4545/cli/tests/subdir/mt_text_javascript_jsx.j1.jsx"; -import { loaded as loadedJsx2 } from "http://localhost:4545/cli/tests/subdir/mt_application_ecmascript_jsx.j2.jsx"; -import { loaded as loadedJsx3 } from "http://localhost:4545/cli/tests/subdir/mt_text_ecmascript_jsx.j3.jsx"; -import { loaded as loadedJsx4 } from "http://localhost:4545/cli/tests/subdir/mt_application_x_javascript_jsx.j4.jsx"; - -declare global { - namespace JSX { - interface IntrinsicElements { - // deno-lint-ignore no-explicit-any - [elemName: string]: any; - } - } -} - -console.log( - "success", - loadedTsx1, - loadedTsx2, - loadedTsx3, - loadedTsx4, - loadedJsx1, - loadedJsx2, - loadedJsx3, - loadedJsx4, -); diff --git a/cli/tests/049_info_flag_script_jsx.out b/cli/tests/049_info_flag_script_jsx.out deleted file mode 100644 index 0ad6608d41..0000000000 --- a/cli/tests/049_info_flag_script_jsx.out +++ /dev/null @@ -1,14 +0,0 @@ -[WILDCARD] -local: [WILDCARD]http[WILDCARD]127.0.0.1_PORT4545[WILDCARD] -type: TypeScript -dependencies: 8 unique (total [WILDCARD]) - -http://127.0.0.1:4545/cli/tests/048_media_types_jsx.ts ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_application_ecmascript_jsx.j2.jsx ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_application_x_javascript_jsx.j4.jsx ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_application_x_typescript_tsx.t4.tsx ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_text_ecmascript_jsx.j3.jsx ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_text_javascript_jsx.j1.jsx ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_text_typescript_tsx.t1.tsx ([WILDCARD]) -├── http://localhost:4545/cli/tests/subdir/mt_video_mp2t_tsx.t3.tsx ([WILDCARD]) -└── http://localhost:4545/cli/tests/subdir/mt_video_vdn_tsx.t2.tsx ([WILDCARD]) diff --git a/cli/tests/053_import_compression/main.ts b/cli/tests/053_import_compression/main.ts deleted file mode 100644 index 5b21994835..0000000000 --- a/cli/tests/053_import_compression/main.ts +++ /dev/null @@ -1,13 +0,0 @@ -import "http://127.0.0.1:4545/cli/tests/053_import_compression/gziped"; -import "http://127.0.0.1:4545/cli/tests/053_import_compression/brotli"; - -console.log( - await fetch( - "http://127.0.0.1:4545/cli/tests/053_import_compression/gziped", - ).then((res) => res.text()), -); -console.log( - await fetch( - "http://127.0.0.1:4545/cli/tests/053_import_compression/brotli", - ).then((res) => res.text()), -); diff --git a/cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts.out b/cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts.out deleted file mode 100644 index b7b4076f92..0000000000 --- a/cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts.out +++ /dev/null @@ -1,12 +0,0 @@ -Defined in [WILDCARD]/cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts:3:2 - -function test(name: string, fn: Function): void - -Defined in [WILDCARD]/cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts:4:2 - -function test(options: object): void - -Defined in [WILDCARD]cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts:5:2 - -function test(name: string | object, fn?: Function): void - diff --git a/cli/tests/README.md b/cli/tests/README.md deleted file mode 100644 index 831d2750f4..0000000000 --- a/cli/tests/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Integration Tests - -This path contains integration tests. See integration_tests.rs for the index. diff --git a/cli/tests/bundle_dynamic_import.ts b/cli/tests/bundle_dynamic_import.ts deleted file mode 100644 index 7548316327..0000000000 --- a/cli/tests/bundle_dynamic_import.ts +++ /dev/null @@ -1,3 +0,0 @@ -const mod1 = await import("http://localhost:4545/cli/tests/subdir/mod1.ts"); - -mod1.printHello3(); diff --git a/cli/tests/cache_extensionless.out b/cli/tests/cache_extensionless.out deleted file mode 100644 index 6e35696890..0000000000 --- a/cli/tests/cache_extensionless.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -Check http://localhost:4545/cli/tests/subdir/no_js_ext diff --git a/cli/tests/cache_random_extension.out b/cli/tests/cache_random_extension.out deleted file mode 100644 index c508fbc602..0000000000 --- a/cli/tests/cache_random_extension.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -Check http://localhost:4545/cli/tests/subdir/no_js_ext@1.0.0 diff --git a/cli/tests/cafile_info.ts b/cli/tests/cafile_info.ts deleted file mode 100644 index cd92a42f65..0000000000 --- a/cli/tests/cafile_info.ts +++ /dev/null @@ -1,24 +0,0 @@ -// When run against the test HTTP server, it will serve different media types -// based on the URL containing `.t#.` strings, which exercises the different -// mapping of media types end to end. - -import { loaded as loadedTs1 } from "https://localhost:5545/cli/tests/subdir/mt_text_typescript.t1.ts"; -import { loaded as loadedTs2 } from "https://localhost:5545/cli/tests/subdir/mt_video_vdn.t2.ts"; -import { loaded as loadedTs3 } from "https://localhost:5545/cli/tests/subdir/mt_video_mp2t.t3.ts"; -import { loaded as loadedTs4 } from "https://localhost:5545/cli/tests/subdir/mt_application_x_typescript.t4.ts"; -import { loaded as loadedJs1 } from "https://localhost:5545/cli/tests/subdir/mt_text_javascript.j1.js"; -import { loaded as loadedJs2 } from "https://localhost:5545/cli/tests/subdir/mt_application_ecmascript.j2.js"; -import { loaded as loadedJs3 } from "https://localhost:5545/cli/tests/subdir/mt_text_ecmascript.j3.js"; -import { loaded as loadedJs4 } from "https://localhost:5545/cli/tests/subdir/mt_application_x_javascript.j4.js"; - -console.log( - "success", - loadedTs1, - loadedTs2, - loadedTs3, - loadedTs4, - loadedJs1, - loadedJs2, - loadedJs3, - loadedJs4, -); diff --git a/cli/tests/cafile_info.ts.out b/cli/tests/cafile_info.ts.out deleted file mode 100644 index 35575f8d6d..0000000000 --- a/cli/tests/cafile_info.ts.out +++ /dev/null @@ -1,13 +0,0 @@ -local: [WILDCARD]https[WILDCARD]localhost_PORT5545[WILDCARD] -type: TypeScript -dependencies: 8 unique (total [WILDCARD]) - -https://localhost:5545/cli/tests/cafile_info.ts ([WILDCARD]) -├── https://localhost:5545/cli/tests/subdir/mt_application_ecmascript.j2.js ([WILDCARD]) -├── https://localhost:5545/cli/tests/subdir/mt_application_x_javascript.j4.js ([WILDCARD]) -├── https://localhost:5545/cli/tests/subdir/mt_application_x_typescript.t4.ts ([WILDCARD]) -├── https://localhost:5545/cli/tests/subdir/mt_text_ecmascript.j3.js ([WILDCARD]) -├── https://localhost:5545/cli/tests/subdir/mt_text_javascript.j1.js ([WILDCARD]) -├── https://localhost:5545/cli/tests/subdir/mt_text_typescript.t1.ts ([WILDCARD]) -├── https://localhost:5545/cli/tests/subdir/mt_video_mp2t.t3.ts ([WILDCARD]) -└── https://localhost:5545/cli/tests/subdir/mt_video_vdn.t2.ts ([WILDCARD]) diff --git a/cli/tests/cafile_url_imports.ts b/cli/tests/cafile_url_imports.ts deleted file mode 100644 index f781f32f50..0000000000 --- a/cli/tests/cafile_url_imports.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello } from "https://localhost:5545/cli/tests/subdir/mod2.ts"; -printHello(); -console.log("success"); diff --git a/cli/tests/config_types_remote.tsconfig.json b/cli/tests/config_types_remote.tsconfig.json deleted file mode 100644 index 745bb7b20f..0000000000 --- a/cli/tests/config_types_remote.tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "types": [ - "http://localhost:4545/cli/tests/subdir/types.d.ts" - ] - } -} diff --git a/cli/tests/disallow_http_from_https_js.out b/cli/tests/disallow_http_from_https_js.out deleted file mode 100644 index 405859e4d4..0000000000 --- a/cli/tests/disallow_http_from_https_js.out +++ /dev/null @@ -1,3 +0,0 @@ -error: Modules imported via https are not allowed to import http modules. - Importing: http://localhost:4545/cli/tests/001_hello.js - at https://localhost:5545/cli/tests/disallow_http_from_https.js:2:0 diff --git a/cli/tests/disallow_http_from_https_ts.out b/cli/tests/disallow_http_from_https_ts.out deleted file mode 100644 index b63ba0c678..0000000000 --- a/cli/tests/disallow_http_from_https_ts.out +++ /dev/null @@ -1,3 +0,0 @@ -error: Modules imported via https are not allowed to import http modules. - Importing: http://localhost:4545/cli/tests/001_hello.js - at https://localhost:5545/cli/tests/disallow_http_from_https.ts:2:0 diff --git a/cli/tests/dynamic_import/permissions_remote_remote.ts b/cli/tests/dynamic_import/permissions_remote_remote.ts deleted file mode 100644 index 99de3f46f0..0000000000 --- a/cli/tests/dynamic_import/permissions_remote_remote.ts +++ /dev/null @@ -1,3 +0,0 @@ -await import( - "http://localhost:4545/cli/tests/dynamic_import/static_remote.ts" -); diff --git a/cli/tests/dynamic_import/permissions_remote_remote.ts.out b/cli/tests/dynamic_import/permissions_remote_remote.ts.out deleted file mode 100644 index ae81138999..0000000000 --- a/cli/tests/dynamic_import/permissions_remote_remote.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -error: Uncaught (in promise) TypeError: Requires net access to "example.com", run again with the --allow-net flag - at http://localhost:4545/cli/tests/dynamic_import/static_remote.ts:2:0 -await import( -^ - at async file:///[WILDCARD]/cli/tests/dynamic_import/permissions_remote_remote.ts:1:1 diff --git a/cli/tests/error_001.ts.out b/cli/tests/error_001.ts.out deleted file mode 100644 index d4103349a2..0000000000 --- a/cli/tests/error_001.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD]error: Uncaught Error: bad - throw Error("bad"); - ^ - at foo ([WILDCARD]tests/error_001.ts:2:9) - at bar ([WILDCARD]tests/error_001.ts:6:3) - at [WILDCARD]tests/error_001.ts:9:1 diff --git a/cli/tests/error_002.ts.out b/cli/tests/error_002.ts.out deleted file mode 100644 index 2aae770f8a..0000000000 --- a/cli/tests/error_002.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD]error: Uncaught Error: exception from mod1 - throw Error("exception from mod1"); - ^ - at throwsError ([WILDCARD]tests/subdir/mod1.ts:16:9) - at foo ([WILDCARD]tests/error_002.ts:4:3) - at [WILDCARD]tests/error_002.ts:7:1 diff --git a/cli/tests/error_004_missing_module.ts.out b/cli/tests/error_004_missing_module.ts.out deleted file mode 100644 index 474fdf8ed1..0000000000 --- a/cli/tests/error_004_missing_module.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD]error: Cannot resolve module "file:///[WILDCARD]cli/tests/bad-module.ts" from "file:///[WILDCARD]cli/tests/error_004_missing_module.ts". - at file:///[WILDCARD]cli/tests/error_004_missing_module.ts:1:0 diff --git a/cli/tests/error_015_dynamic_import_permissions.js b/cli/tests/error_015_dynamic_import_permissions.js deleted file mode 100644 index 197339c5e6..0000000000 --- a/cli/tests/error_015_dynamic_import_permissions.js +++ /dev/null @@ -1,3 +0,0 @@ -(async () => { - await import("http://localhost:4545/cli/tests/subdir/mod4.js"); -})(); diff --git a/cli/tests/error_019_stack_function.ts.out b/cli/tests/error_019_stack_function.ts.out deleted file mode 100644 index 66e37bce9e..0000000000 --- a/cli/tests/error_019_stack_function.ts.out +++ /dev/null @@ -1,8 +0,0 @@ -[WILDCARD]Error: function - at foo ([WILDCARD]tests/error_019_stack_function.ts:[WILDCARD]) - at [WILDCARD]tests/error_019_stack_function.ts:[WILDCARD] -error: Uncaught Error: function - throw new Error("function"); - ^ - at foo ([WILDCARD]tests/error_019_stack_function.ts:[WILDCARD]) - at [WILDCARD]tests/error_019_stack_function.ts:[WILDCARD] diff --git a/cli/tests/error_020_stack_constructor.ts.out b/cli/tests/error_020_stack_constructor.ts.out deleted file mode 100644 index 96a243e74a..0000000000 --- a/cli/tests/error_020_stack_constructor.ts.out +++ /dev/null @@ -1,8 +0,0 @@ -[WILDCARD]Error: constructor - at new A ([WILDCARD]tests/error_020_stack_constructor.ts:[WILDCARD]) - at [WILDCARD]tests/error_020_stack_constructor.ts:[WILDCARD] -error: Uncaught Error: constructor - throw new Error("constructor"); - ^ - at new A ([WILDCARD]tests/error_020_stack_constructor.ts:[WILDCARD]) - at [WILDCARD]tests/error_020_stack_constructor.ts:[WILDCARD] diff --git a/cli/tests/error_021_stack_method.ts.out b/cli/tests/error_021_stack_method.ts.out deleted file mode 100644 index 1f9a24aed2..0000000000 --- a/cli/tests/error_021_stack_method.ts.out +++ /dev/null @@ -1,8 +0,0 @@ -[WILDCARD]Error: method - at A.m ([WILDCARD]tests/error_021_stack_method.ts:[WILDCARD]) - at [WILDCARD]tests/error_021_stack_method.ts:[WILDCARD] -error: Uncaught Error: method - throw new Error("method"); - ^ - at A.m ([WILDCARD]tests/error_021_stack_method.ts:[WILDCARD]) - at [WILDCARD]tests/error_021_stack_method.ts:[WILDCARD] diff --git a/cli/tests/error_022_stack_custom_error.ts.out b/cli/tests/error_022_stack_custom_error.ts.out deleted file mode 100644 index d95783d063..0000000000 --- a/cli/tests/error_022_stack_custom_error.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD]CustomError: custom error - at [WILDCARD]tests/error_022_stack_custom_error.ts:[WILDCARD] -error: Uncaught CustomError: custom error -const error = new CustomError(); - ^ - at [WILDCARD]tests/error_022_stack_custom_error.ts:[WILDCARD] diff --git a/cli/tests/error_023_stack_async.ts.out b/cli/tests/error_023_stack_async.ts.out deleted file mode 100644 index 2f4ffd2f33..0000000000 --- a/cli/tests/error_023_stack_async.ts.out +++ /dev/null @@ -1,10 +0,0 @@ -[WILDCARD]Error: async - at [WILDCARD]tests/error_023_stack_async.ts:[WILDCARD] - at async [WILDCARD]tests/error_023_stack_async.ts:[WILDCARD] - at async [WILDCARD]tests/error_023_stack_async.ts:[WILDCARD] -error: Uncaught Error: async - throw new Error("async"); - ^ - at [WILDCARD]tests/error_023_stack_async.ts:[WILDCARD] - at async [WILDCARD]tests/error_023_stack_async.ts:[WILDCARD] - at async [WILDCARD]tests/error_023_stack_async.ts:[WILDCARD] diff --git a/cli/tests/error_024_stack_promise_all.ts.out b/cli/tests/error_024_stack_promise_all.ts.out deleted file mode 100644 index 31e15c3725..0000000000 --- a/cli/tests/error_024_stack_promise_all.ts.out +++ /dev/null @@ -1,10 +0,0 @@ -[WILDCARD]Error: Promise.all() - at [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD] - at async Promise.all (index 1) - at async [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD] -error: Uncaught Error: Promise.all() - throw new Error("Promise.all()"); - ^ - at [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD] - at async Promise.all (index 1) - at async [WILDCARD]tests/error_024_stack_promise_all.ts:[WILDCARD] diff --git a/cli/tests/error_025_tab_indent.out b/cli/tests/error_025_tab_indent.out deleted file mode 100644 index 7b339c48fe..0000000000 --- a/cli/tests/error_025_tab_indent.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD]error: Uncaught Error: bad - throw Error("bad"); - ^ - at foo ([WILDCARD]tests/error_025_tab_indent:2:8) - at bar ([WILDCARD]tests/error_025_tab_indent:6:2) - at [WILDCARD]tests/error_025_tab_indent:9:1 diff --git a/cli/tests/error_026_remote_import_error.ts b/cli/tests/error_026_remote_import_error.ts deleted file mode 100644 index 1ab600cfa0..0000000000 --- a/cli/tests/error_026_remote_import_error.ts +++ /dev/null @@ -1 +0,0 @@ -import "http://localhost:4545/cli/tests/error_001.ts"; diff --git a/cli/tests/error_026_remote_import_error.ts.out b/cli/tests/error_026_remote_import_error.ts.out deleted file mode 100644 index e2d6545ef0..0000000000 --- a/cli/tests/error_026_remote_import_error.ts.out +++ /dev/null @@ -1,7 +0,0 @@ -[WILDCARD]error: Uncaught Error: bad - throw Error("bad"); - ^ - at foo (http://localhost:4545/cli/tests/error_001.ts:2:9) - at bar (http://localhost:4545/cli/tests/error_001.ts:6:3) - at http://localhost:4545/cli/tests/error_001.ts:9:1 -[WILDCARD] diff --git a/cli/tests/error_missing_module_named_import.ts.out b/cli/tests/error_missing_module_named_import.ts.out deleted file mode 100644 index 4da7c2885b..0000000000 --- a/cli/tests/error_missing_module_named_import.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Cannot resolve module "[WILDCARD]cli/tests/does_not_exist.js" from "[WILDCARD]cli/tests/error_missing_module_named_import.ts". - at [WILDCARD]cli/tests/error_missing_module_named_import.ts:1:0 diff --git a/cli/tests/error_syntax.js.out b/cli/tests/error_syntax.js.out deleted file mode 100644 index d458bae498..0000000000 --- a/cli/tests/error_syntax.js.out +++ /dev/null @@ -1 +0,0 @@ -error: Expected ,, got following at [WILDCARD]tests/error_syntax.js:3:5 diff --git a/cli/tests/error_syntax_empty_trailing_line.mjs.out b/cli/tests/error_syntax_empty_trailing_line.mjs.out deleted file mode 100644 index 3b78a23a65..0000000000 --- a/cli/tests/error_syntax_empty_trailing_line.mjs.out +++ /dev/null @@ -1 +0,0 @@ -error: Unexpected eof at [WILDCARD]tests/error_syntax_empty_trailing_line.mjs:2:21 diff --git a/cli/tests/error_worker_permissions_remote.ts b/cli/tests/error_worker_permissions_remote.ts deleted file mode 100644 index 9fd1ba5a82..0000000000 --- a/cli/tests/error_worker_permissions_remote.ts +++ /dev/null @@ -1,4 +0,0 @@ -new Worker( - "http://localhost:4545/cli/tests/subdir/worker_types.ts", - { type: "module" }, -); diff --git a/cli/tests/fetch/other.ts b/cli/tests/fetch/other.ts deleted file mode 100644 index ab85b226f8..0000000000 --- a/cli/tests/fetch/other.ts +++ /dev/null @@ -1 +0,0 @@ -import "http://localhost:4545/cli/tests/subdir/mt_text_typescript.t1.ts"; diff --git a/cli/tests/fetch/test.ts b/cli/tests/fetch/test.ts deleted file mode 100644 index 1b49a76c89..0000000000 --- a/cli/tests/fetch/test.ts +++ /dev/null @@ -1 +0,0 @@ -import "http://localhost:4545/cli/tests/subdir/mod2.ts"; diff --git a/cli/tests/https_import.ts b/cli/tests/https_import.ts deleted file mode 100644 index e78a342a0b..0000000000 --- a/cli/tests/https_import.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello } from "https://localhost:5545/cli/tests/subdir/print_hello.ts"; - -printHello(); diff --git a/cli/tests/import_file_with_colon.ts b/cli/tests/import_file_with_colon.ts deleted file mode 100644 index 5a2bbceb60..0000000000 --- a/cli/tests/import_file_with_colon.ts +++ /dev/null @@ -1 +0,0 @@ -import "http://localhost:4545/cli/tests/subdir/file_with_:_in_name.ts"; diff --git a/cli/tests/info_missing_module.out b/cli/tests/info_missing_module.out deleted file mode 100644 index e01cd098e5..0000000000 --- a/cli/tests/info_missing_module.out +++ /dev/null @@ -1,6 +0,0 @@ -local: [WILDCARD]error_009_missing_js_module.js -type: JavaScript -dependencies: 1 unique (total 26B) - -file://[WILDCARD]/cli/tests/error_009_missing_js_module.js (26B) -└── file://[WILDCARD]/cli/tests/bad-module.js (error) diff --git a/cli/tests/info_recursive_imports_test.out b/cli/tests/info_recursive_imports_test.out deleted file mode 100644 index 7b53ed89b4..0000000000 --- a/cli/tests/info_recursive_imports_test.out +++ /dev/null @@ -1,12 +0,0 @@ -local: [WILDCARD]info_recursive_imports_test.ts -type: TypeScript -dependencies: 4 unique (total [WILDCARD]) - -file://[WILDCARD]cli/tests/info_recursive_imports_test.ts ([WILDCARD]) -└─┬ file://[WILDCARD]cli/tests/recursive_imports/A.ts ([WILDCARD]) - ├─┬ file://[WILDCARD]cli/tests/recursive_imports/B.ts ([WILDCARD]) - │ ├─┬ file://[WILDCARD]cli/tests/recursive_imports/C.ts ([WILDCARD]) - │ │ ├── file://[WILDCARD]cli/tests/recursive_imports/A.ts * - │ │ └── file://[WILDCARD]cli/tests/recursive_imports/common.ts ([WILDCARD]) - │ └── file://[WILDCARD]cli/tests/recursive_imports/common.ts * - └── file://[WILDCARD]cli/tests/recursive_imports/common.ts * diff --git a/cli/tests/inline_js_source_map_2.js b/cli/tests/inline_js_source_map_2.js deleted file mode 100644 index 199ff7bb0b..0000000000 --- a/cli/tests/inline_js_source_map_2.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; -1 + 1; -throw new Error("Hello world!"); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L2NsaS90ZXN0cy9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/cli/tests/inline_js_source_map_2.js.out b/cli/tests/inline_js_source_map_2.js.out deleted file mode 100644 index 13e50bac4e..0000000000 --- a/cli/tests/inline_js_source_map_2.js.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Uncaught Error: Hello world! - at http://localhost:4545/cli/tests/inline_js_source_map_2.ts:6:7 diff --git a/cli/tests/inline_js_source_map_2_with_inline_contents.js b/cli/tests/inline_js_source_map_2_with_inline_contents.js deleted file mode 100644 index a225b3975e..0000000000 --- a/cli/tests/inline_js_source_map_2_with_inline_contents.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; - -throw new Error("Hello world!"); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L2NsaS90ZXN0cy9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIjErMTtcbmludGVyZmFjZSBUZXN0IHtcbiAgaGVsbG86IHN0cmluZztcbn1cblxudGhyb3cgbmV3IEVycm9yKFwiSGVsbG8gd29ybGQhXCIgYXMgdW5rbm93biBhcyBzdHJpbmcpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/cli/tests/inline_js_source_map_with_contents_from_graph.js b/cli/tests/inline_js_source_map_with_contents_from_graph.js deleted file mode 100644 index 5324e0ed24..0000000000 --- a/cli/tests/inline_js_source_map_with_contents_from_graph.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; -import "http://localhost:4545/cli/tests/inline_js_source_map.ts"; -throw new Error("Hello world!"); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L2NsaS90ZXN0cy9pbmxpbmVfanNfc291cmNlX21hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsQ0FBQyxHQUFDLENBQUMsQ0FBQztBQUtKLE1BQU0sSUFBSSxLQUFLLENBQUMsY0FBK0IsQ0FBQyxDQUFDIn0= \ No newline at end of file diff --git a/cli/tests/integration/bundle_tests.rs b/cli/tests/integration/bundle_tests.rs index 1ef1a39f50..4e68af0b1d 100644 --- a/cli/tests/integration/bundle_tests.rs +++ b/cli/tests/integration/bundle_tests.rs @@ -7,12 +7,12 @@ use test_util as util; #[test] fn bundle_exports() { // First we have to generate a bundle of some module that has exports. - let mod1 = util::root_path().join("cli/tests/subdir/mod1.ts"); + let mod1 = util::testdata_path().join("subdir/mod1.ts"); assert!(mod1.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("mod1.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(mod1) .arg(&bundle) @@ -33,7 +33,7 @@ fn bundle_exports() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -49,12 +49,12 @@ fn bundle_exports() { #[test] fn bundle_exports_no_check() { // First we have to generate a bundle of some module that has exports. - let mod1 = util::root_path().join("cli/tests/subdir/mod1.ts"); + let mod1 = util::testdata_path().join("subdir/mod1.ts"); assert!(mod1.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("mod1.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg("--no-check") .arg(mod1) @@ -76,7 +76,7 @@ fn bundle_exports_no_check() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -92,12 +92,12 @@ fn bundle_exports_no_check() { #[test] fn bundle_circular() { // First we have to generate a bundle of some module that has exports. - let circular1 = util::root_path().join("cli/tests/subdir/circular1.ts"); + let circular1 = util::testdata_path().join("subdir/circular1.ts"); assert!(circular1.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("circular1.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(circular1) .arg(&bundle) @@ -108,7 +108,7 @@ fn bundle_circular() { assert!(bundle.is_file()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&bundle) .output() @@ -124,13 +124,12 @@ fn bundle_circular() { #[test] fn bundle_single_module() { // First we have to generate a bundle of some module that has exports. - let single_module = - util::root_path().join("cli/tests/subdir/single_module.ts"); + let single_module = util::testdata_path().join("subdir/single_module.ts"); assert!(single_module.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("single_module.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(single_module) .arg(&bundle) @@ -141,7 +140,7 @@ fn bundle_single_module() { assert!(bundle.is_file()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&bundle) .output() @@ -157,12 +156,12 @@ fn bundle_single_module() { #[test] fn bundle_tla() { // First we have to generate a bundle of some module that has exports. - let tla_import = util::root_path().join("cli/tests/subdir/tla.ts"); + let tla_import = util::testdata_path().join("subdir/tla.ts"); assert!(tla_import.is_file()); let t = tempfile::TempDir::new().expect("tempdir fail"); let bundle = t.path().join("tla.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(tla_import) .arg(&bundle) @@ -183,7 +182,7 @@ fn bundle_tla() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -199,12 +198,12 @@ fn bundle_tla() { #[test] fn bundle_js() { // First we have to generate a bundle of some module that has exports. - let mod6 = util::root_path().join("cli/tests/subdir/mod6.js"); + let mod6 = util::testdata_path().join("subdir/mod6.js"); assert!(mod6.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("mod6.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(mod6) .arg(&bundle) @@ -215,7 +214,7 @@ fn bundle_js() { assert!(bundle.is_file()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&bundle) .output() @@ -227,13 +226,12 @@ fn bundle_js() { #[test] fn bundle_dynamic_import() { let _g = util::http_server(); - let dynamic_import = - util::root_path().join("cli/tests/bundle_dynamic_import.ts"); + let dynamic_import = util::testdata_path().join("bundle_dynamic_import.ts"); assert!(dynamic_import.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("bundle_dynamic_import.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(dynamic_import) .arg(&bundle) @@ -244,7 +242,7 @@ fn bundle_dynamic_import() { assert!(bundle.is_file()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("--allow-net") .arg("--quiet") @@ -261,13 +259,13 @@ fn bundle_dynamic_import() { #[test] fn bundle_import_map() { - let import = util::root_path().join("cli/tests/bundle_im.ts"); - let import_map_path = util::root_path().join("cli/tests/bundle_im.json"); + let import = util::testdata_path().join("bundle_im.ts"); + let import_map_path = util::testdata_path().join("bundle_im.json"); assert!(import.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("import_map.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg("--import-map") .arg(import_map_path) @@ -290,7 +288,7 @@ fn bundle_import_map() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -305,13 +303,13 @@ fn bundle_import_map() { #[test] fn bundle_import_map_no_check() { - let import = util::root_path().join("cli/tests/bundle_im.ts"); - let import_map_path = util::root_path().join("cli/tests/bundle_im.json"); + let import = util::testdata_path().join("bundle_im.ts"); + let import_map_path = util::testdata_path().join("bundle_im.json"); assert!(import.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("import_map.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg("--no-check") .arg("--import-map") @@ -335,7 +333,7 @@ fn bundle_import_map_no_check() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -349,7 +347,7 @@ fn bundle_import_map_no_check() { } itest!(lock_check_err_with_bundle { - args: "bundle --lock=lock_check_err_with_bundle.json http://127.0.0.1:4545/cli/tests/subdir/mod1.ts", + args: "bundle --lock=lock_check_err_with_bundle.json http://127.0.0.1:4545/subdir/mod1.ts", output: "lock_check_err_with_bundle.out", exit_code: 10, http_server: true, diff --git a/cli/tests/integration/cache_tests.rs b/cli/tests/integration/cache_tests.rs index c97741a137..1fc035b9b0 100644 --- a/cli/tests/integration/cache_tests.rs +++ b/cli/tests/integration/cache_tests.rs @@ -21,13 +21,13 @@ itest!(_095_cache_with_bare_import { }); itest!(cache_extensionless { - args: "cache --reload http://localhost:4545/cli/tests/subdir/no_js_ext", + args: "cache --reload http://localhost:4545/subdir/no_js_ext", output: "cache_extensionless.out", http_server: true, }); itest!(cache_random_extension { - args: "cache --reload http://localhost:4545/cli/tests/subdir/no_js_ext@1.0.0", + args: "cache --reload http://localhost:4545/subdir/no_js_ext@1.0.0", output: "cache_random_extension.out", http_server: true, }); @@ -39,7 +39,7 @@ itest!(performance_stats { itest!(redirect_cache { http_server: true, - args: "cache --reload http://localhost:4548/cli/tests/subdir/redirects/a.ts", + args: "cache --reload http://localhost:4548/subdir/redirects/a.ts", output: "redirect_cache.out", }); diff --git a/cli/tests/integration/compile_tests.rs b/cli/tests/integration/compile_tests.rs index 0748821ddb..067f6b9ebc 100644 --- a/cli/tests/integration/compile_tests.rs +++ b/cli/tests/integration/compile_tests.rs @@ -71,12 +71,12 @@ fn standalone_args() { dir.path().join("args") }; let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./cli/tests/028_args.ts") + .arg("./028_args.ts") .arg("a") .arg("b") .stdout(std::process::Stdio::piped()) @@ -107,12 +107,12 @@ fn standalone_error() { dir.path().join("error") }; let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./cli/tests/standalone_error.ts") + .arg("./standalone_error.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -143,12 +143,12 @@ fn standalone_no_module_load() { dir.path().join("hello") }; let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./cli/tests/standalone_import.ts") + .arg("./standalone_import.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -178,12 +178,12 @@ fn standalone_load_datauri() { dir.path().join("load_datauri") }; let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./cli/tests/standalone_import_datauri.ts") + .arg("./standalone_import_datauri.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -210,12 +210,12 @@ fn standalone_compiler_ops() { dir.path().join("standalone_compiler_ops") }; let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./cli/tests/standalone_compiler_ops.ts") + .arg("./standalone_compiler_ops.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -243,12 +243,12 @@ fn compile_with_directory_exists_error() { }; std::fs::create_dir(&exe).expect("cannot create directory"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./cli/tests/028_args.ts") + .arg("./028_args.ts") .stderr(std::process::Stdio::piped()) .spawn() .unwrap() @@ -272,12 +272,12 @@ fn compile_with_conflict_file_exists_error() { std::fs::write(&exe, b"SHOULD NOT BE OVERWRITTEN") .expect("cannot create file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./cli/tests/028_args.ts") + .arg("./028_args.ts") .stderr(std::process::Stdio::piped()) .spawn() .unwrap() @@ -303,12 +303,12 @@ fn compile_and_overwrite_file() { dir.path().join("args") }; let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./cli/tests/028_args.ts") + .arg("./028_args.ts") .stderr(std::process::Stdio::piped()) .spawn() .unwrap() @@ -318,12 +318,12 @@ fn compile_and_overwrite_file() { assert!(&exe.exists()); let recompile_output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./cli/tests/028_args.ts") + .arg("./028_args.ts") .stderr(std::process::Stdio::piped()) .spawn() .unwrap() @@ -341,7 +341,7 @@ fn standalone_runtime_flags() { dir.path().join("flags") }; let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--allow-read") @@ -349,7 +349,7 @@ fn standalone_runtime_flags() { .arg("1") .arg("--output") .arg(&exe) - .arg("./cli/tests/standalone_runtime_flags.ts") + .arg("./standalone_runtime_flags.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() diff --git a/cli/tests/integration/coverage_tests.rs b/cli/tests/integration/coverage_tests.rs index dce3fb38ca..4580b5cecb 100644 --- a/cli/tests/integration/coverage_tests.rs +++ b/cli/tests/integration/coverage_tests.rs @@ -9,12 +9,12 @@ fn branch() { let tempdir = TempDir::new().expect("tempdir fail"); let tempdir = tempdir.path().join("cov"); let status = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("test") .arg("--quiet") .arg("--unstable") .arg(format!("--coverage={}", tempdir.to_str().unwrap())) - .arg("cli/tests/coverage/branch_test.ts") + .arg("coverage/branch_test.ts") .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::inherit()) .status() @@ -23,7 +23,7 @@ fn branch() { assert!(status.success()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("coverage") .arg("--quiet") .arg("--unstable") @@ -38,7 +38,7 @@ fn branch() { .to_string(); let expected = fs::read_to_string( - util::root_path().join("cli/tests/coverage/expected_branch.out"), + util::testdata_path().join("coverage/expected_branch.out"), ) .unwrap(); @@ -51,7 +51,7 @@ fn branch() { assert!(output.status.success()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("coverage") .arg("--quiet") .arg("--unstable") @@ -67,7 +67,7 @@ fn branch() { .to_string(); let expected = fs::read_to_string( - util::root_path().join("cli/tests/coverage/expected_branch.lcov"), + util::testdata_path().join("coverage/expected_branch.lcov"), ) .unwrap(); @@ -84,12 +84,12 @@ fn branch() { fn complex() { let tempdir = TempDir::new().expect("tempdir fail"); let status = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("test") .arg("--quiet") .arg("--unstable") .arg(format!("--coverage={}", tempdir.path().to_str().unwrap())) - .arg("cli/tests/coverage/complex_test.ts") + .arg("coverage/complex_test.ts") .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::inherit()) .status() @@ -98,7 +98,7 @@ fn complex() { assert!(status.success()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("coverage") .arg("--quiet") .arg("--unstable") @@ -113,7 +113,7 @@ fn complex() { .to_string(); let expected = fs::read_to_string( - util::root_path().join("cli/tests/coverage/expected_complex.out"), + util::testdata_path().join("coverage/expected_complex.out"), ) .unwrap(); @@ -126,7 +126,7 @@ fn complex() { assert!(output.status.success()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("coverage") .arg("--quiet") .arg("--unstable") @@ -142,7 +142,7 @@ fn complex() { .to_string(); let expected = fs::read_to_string( - util::root_path().join("cli/tests/coverage/expected_complex.lcov"), + util::testdata_path().join("coverage/expected_complex.lcov"), ) .unwrap(); diff --git a/cli/tests/integration/fmt_tests.rs b/cli/tests/integration/fmt_tests.rs index 4aab38fcfa..00565a5d04 100644 --- a/cli/tests/integration/fmt_tests.rs +++ b/cli/tests/integration/fmt_tests.rs @@ -7,33 +7,32 @@ use test_util as util; #[test] fn fmt_test() { let t = TempDir::new().expect("tempdir fail"); - let fixed_js = util::root_path().join("cli/tests/badly_formatted_fixed.js"); + let fixed_js = util::testdata_path().join("badly_formatted_fixed.js"); let badly_formatted_original_js = - util::root_path().join("cli/tests/badly_formatted.mjs"); + util::testdata_path().join("badly_formatted.mjs"); let badly_formatted_js = t.path().join("badly_formatted.js"); let badly_formatted_js_str = badly_formatted_js.to_str().unwrap(); std::fs::copy(&badly_formatted_original_js, &badly_formatted_js) .expect("Failed to copy file"); - let fixed_md = util::root_path().join("cli/tests/badly_formatted_fixed.md"); + let fixed_md = util::testdata_path().join("badly_formatted_fixed.md"); let badly_formatted_original_md = - util::root_path().join("cli/tests/badly_formatted.md"); + util::testdata_path().join("badly_formatted.md"); let badly_formatted_md = t.path().join("badly_formatted.md"); let badly_formatted_md_str = badly_formatted_md.to_str().unwrap(); std::fs::copy(&badly_formatted_original_md, &badly_formatted_md) .expect("Failed to copy file"); - let fixed_json = - util::root_path().join("cli/tests/badly_formatted_fixed.json"); + let fixed_json = util::testdata_path().join("badly_formatted_fixed.json"); let badly_formatted_original_json = - util::root_path().join("cli/tests/badly_formatted.json"); + util::testdata_path().join("badly_formatted.json"); let badly_formatted_json = t.path().join("badly_formatted.json"); let badly_formatted_json_str = badly_formatted_json.to_str().unwrap(); std::fs::copy(&badly_formatted_original_json, &badly_formatted_json) .expect("Failed to copy file"); // First, check formatting by ignoring the badly formatted file. let status = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("fmt") .arg(format!( "--ignore={},{},{}", @@ -52,7 +51,7 @@ fn fmt_test() { // Check without ignore. let status = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("fmt") .arg("--check") .arg(badly_formatted_js_str) @@ -66,7 +65,7 @@ fn fmt_test() { // Format the source file. let status = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("fmt") .arg(badly_formatted_js_str) .arg(badly_formatted_md_str) @@ -91,7 +90,7 @@ fn fmt_test() { fn fmt_stdin_error() { use std::io::Write; let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("fmt") .arg("-") .stdin(std::process::Stdio::piped()) @@ -112,7 +111,7 @@ fn fmt_stdin_error() { #[test] fn fmt_ignore_unexplicit_files() { let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .env("NO_COLOR", "1") .arg("fmt") .arg("--check") diff --git a/cli/tests/integration/info_tests.rs b/cli/tests/integration/info_tests.rs index af0f259eaf..9e7dbda5b5 100644 --- a/cli/tests/integration/info_tests.rs +++ b/cli/tests/integration/info_tests.rs @@ -7,12 +7,12 @@ use test_util as util; #[test] fn info_with_compiled_source() { let _g = util::http_server(); - let module_path = "http://127.0.0.1:4545/cli/tests/048_media_types_jsx.ts"; + let module_path = "http://127.0.0.1:4545/048_media_types_jsx.ts"; let t = TempDir::new().expect("tempdir fail"); let mut deno = util::deno_cmd() .env("DENO_DIR", t.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("cache") .arg(&module_path) .spawn() @@ -23,7 +23,7 @@ fn info_with_compiled_source() { let output = util::deno_cmd() .env("DENO_DIR", t.path()) .env("NO_COLOR", "1") - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("info") .arg(&module_path) .output() @@ -37,7 +37,7 @@ fn info_with_compiled_source() { } itest!(_022_info_flag_script { - args: "info http://127.0.0.1:4545/cli/tests/019_media_types.ts", + args: "info http://127.0.0.1:4545/019_media_types.ts", output: "022_info_flag_script.out", http_server: true, }); @@ -68,7 +68,7 @@ itest!(info_json_location { }); itest!(_049_info_flag_script_jsx { - args: "info http://127.0.0.1:4545/cli/tests/048_media_types_jsx.ts", + args: "info http://127.0.0.1:4545/048_media_types_jsx.ts", output: "049_info_flag_script_jsx.out", http_server: true, }); diff --git a/cli/tests/integration/inspector_tests.rs b/cli/tests/integration/inspector_tests.rs index edc18b8d7d..520a5b4f78 100644 --- a/cli/tests/integration/inspector_tests.rs +++ b/cli/tests/integration/inspector_tests.rs @@ -30,7 +30,7 @@ fn extract_ws_url_from_stderr( #[tokio::test] async fn inspector_connect() { - let script = util::tests_path().join("inspector1.js"); + let script = util::testdata_path().join("inspector1.js"); let mut child = util::deno_cmd() .arg("run") .arg(inspect_flag_with_unique_port("--inspect")) @@ -64,7 +64,7 @@ enum TestStep { #[tokio::test] async fn inspector_break_on_first_line() { - let script = util::tests_path().join("inspector2.js"); + let script = util::testdata_path().join("inspector2.js"); let mut child = util::deno_cmd() .arg("run") .arg(inspect_flag_with_unique_port("--inspect-brk")) @@ -132,7 +132,7 @@ async fn inspector_break_on_first_line() { #[tokio::test] async fn inspector_pause() { - let script = util::tests_path().join("inspector1.js"); + let script = util::testdata_path().join("inspector1.js"); let mut child = util::deno_cmd() .arg("run") .arg(inspect_flag_with_unique_port("--inspect")) @@ -202,7 +202,7 @@ async fn inspector_port_collision() { return; } - let script = util::tests_path().join("inspector1.js"); + let script = util::testdata_path().join("inspector1.js"); let inspect_flag = inspect_flag_with_unique_port("--inspect"); let mut child1 = util::deno_cmd() @@ -242,7 +242,7 @@ async fn inspector_port_collision() { #[tokio::test] async fn inspector_does_not_hang() { - let script = util::tests_path().join("inspector3.js"); + let script = util::testdata_path().join("inspector3.js"); let mut child = util::deno_cmd() .arg("run") .arg(inspect_flag_with_unique_port("--inspect-brk")) @@ -330,7 +330,7 @@ async fn inspector_does_not_hang() { #[tokio::test] async fn inspector_without_brk_runs_code() { - let script = util::tests_path().join("inspector4.js"); + let script = util::testdata_path().join("inspector4.js"); let mut child = util::deno_cmd() .arg("run") .arg(inspect_flag_with_unique_port("--inspect")) @@ -438,7 +438,7 @@ async fn inspector_runtime_evaluate_does_not_crash() { #[tokio::test] async fn inspector_json() { - let script = util::tests_path().join("inspector1.js"); + let script = util::testdata_path().join("inspector1.js"); let mut child = util::deno_cmd() .arg("run") .arg(inspect_flag_with_unique_port("--inspect")) @@ -467,7 +467,7 @@ async fn inspector_json() { #[tokio::test] async fn inspector_json_list() { - let script = util::tests_path().join("inspector1.js"); + let script = util::testdata_path().join("inspector1.js"); let mut child = util::deno_cmd() .arg("run") .arg(inspect_flag_with_unique_port("--inspect")) @@ -498,7 +498,7 @@ async fn inspector_json_list() { async fn inspector_connect_non_ws() { // https://github.com/denoland/deno/issues/11449 // Verify we don't panic if non-WS connection is being established - let script = util::tests_path().join("inspector1.js"); + let script = util::testdata_path().join("inspector1.js"); let mut child = util::deno_cmd() .arg("run") .arg(inspect_flag_with_unique_port("--inspect")) diff --git a/cli/tests/integration/install_tests.rs b/cli/tests/integration/install_tests.rs index e5229df8f8..ff93c157fb 100644 --- a/cli/tests/integration/install_tests.rs +++ b/cli/tests/integration/install_tests.rs @@ -16,7 +16,7 @@ fn installer_test_local_module_run() { .arg("echo_test") .arg("--root") .arg(temp_dir.path()) - .arg(util::tests_path().join("echo.ts")) + .arg(util::testdata_path().join("echo.ts")) .arg("hello") .spawn() .unwrap() @@ -47,13 +47,13 @@ fn installer_test_remote_module_run() { let bin_dir = temp_dir.path().join("bin"); std::fs::create_dir(&bin_dir).unwrap(); let status = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("install") .arg("--name") .arg("echo_test") .arg("--root") .arg(temp_dir.path()) - .arg("http://localhost:4545/cli/tests/echo.ts") + .arg("http://localhost:4545/echo.ts") .arg("hello") .spawn() .unwrap() diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 518dfe8509..f0cb6d4b8a 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -12,17 +12,17 @@ use tempfile::TempDir; use test_util::deno_exe_path; use test_util::http_server; use test_util::lsp::LspClient; -use test_util::root_path; +use test_util::testdata_path; fn load_fixture(path: &str) -> Value { - let fixtures_path = root_path().join("cli/tests/lsp"); + let fixtures_path = testdata_path().join("lsp"); let path = fixtures_path.join(path); let fixture_str = fs::read_to_string(path).unwrap(); serde_json::from_str(&fixture_str).unwrap() } fn load_fixture_str(path: &str) -> String { - let fixtures_path = root_path().join("cli/tests/lsp"); + let fixtures_path = testdata_path().join("lsp"); let path = fixtures_path.join(path); fs::read_to_string(path).unwrap() } @@ -921,7 +921,7 @@ fn lsp_hover_dependency() { Some(json!({ "contents": { "kind": "markdown", - "value": "**Resolved Dependency**\n\n**Code**: http​://127.0.0.1:4545/cli/tests/subdir/type_reference.js\n" + "value": "**Resolved Dependency**\n\n**Code**: http​://127.0.0.1:4545/subdir/type_reference.js\n" }, "range": { "start": { @@ -930,7 +930,7 @@ fn lsp_hover_dependency() { }, "end":{ "line": 3, - "character": 76 + "character": 66 } } })) @@ -955,7 +955,7 @@ fn lsp_hover_dependency() { Some(json!({ "contents": { "kind": "markdown", - "value": "**Resolved Dependency**\n\n**Code**: http​://127.0.0.1:4545/cli/tests/subdir/mod1.ts\n" + "value": "**Resolved Dependency**\n\n**Code**: http​://127.0.0.1:4545/subdir/mod1.ts\n" }, "range": { "start": { @@ -964,7 +964,7 @@ fn lsp_hover_dependency() { }, "end":{ "line": 4, - "character": 66 + "character": 56 } } })) @@ -2713,7 +2713,7 @@ fn lsp_diagnostics_warn() { "uri": "file:///a/file.ts", "languageId": "typescript", "version": 1, - "text": "import * as a from \"http://127.0.0.1:4545/cli/tests/x_deno_warning.js\";\n\nconsole.log(a)\n", + "text": "import * as a from \"http://127.0.0.1:4545/x_deno_warning.js\";\n\nconsole.log(a)\n", }, }), ); @@ -2726,7 +2726,7 @@ fn lsp_diagnostics_warn() { }, "uris": [ { - "uri": "http://127.0.0.1:4545/cli/tests/x_deno_warning.js", + "uri": "http://127.0.0.1:4545/x_deno_warning.js", } ], }), @@ -2755,7 +2755,7 @@ fn lsp_diagnostics_warn() { }, end: lsp::Position { line: 0, - character: 70 + character: 60 } }, severity: Some(lsp::DiagnosticSeverity::Warning), diff --git a/cli/tests/integration/mod.rs b/cli/tests/integration/mod.rs index b8917fc91a..1d6555ff75 100644 --- a/cli/tests/integration/mod.rs +++ b/cli/tests/integration/mod.rs @@ -74,7 +74,7 @@ mod worker; #[test] fn help_flag() { let status = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("--help") .spawn() .unwrap() @@ -86,7 +86,7 @@ fn help_flag() { #[test] fn version_short_flag() { let status = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("-V") .spawn() .unwrap() @@ -98,7 +98,7 @@ fn version_short_flag() { #[test] fn version_long_flag() { let status = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("--version") .spawn() .unwrap() @@ -117,11 +117,10 @@ fn cache_test() { let _g = util::http_server(); let deno_dir = TempDir::new().expect("tempdir fail"); let module_url = - url::Url::parse("http://localhost:4545/cli/tests/006_url_imports.ts") - .unwrap(); + url::Url::parse("http://localhost:4545/006_url_imports.ts").unwrap(); let output = Command::new(util::deno_exe_path()) .env("DENO_DIR", deno_dir.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("cache") .arg("-L") .arg("debug") @@ -141,7 +140,7 @@ fn cache_test() { .env("DENO_DIR", deno_dir.path()) .env("HTTP_PROXY", "http://nil") .env("NO_COLOR", "1") - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(module_url.to_string()) .output() @@ -149,8 +148,7 @@ fn cache_test() { let str_output = std::str::from_utf8(&output.stdout).unwrap(); - let module_output_path = - util::root_path().join("cli/tests/006_url_imports.ts.out"); + let module_output_path = util::testdata_path().join("006_url_imports.ts.out"); let mut module_output = String::new(); let mut module_output_file = fs::File::open(module_output_path).unwrap(); module_output_file @@ -173,7 +171,7 @@ fn cache_invalidation_test() { } let output = Command::new(util::deno_exe_path()) .env("DENO_DIR", deno_dir.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(fixture_path.to_str().unwrap()) .output() @@ -190,7 +188,7 @@ fn cache_invalidation_test() { } let output = Command::new(util::deno_exe_path()) .env("DENO_DIR", deno_dir.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(fixture_path.to_str().unwrap()) .output() @@ -213,7 +211,7 @@ fn cache_invalidation_test_no_check() { } let output = Command::new(util::deno_exe_path()) .env("DENO_DIR", deno_dir.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("--no-check") .arg(fixture_path.to_str().unwrap()) @@ -231,7 +229,7 @@ fn cache_invalidation_test_no_check() { } let output = Command::new(util::deno_exe_path()) .env("DENO_DIR", deno_dir.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("--no-check") .arg(fixture_path.to_str().unwrap()) @@ -269,7 +267,7 @@ fn ts_dependency_recompilation() { .unwrap(); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .env("NO_COLOR", "1") .arg("run") .arg(&ats) @@ -291,7 +289,7 @@ fn ts_dependency_recompilation() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .env("NO_COLOR", "1") .arg("run") .arg(&ats) @@ -312,12 +310,12 @@ fn ts_no_recheck_on_redirect() { let deno_dir = util::new_deno_dir(); let e = util::deno_exe_path(); - let redirect_ts = util::root_path().join("cli/tests/017_import_redirect.ts"); + let redirect_ts = util::testdata_path().join("017_import_redirect.ts"); assert!(redirect_ts.is_file()); let mut cmd = Command::new(e.clone()); cmd.env("DENO_DIR", deno_dir.path()); let mut initial = cmd - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(redirect_ts.clone()) .spawn() @@ -329,7 +327,7 @@ fn ts_no_recheck_on_redirect() { let mut cmd = Command::new(e); cmd.env("DENO_DIR", deno_dir.path()); let output = cmd - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(redirect_ts) .output() @@ -340,12 +338,12 @@ fn ts_no_recheck_on_redirect() { #[test] fn ts_reload() { - let hello_ts = util::root_path().join("cli/tests/002_hello.ts"); + let hello_ts = util::testdata_path().join("002_hello.ts"); assert!(hello_ts.is_file()); let deno_dir = TempDir::new().expect("tempdir fail"); let mut initial = util::deno_cmd_with_deno_dir(deno_dir.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("cache") .arg(&hello_ts) .spawn() @@ -355,7 +353,7 @@ fn ts_reload() { assert!(status_initial.success()); let output = util::deno_cmd_with_deno_dir(deno_dir.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("cache") .arg("--reload") .arg("-L") @@ -391,7 +389,7 @@ console.log("finish"); "#; let mut p = util::deno_cmd() - .current_dir(util::tests_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("-") .stdin(std::process::Stdio::piped()) @@ -411,7 +409,7 @@ console.log("finish"); #[test] fn compiler_api() { let status = util::deno_cmd() - .current_dir(util::tests_path()) + .current_dir(util::testdata_path()) .arg("test") .arg("--unstable") .arg("--reload") @@ -431,7 +429,7 @@ fn broken_stdout() { drop(reader); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("eval") .arg("console.log(3.14)") .stdout(writer) @@ -461,14 +459,14 @@ itest!(cafile_ts_fetch { }); itest!(cafile_eval { - args: "eval --cert tls/RootCA.pem fetch('https://localhost:5545/cli/tests/cafile_ts_fetch.ts.out').then(r=>r.text()).then(t=>console.log(t.trimEnd()))", + args: "eval --cert tls/RootCA.pem fetch('https://localhost:5545/cafile_ts_fetch.ts.out').then(r=>r.text()).then(t=>console.log(t.trimEnd()))", output: "cafile_ts_fetch.ts.out", http_server: true, }); itest!(cafile_info { args: - "info --quiet --cert tls/RootCA.pem https://localhost:5545/cli/tests/cafile_info.ts", + "info --quiet --cert tls/RootCA.pem https://localhost:5545/cafile_info.ts", output: "cafile_info.ts.out", http_server: true, }); @@ -506,13 +504,12 @@ fn cafile_env_fetch() { let _g = util::http_server(); let deno_dir = TempDir::new().expect("tempdir fail"); let module_url = - Url::parse("https://localhost:5545/cli/tests/cafile_url_imports.ts") - .unwrap(); - let cafile = util::root_path().join("cli/tests/tls/RootCA.pem"); + Url::parse("https://localhost:5545/cafile_url_imports.ts").unwrap(); + let cafile = util::testdata_path().join("tls/RootCA.pem"); let output = Command::new(util::deno_exe_path()) .env("DENO_DIR", deno_dir.path()) .env("DENO_CERT", cafile) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("cache") .arg(module_url.to_string()) .output() @@ -526,12 +523,11 @@ fn cafile_fetch() { let _g = util::http_server(); let deno_dir = TempDir::new().expect("tempdir fail"); let module_url = - Url::parse("http://localhost:4545/cli/tests/cafile_url_imports.ts") - .unwrap(); - let cafile = util::root_path().join("cli/tests/tls/RootCA.pem"); + Url::parse("http://localhost:4545/cafile_url_imports.ts").unwrap(); + let cafile = util::testdata_path().join("tls/RootCA.pem"); let output = Command::new(util::deno_exe_path()) .env("DENO_DIR", deno_dir.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("cache") .arg("--cert") .arg(cafile) @@ -550,11 +546,11 @@ fn cafile_install_remote_module() { let bin_dir = temp_dir.path().join("bin"); std::fs::create_dir(&bin_dir).unwrap(); let deno_dir = TempDir::new().expect("tempdir fail"); - let cafile = util::root_path().join("cli/tests/tls/RootCA.pem"); + let cafile = util::testdata_path().join("tls/RootCA.pem"); let install_output = Command::new(util::deno_exe_path()) .env("DENO_DIR", deno_dir.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("install") .arg("--cert") .arg(cafile) @@ -562,7 +558,7 @@ fn cafile_install_remote_module() { .arg(temp_dir.path()) .arg("-n") .arg("echo_test") - .arg("https://localhost:5545/cli/tests/echo.ts") + .arg("https://localhost:5545/echo.ts") .output() .expect("Failed to spawn script"); println!("{}", std::str::from_utf8(&install_output.stdout).unwrap()); @@ -590,12 +586,12 @@ fn cafile_bundle_remote_exports() { let _g = util::http_server(); // First we have to generate a bundle of some remote module that has exports. - let mod1 = "https://localhost:5545/cli/tests/subdir/mod1.ts"; - let cafile = util::root_path().join("cli/tests/tls/RootCA.pem"); + let mod1 = "https://localhost:5545/subdir/mod1.ts"; + let cafile = util::testdata_path().join("tls/RootCA.pem"); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("mod1.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg("--cert") .arg(cafile) @@ -618,7 +614,7 @@ fn cafile_bundle_remote_exports() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -635,8 +631,8 @@ fn cafile_bundle_remote_exports() { fn websocket() { let _g = util::http_server(); - let script = util::tests_path().join("websocket_test.ts"); - let root_ca = util::tests_path().join("tls/RootCA.pem"); + let script = util::testdata_path().join("websocket_test.ts"); + let root_ca = util::testdata_path().join("tls/RootCA.pem"); let status = util::deno_cmd() .arg("test") .arg("--unstable") @@ -656,8 +652,8 @@ fn websocket() { fn websocketstream() { let _g = util::http_server(); - let script = util::tests_path().join("websocketstream_test.ts"); - let root_ca = util::tests_path().join("tls/RootCA.pem"); + let script = util::testdata_path().join("websocketstream_test.ts"); + let root_ca = util::testdata_path().join("tls/RootCA.pem"); let status = util::deno_cmd() .arg("test") .arg("--unstable") @@ -872,7 +868,7 @@ async fn test_resolve_dns() { // Pass: `--allow-net` { let output = util::deno_cmd() - .current_dir(util::tests_path()) + .current_dir(util::testdata_path()) .env("NO_COLOR", "1") .arg("run") .arg("--allow-net") @@ -890,7 +886,7 @@ async fn test_resolve_dns() { assert!(err.starts_with("Check file")); let expected = - std::fs::read_to_string(util::tests_path().join("resolve_dns.ts.out")) + std::fs::read_to_string(util::testdata_path().join("resolve_dns.ts.out")) .unwrap(); assert_eq!(expected, out); } @@ -898,7 +894,7 @@ async fn test_resolve_dns() { // Pass: `--allow-net=127.0.0.1:4553` { let output = util::deno_cmd() - .current_dir(util::tests_path()) + .current_dir(util::testdata_path()) .env("NO_COLOR", "1") .arg("run") .arg("--allow-net=127.0.0.1:4553") @@ -916,7 +912,7 @@ async fn test_resolve_dns() { assert!(err.starts_with("Check file")); let expected = - std::fs::read_to_string(util::tests_path().join("resolve_dns.ts.out")) + std::fs::read_to_string(util::testdata_path().join("resolve_dns.ts.out")) .unwrap(); assert_eq!(expected, out); } @@ -924,7 +920,7 @@ async fn test_resolve_dns() { // Permission error: `--allow-net=deno.land` { let output = util::deno_cmd() - .current_dir(util::tests_path()) + .current_dir(util::testdata_path()) .env("NO_COLOR", "1") .arg("run") .arg("--allow-net=deno.land") @@ -947,7 +943,7 @@ async fn test_resolve_dns() { // Permission error: no permission specified { let output = util::deno_cmd() - .current_dir(util::tests_path()) + .current_dir(util::testdata_path()) .env("NO_COLOR", "1") .arg("run") .arg("--unstable") @@ -1001,7 +997,7 @@ fn js_unit_tests_lint() { let status = util::deno_cmd() .arg("lint") .arg("--unstable") - .arg(util::root_path().join("cli/tests/unit")) + .arg(util::tests_path().join("unit")) .spawn() .unwrap() .wait() @@ -1022,7 +1018,7 @@ fn js_unit_tests() { .arg("--unstable") .arg("--location=http://js-unit-tests/foo/bar") .arg("-A") - .arg("cli/tests/unit") + .arg(util::tests_path().join("unit")) .spawn() .expect("failed to spawn script"); @@ -1038,13 +1034,13 @@ async fn listen_tls_alpn() { LocalSet::new() .run_until(async { let mut child = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("--unstable") .arg("--quiet") .arg("--allow-net") .arg("--allow-read") - .arg("./cli/tests/listen_tls_alpn.ts") + .arg("./listen_tls_alpn.ts") .arg("4504") .stdout(std::process::Stdio::piped()) .spawn() @@ -1057,8 +1053,9 @@ async fn listen_tls_alpn() { assert_eq!(msg, "READY"); let mut cfg = rustls::ClientConfig::new(); - let reader = - &mut BufReader::new(Cursor::new(include_bytes!("../tls/RootCA.crt"))); + let reader = &mut BufReader::new(Cursor::new(include_bytes!( + "../testdata/tls/RootCA.crt" + ))); cfg.root_store.add_pem_file(reader).unwrap(); cfg.alpn_protocols.push("foobar".as_bytes().to_vec()); let cfg = Arc::new(cfg); @@ -1090,13 +1087,13 @@ async fn listen_tls_alpn_fail() { LocalSet::new() .run_until(async { let mut child = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("--unstable") .arg("--quiet") .arg("--allow-net") .arg("--allow-read") - .arg("./cli/tests/listen_tls_alpn.ts") + .arg("./listen_tls_alpn.ts") .arg("4505") .stdout(std::process::Stdio::piped()) .spawn() @@ -1109,8 +1106,9 @@ async fn listen_tls_alpn_fail() { assert_eq!(msg, "READY"); let mut cfg = rustls::ClientConfig::new(); - let reader = - &mut BufReader::new(Cursor::new(include_bytes!("../tls/RootCA.crt"))); + let reader = &mut BufReader::new(Cursor::new(include_bytes!( + "../testdata/tls/RootCA.crt" + ))); cfg.root_store.add_pem_file(reader).unwrap(); cfg.alpn_protocols.push("boofar".as_bytes().to_vec()); let cfg = Arc::new(cfg); diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs index 7ce91d4061..20dfccb7e0 100644 --- a/cli/tests/integration/repl_tests.rs +++ b/cli/tests/integration/repl_tests.rs @@ -549,8 +549,7 @@ fn lexical_scoped_variable() { fn missing_deno_dir() { use std::fs::{read_dir, remove_dir_all}; const DENO_DIR: &str = "nonexistent"; - let test_deno_dir = - util::root_path().join("cli").join("tests").join(DENO_DIR); + let test_deno_dir = test_util::testdata_path().join(DENO_DIR); let (out, err) = util::run_and_collect_output( true, "repl", diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 4ca0616f71..f5ac82e9cf 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -144,7 +144,7 @@ itest!(_033_import_map { itest!(_033_import_map_remote { args: - "run --quiet --reload --import-map=http://127.0.0.1:4545/cli/tests/import_maps/import_map_remote.json --unstable import_maps/test_remote.ts", + "run --quiet --reload --import-map=http://127.0.0.1:4545/import_maps/import_map_remote.json --unstable import_maps/test_remote.ts", output: "033_import_map_remote.out", http_server: true, }); @@ -155,8 +155,7 @@ itest!(_034_onload { }); itest!(_035_cached_only_flag { - args: - "run --reload --cached-only http://127.0.0.1:4545/cli/tests/019_media_types.ts", + args: "run --reload --cached-only http://127.0.0.1:4545/019_media_types.ts", output: "035_cached_only_flag.out", exit_code: 1, http_server: true, @@ -203,8 +202,7 @@ itest!(_048_media_types_jsx { }); itest!(_052_no_remote_flag { - args: - "run --reload --no-remote http://127.0.0.1:4545/cli/tests/019_media_types.ts", + args: "run --reload --no-remote http://127.0.0.1:4545/019_media_types.ts", output: "052_no_remote_flag.out", exit_code: 1, http_server: true, @@ -239,7 +237,7 @@ itest!(_071_location_unset { }); itest!(_072_location_relative_fetch { - args: "run --location http://127.0.0.1:4545/cli/tests/ --allow-net 072_location_relative_fetch.ts", + args: "run --location http://127.0.0.1:4545/ --allow-net 072_location_relative_fetch.ts", output: "072_location_relative_fetch.ts.out", http_server: true, }); @@ -288,18 +286,17 @@ itest!(_082_prepare_stack_trace_throw { fn _083_legacy_external_source_map() { let _g = util::http_server(); let deno_dir = TempDir::new().expect("tempdir fail"); - let module_url = url::Url::parse( - "http://localhost:4545/cli/tests/083_legacy_external_source_map.ts", - ) - .unwrap(); + let module_url = + url::Url::parse("http://localhost:4545/083_legacy_external_source_map.ts") + .unwrap(); // Write a faulty old external source map. let faulty_map_path = deno_dir.path().join("gen/http/localhost_PORT4545/9576bd5febd0587c5c4d88d57cb3ac8ebf2600c529142abe3baa9a751d20c334.js.map"); std::fs::create_dir_all(faulty_map_path.parent().unwrap()) .expect("Failed to create faulty source map dir."); - std::fs::write(faulty_map_path, "{\"version\":3,\"file\":\"\",\"sourceRoot\":\"\",\"sources\":[\"http://localhost:4545/cli/tests/083_legacy_external_source_map.ts\"],\"names\":[],\"mappings\":\";AAAA,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC\"}").expect("Failed to write faulty source map."); + std::fs::write(faulty_map_path, "{\"version\":3,\"file\":\"\",\"sourceRoot\":\"\",\"sources\":[\"http://localhost:4545/083_legacy_external_source_map.ts\"],\"names\":[],\"mappings\":\";AAAA,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC\"}").expect("Failed to write faulty source map."); let output = Command::new(util::deno_exe_path()) .env("DENO_DIR", deno_dir.path()) - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(module_url.to_string()) .output() @@ -394,10 +391,11 @@ itest!(lock_write_fetch { }); itest!(lock_check_ok { - args: "run --lock=lock_check_ok.json http://127.0.0.1:4545/cli/tests/003_relative_import.ts", - output: "003_relative_import.ts.out", - http_server: true, - }); + args: + "run --lock=lock_check_ok.json http://127.0.0.1:4545/003_relative_import.ts", + output: "003_relative_import.ts.out", + http_server: true, +}); itest!(lock_check_ok2 { args: "run --lock=lock_check_ok2.json 019_media_types.ts", @@ -406,14 +404,14 @@ itest!(lock_check_ok2 { }); itest!(lock_dynamic_imports { - args: "run --lock=lock_dynamic_imports.json --allow-read --allow-net http://127.0.0.1:4545/cli/tests/013_dynamic_import.ts", + args: "run --lock=lock_dynamic_imports.json --allow-read --allow-net http://127.0.0.1:4545/013_dynamic_import.ts", output: "lock_dynamic_imports.out", exit_code: 10, http_server: true, }); itest!(lock_check_err { - args: "run --lock=lock_check_err.json http://127.0.0.1:4545/cli/tests/003_relative_import.ts", + args: "run --lock=lock_check_err.json http://127.0.0.1:4545/003_relative_import.ts", output: "lock_check_err.out", exit_code: 10, http_server: true, @@ -452,7 +450,7 @@ itest!(config_types_remote { itest!(empty_typescript { args: "run --reload subdir/empty.ts", - output_str: Some("Check file:[WILDCARD]tests/subdir/empty.ts\n"), + output_str: Some("Check file:[WILDCARD]/subdir/empty.ts\n"), }); itest!(error_001 { @@ -649,14 +647,14 @@ itest!(error_type_definitions { }); itest!(error_local_static_import_from_remote_ts { - args: "run --reload http://localhost:4545/cli/tests/error_local_static_import_from_remote.ts", + args: "run --reload http://localhost:4545/error_local_static_import_from_remote.ts", exit_code: 1, http_server: true, output: "error_local_static_import_from_remote.ts.out", }); itest!(error_local_static_import_from_remote_js { - args: "run --reload http://localhost:4545/cli/tests/error_local_static_import_from_remote.js", + args: "run --reload http://localhost:4545/error_local_static_import_from_remote.js", exit_code: 1, http_server: true, output: "error_local_static_import_from_remote.js.out", @@ -938,14 +936,14 @@ itest!(_053_import_compression { }); itest!(disallow_http_from_https_js { - args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/cli/tests/disallow_http_from_https.js", + args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/disallow_http_from_https.js", output: "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/cli/tests/disallow_http_from_https.ts", + args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/disallow_http_from_https.ts", output: "disallow_http_from_https_ts.out", http_server: true, exit_code: 1, @@ -1175,9 +1173,9 @@ itest!(worker_close_race { #[test] fn no_validate_asm() { let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") - .arg("cli/tests/no_validate_asm.js") + .arg("no_validate_asm.js") .stderr(std::process::Stdio::piped()) .stdout(std::process::Stdio::piped()) .spawn() @@ -1192,10 +1190,10 @@ fn no_validate_asm() { #[test] fn exec_path() { let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("--allow-read") - .arg("cli/tests/exec_path.ts") + .arg("exec_path.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -1223,7 +1221,7 @@ fn run_deno_script_constrained( script_path: std::path::PathBuf, constraints: WinProcConstraints, ) -> Result<(), i64> { - let file_path = "cli/tests/DenoWinRunner.ps1"; + let file_path = "DenoWinRunner.ps1"; let constraints = match constraints { WinProcConstraints::NoStdIn => "1", WinProcConstraints::NoStdOut => "2", @@ -1244,7 +1242,7 @@ fn run_deno_script_constrained( #[test] fn should_not_panic_on_no_stdin() { let output = run_deno_script_constrained( - util::tests_path().join("echo.ts"), + util::testdata_path().join("echo.ts"), WinProcConstraints::NoStdIn, ); output.unwrap(); @@ -1254,7 +1252,7 @@ fn should_not_panic_on_no_stdin() { #[test] fn should_not_panic_on_no_stdout() { let output = run_deno_script_constrained( - util::tests_path().join("echo.ts"), + util::testdata_path().join("echo.ts"), WinProcConstraints::NoStdOut, ); output.unwrap(); @@ -1264,7 +1262,7 @@ fn should_not_panic_on_no_stdout() { #[test] fn should_not_panic_on_no_stderr() { let output = run_deno_script_constrained( - util::tests_path().join("echo.ts"), + util::testdata_path().join("echo.ts"), WinProcConstraints::NoStdErr, ); output.unwrap(); @@ -1274,9 +1272,9 @@ fn should_not_panic_on_no_stderr() { #[test] fn should_not_panic_on_undefined_home_environment_variable() { let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") - .arg("cli/tests/echo.ts") + .arg("echo.ts") .env_remove("HOME") .spawn() .unwrap() @@ -1288,9 +1286,9 @@ fn should_not_panic_on_undefined_home_environment_variable() { #[test] fn should_not_panic_on_undefined_deno_dir_environment_variable() { let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") - .arg("cli/tests/echo.ts") + .arg("echo.ts") .env_remove("DENO_DIR") .spawn() .unwrap() @@ -1303,9 +1301,9 @@ fn should_not_panic_on_undefined_deno_dir_environment_variable() { #[test] fn should_not_panic_on_undefined_deno_dir_and_home_environment_variables() { let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") - .arg("cli/tests/echo.ts") + .arg("echo.ts") .env_remove("DENO_DIR") .env_remove("HOME") .spawn() @@ -1319,9 +1317,9 @@ fn should_not_panic_on_undefined_deno_dir_and_home_environment_variables() { fn rust_log() { // Without RUST_LOG the stderr is empty. let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") - .arg("cli/tests/001_hello.js") + .arg("001_hello.js") .stderr(std::process::Stdio::piped()) .spawn() .unwrap() @@ -1332,9 +1330,9 @@ fn rust_log() { // With RUST_LOG the stderr is not empty. let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") - .arg("cli/tests/001_hello.js") + .arg("001_hello.js") .env("RUST_LOG", "debug") .stderr(std::process::Stdio::piped()) .spawn() @@ -1352,7 +1350,7 @@ mod permissions { fn with_allow() { for permission in &util::PERMISSION_VARIANTS { let status = util::deno_cmd() - .current_dir(&util::tests_path()) + .current_dir(&util::testdata_path()) .arg("run") .arg(format!("--allow-{0}", permission)) .arg("permission_test.ts") @@ -1384,12 +1382,15 @@ mod permissions { const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"]; for permission in &PERMISSION_VARIANTS { let status = util::deno_cmd() - .current_dir(&util::tests_path()) + .current_dir(&util::testdata_path()) .arg("run") .arg(format!( "--allow-{0}={1}", permission, - util::root_path().into_os_string().into_string().unwrap() + util::testdata_path() + .into_os_string() + .into_string() + .unwrap() )) .arg("complex_permissions_test.ts") .arg(permission) @@ -1411,9 +1412,7 @@ mod permissions { &format!( "run --allow-{0}={1} complex_permissions_test.ts {0} {2}", permission, - util::root_path() - .join("cli") - .join("tests") + util::testdata_path() .into_os_string() .into_string() .unwrap(), @@ -1436,14 +1435,12 @@ mod permissions { const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"]; for permission in &PERMISSION_VARIANTS { let status = util::deno_cmd() - .current_dir(&util::tests_path()) + .current_dir(&util::testdata_path()) .arg("run") .arg(format!( "--allow-{0}={1}", permission, - util::root_path() - .join("cli") - .join("tests") + util::testdata_path() .into_os_string() .into_string() .unwrap() @@ -1462,9 +1459,7 @@ mod permissions { #[test] fn rw_outside_test_and_js_dir() { const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"]; - let test_dir = util::root_path() - .join("cli") - .join("tests") + let test_dir = util::testdata_path() .into_os_string() .into_string() .unwrap(); @@ -1498,9 +1493,7 @@ mod permissions { #[test] fn rw_inside_test_and_js_dir() { const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"]; - let test_dir = util::root_path() - .join("cli") - .join("tests") + let test_dir = util::testdata_path() .into_os_string() .into_string() .unwrap(); @@ -1511,7 +1504,7 @@ mod permissions { .unwrap(); for permission in &PERMISSION_VARIANTS { let status = util::deno_cmd() - .current_dir(&util::tests_path()) + .current_dir(&util::testdata_path()) .arg("run") .arg(format!("--allow-{0}={1},{2}", permission, test_dir, js_dir)) .arg("complex_permissions_test.ts") @@ -1530,7 +1523,7 @@ mod permissions { const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"]; for permission in &PERMISSION_VARIANTS { let status = util::deno_cmd() - .current_dir(&util::tests_path()) + .current_dir(&util::testdata_path()) .arg("run") .arg(format!("--allow-{0}=.", permission)) .arg("complex_permissions_test.ts") @@ -1549,7 +1542,7 @@ mod permissions { const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"]; for permission in &PERMISSION_VARIANTS { let status = util::deno_cmd() - .current_dir(&util::tests_path()) + .current_dir(&util::testdata_path()) .arg("run") .arg(format!("--allow-{0}=tls/../", permission)) .arg("complex_permissions_test.ts") diff --git a/cli/tests/integration/watcher_tests.rs b/cli/tests/integration/watcher_tests.rs index ed574a0bf1..8b03ae470d 100644 --- a/cli/tests/integration/watcher_tests.rs +++ b/cli/tests/integration/watcher_tests.rs @@ -50,15 +50,15 @@ fn wait_for_process_failed( #[test] fn fmt_watch_test() { let t = TempDir::new().expect("tempdir fail"); - let fixed = util::root_path().join("cli/tests/badly_formatted_fixed.js"); + let fixed = util::testdata_path().join("badly_formatted_fixed.js"); let badly_formatted_original = - util::root_path().join("cli/tests/badly_formatted.mjs"); + util::testdata_path().join("badly_formatted.mjs"); let badly_formatted = t.path().join("badly_formatted.js"); std::fs::copy(&badly_formatted_original, &badly_formatted) .expect("Failed to copy file"); let mut child = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("fmt") .arg(&badly_formatted) .arg("--watch") @@ -109,7 +109,7 @@ fn bundle_js_watch() { let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("mod6.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(&file_to_watch) .arg(&bundle) @@ -173,7 +173,7 @@ fn bundle_watch_not_exit() { let target_file = t.path().join("target.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(&file_to_watch) .arg(&target_file) @@ -224,7 +224,7 @@ fn run_watch() { .expect("error writing file"); let mut child = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("--watch") .arg("--unstable") @@ -330,7 +330,7 @@ fn run_watch_not_exit() { .expect("error writing file"); let mut child = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("--watch") .arg("--unstable") @@ -377,14 +377,14 @@ fn run_watch_with_import_map_and_relative_paths() { let absolute_path = directory.path().join(filename); std::fs::write(&absolute_path, filecontent).expect("error writing file"); let relative_path = absolute_path - .strip_prefix(util::root_path()) + .strip_prefix(util::testdata_path()) .expect("unable to create relative temporary file") .to_owned(); assert!(relative_path.is_relative()); relative_path } let temp_directory = - TempDir::new_in(util::root_path()).expect("tempdir fail"); + TempDir::new_in(util::testdata_path()).expect("tempdir fail"); let file_to_watch = create_relative_tmp_file( &temp_directory, "file_to_watch.js", @@ -397,7 +397,7 @@ fn run_watch_with_import_map_and_relative_paths() { ); let mut child = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("--unstable") .arg("--watch") @@ -443,7 +443,7 @@ fn test_watch() { let t = TempDir::new().expect("tempdir fail"); let mut child = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("test") .arg("--watch") .arg("--unstable") @@ -612,7 +612,7 @@ fn test_watch_doc() { let t = TempDir::new().expect("tempdir fail"); let mut child = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("test") .arg("--watch") .arg("--doc") diff --git a/cli/tests/integration/worker_tests.rs b/cli/tests/integration/worker_tests.rs index 2340fa705a..c158776ee0 100644 --- a/cli/tests/integration/worker_tests.rs +++ b/cli/tests/integration/worker_tests.rs @@ -3,7 +3,7 @@ use crate::itest; itest!(workers { - args: "test --reload --location http://127.0.0.1:4545/cli/tests/ --allow-net --allow-read --unstable workers/test.ts", + args: "test --reload --location http://127.0.0.1:4545/ --allow-net --allow-read --unstable workers/test.ts", output: "workers/test.ts.out", http_server: true, }); diff --git a/cli/tests/localhost_unsafe_ssl.ts.out b/cli/tests/localhost_unsafe_ssl.ts.out deleted file mode 100644 index 9ea991a64d..0000000000 --- a/cli/tests/localhost_unsafe_ssl.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -DANGER: TLS certificate validation is disabled for: deno.land -error: error sending request for url (https://localhost:5545/cli/tests/subdir/mod2.ts): error trying to connect: invalid certificate: UnknownIssuer - at [WILDCARD]tests/cafile_url_imports.ts:1:0 diff --git a/cli/tests/lock_check_err.json b/cli/tests/lock_check_err.json deleted file mode 100644 index 0a1380dfcf..0000000000 --- a/cli/tests/lock_check_err.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "http://127.0.0.1:4545/cli/tests/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", - "http://127.0.0.1:4545/cli/tests/003_relative_import.ts": "bad" -} diff --git a/cli/tests/lock_check_err2.json b/cli/tests/lock_check_err2.json deleted file mode 100644 index b26c1f0aec..0000000000 --- a/cli/tests/lock_check_err2.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "http://localhost:4545/cli/tests/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_text_ecmascript.j3.js": "bad", - "http://localhost:4545/cli/tests/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" -} diff --git a/cli/tests/lock_check_err_with_bundle.json b/cli/tests/lock_check_err_with_bundle.json deleted file mode 100644 index 9c6a2e5f6b..0000000000 --- a/cli/tests/lock_check_err_with_bundle.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "http://127.0.0.1:4545/cli/tests/subdir/mod1.ts": "bfc1037b02c99abc20367f739bca7455813a5950066abd77965bff33b6eece0f", - "http://127.0.0.1:4545/cli/tests/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", - "http://127.0.0.1:4545/cli/tests/subdir/subdir2/mod2.ts": "bad" -} diff --git a/cli/tests/lock_check_ok.json b/cli/tests/lock_check_ok.json deleted file mode 100644 index e0ee0a17ef..0000000000 --- a/cli/tests/lock_check_ok.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "http://127.0.0.1:4545/cli/tests/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", - "http://127.0.0.1:4545/cli/tests/003_relative_import.ts": "aa9e16de824f81871a1c7164d5bd6857df7db2e18621750bd66b0bde4df07f21" -} diff --git a/cli/tests/lock_check_ok2.json b/cli/tests/lock_check_ok2.json deleted file mode 100644 index 38b450f865..0000000000 --- a/cli/tests/lock_check_ok2.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "http://localhost:4545/cli/tests/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_text_ecmascript.j3.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", - "http://localhost:4545/cli/tests/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" -} diff --git a/cli/tests/lock_dynamic_imports.json b/cli/tests/lock_dynamic_imports.json deleted file mode 100644 index fb822f64e2..0000000000 --- a/cli/tests/lock_dynamic_imports.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "http://127.0.0.1:4545/cli/tests/013_dynamic_import.ts": "f0d2d108c100e769cda9f26b74326f21e44cab81611aa7f6cd2b731d4cbc1995", - "http://127.0.0.1:4545/cli/tests/subdir/mod1.ts": "bfc1037b02c99abc20367f739bca7455813a5950066abd77965bff33b6eece0f", - "http://127.0.0.1:4545/cli/tests/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", - "http://127.0.0.1:4545/cli/tests/subdir/subdir2/mod2.ts": "bad" -} diff --git a/cli/tests/lsp/did_open_params_import_hover.json b/cli/tests/lsp/did_open_params_import_hover.json deleted file mode 100644 index 260e304d1a..0000000000 --- a/cli/tests/lsp/did_open_params_import_hover.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "textDocument": { - "uri": "file:///a/file.ts", - "languageId": "typescript", - "version": 1, - "text": "import * as a from \"http://127.0.0.1:4545/xTypeScriptTypes.js\";\n// @deno-types=\"http://127.0.0.1:4545/cli/tests/type_definitions/foo.d.ts\"\nimport * as b from \"http://127.0.0.1:4545/cli/tests/type_definitions/foo.js\";\nimport * as c from \"http://127.0.0.1:4545/cli/tests/subdir/type_reference.js\";\nimport * as d from \"http://127.0.0.1:4545/cli/tests/subdir/mod1.ts\";\nimport * as e from \"data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo=\";\nimport * as f from \"./file_01.ts\";\n\nconsole.log(a, b, c, d, e, f);\n" - } -} diff --git a/cli/tests/lsp/did_open_params_large.json b/cli/tests/lsp/did_open_params_large.json deleted file mode 100644 index b78d6e799e..0000000000 --- a/cli/tests/lsp/did_open_params_large.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "textDocument": { - "uri": "file:///a/file.ts", - "languageId": "javascript", - "version": 1, - "text": "// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.\n\n// @ts-check\n/// \n// deno-lint-ignore-file no-undef\n\n// This module is the entry point for \"compiler\" isolate, ie. the one\n// that is created when Deno needs to type check TypeScript, and in some\n// instances convert TypeScript to JavaScript.\n\n// Removes the `__proto__` for security reasons. This intentionally makes\n// Deno non compliant with ECMA-262 Annex B.2.2.1\ndelete Object.prototype.__proto__;\n\n((window) => {\n /** @type {DenoCore} */\n const core = window.Deno.core;\n\n let logDebug = false;\n let logSource = \"JS\";\n\n function setLogDebug(debug, source) {\n logDebug = debug;\n if (source) {\n logSource = source;\n }\n }\n\n function debug(...args) {\n if (logDebug) {\n const stringifiedArgs = args.map((arg) =>\n typeof arg === \"string\" ? arg : JSON.stringify(arg)\n ).join(\" \");\n // adding a non-zero integer value to the end of the debug string causes\n // the message to be printed to stderr instead of stdout, which is better\n // aligned to the behaviour of debug messages\n core.print(`DEBUG ${logSource} - ${stringifiedArgs}\\n`, 1);\n }\n }\n\n function error(...args) {\n const stringifiedArgs = args.map((arg) =>\n typeof arg === \"string\" || arg instanceof Error\n ? String(arg)\n : JSON.stringify(arg)\n ).join(\" \");\n core.print(`ERROR ${logSource} = ${stringifiedArgs}\\n`, 1);\n }\n\n class AssertionError extends Error {\n constructor(msg) {\n super(msg);\n this.name = \"AssertionError\";\n }\n }\n\n function assert(cond, msg = \"Assertion failed.\") {\n if (!cond) {\n throw new AssertionError(msg);\n }\n }\n\n /** @type {Map} */\n const sourceFileCache = new Map();\n\n /** @param {ts.DiagnosticRelatedInformation} diagnostic */\n function fromRelatedInformation({\n start,\n length,\n file,\n messageText: msgText,\n ...ri\n }) {\n let messageText;\n let messageChain;\n if (typeof msgText === \"object\") {\n messageChain = msgText;\n } else {\n messageText = msgText;\n }\n if (start !== undefined && length !== undefined && file) {\n const startPos = file.getLineAndCharacterOfPosition(start);\n const sourceLine = file.getFullText().split(\"\\n\")[startPos.line];\n const fileName = file.fileName;\n return {\n start: startPos,\n end: file.getLineAndCharacterOfPosition(start + length),\n fileName,\n messageChain,\n messageText,\n sourceLine,\n ...ri,\n };\n } else {\n return {\n messageChain,\n messageText,\n ...ri,\n };\n }\n }\n\n /** @param {ts.Diagnostic[]} diagnostics */\n function fromTypeScriptDiagnostic(diagnostics) {\n return diagnostics.map(({ relatedInformation: ri, source, ...diag }) => {\n /** @type {any} */\n const value = fromRelatedInformation(diag);\n value.relatedInformation = ri\n ? ri.map(fromRelatedInformation)\n : undefined;\n value.source = source;\n return value;\n });\n }\n\n // Using incremental compile APIs requires that all\n // paths must be either relative or absolute. Since\n // analysis in Rust operates on fully resolved URLs,\n // it makes sense to use the same scheme here.\n const ASSETS = \"asset:///\";\n const CACHE = \"cache:///\";\n\n /** Diagnostics that are intentionally ignored when compiling TypeScript in\n * Deno, as they provide misleading or incorrect information. */\n const IGNORED_DIAGNOSTICS = [\n // TS1208: All files must be modules when the '--isolatedModules' flag is\n // provided. We can ignore because we guarantee that all files are\n // modules.\n 1208,\n // TS1375: 'await' expressions are only allowed at the top level of a file\n // when that file is a module, but this file has no imports or exports.\n // Consider adding an empty 'export {}' to make this file a module.\n 1375,\n // TS1103: 'for-await-of' statement is only allowed within an async function\n // or async generator.\n 1103,\n // TS2306: File 'file:///Users/rld/src/deno/cli/tests/subdir/amd_like.js' is\n // not a module.\n 2306,\n // TS2691: An import path cannot end with a '.ts' extension. Consider\n // importing 'bad-module' instead.\n 2691,\n // TS2792: Cannot find module. Did you mean to set the 'moduleResolution'\n // option to 'node', or to add aliases to the 'paths' option?\n 2792,\n // TS5009: Cannot find the common subdirectory path for the input files.\n 5009,\n // TS5055: Cannot write file\n // 'http://localhost:4545/cli/tests/subdir/mt_application_x_javascript.j4.js'\n // because it would overwrite input file.\n 5055,\n // TypeScript is overly opinionated that only CommonJS modules kinds can\n // support JSON imports. Allegedly this was fixed in\n // Microsoft/TypeScript#26825 but that doesn't seem to be working here,\n // so we will ignore complaints about this compiler setting.\n 5070,\n // TS7016: Could not find a declaration file for module '...'. '...'\n // implicitly has an 'any' type. This is due to `allowJs` being off by\n // default but importing of a JavaScript module.\n 7016,\n ];\n\n const SNAPSHOT_COMPILE_OPTIONS = {\n esModuleInterop: true,\n jsx: ts.JsxEmit.React,\n module: ts.ModuleKind.ESNext,\n noEmit: true,\n strict: true,\n target: ts.ScriptTarget.ESNext,\n };\n\n class ScriptSnapshot {\n /** @type {string} */\n specifier;\n /** @type {string} */\n version;\n /**\n * @param {string} specifier\n * @param {string} version \n */\n constructor(specifier, version) {\n this.specifier = specifier;\n this.version = version;\n }\n /**\n * @param {number} start \n * @param {number} end \n * @returns {string}\n */\n getText(start, end) {\n const { specifier, version } = this;\n debug(\n `snapshot.getText(${start}, ${end}) specifier: ${specifier} version: ${version}`,\n );\n return core.jsonOpSync(\"op_get_text\", { specifier, version, start, end });\n }\n /**\n * @returns {number}\n */\n getLength() {\n const { specifier, version } = this;\n debug(`snapshot.getLength() specifier: ${specifier} version: ${version}`);\n return core.jsonOpSync(\"op_get_length\", { specifier, version });\n }\n /**\n * @param {ScriptSnapshot} oldSnapshot\n * @returns {ts.TextChangeRange | undefined}\n */\n getChangeRange(oldSnapshot) {\n const { specifier, version } = this;\n const { version: oldVersion } = oldSnapshot;\n const oldLength = oldSnapshot.getLength();\n debug(\n `snapshot.getLength() specifier: ${specifier} oldVersion: ${oldVersion} version: ${version}`,\n );\n return core.jsonOpSync(\n \"op_get_change_range\",\n { specifier, oldLength, oldVersion, version },\n );\n }\n dispose() {\n const { specifier, version } = this;\n debug(`snapshot.dispose() specifier: ${specifier} version: ${version}`);\n core.jsonOpSync(\"op_dispose\", { specifier, version });\n }\n }\n\n /** @type {ts.CompilerOptions} */\n let compilationSettings = {};\n\n /** @type {ts.LanguageService} */\n let languageService;\n\n /** An object literal of the incremental compiler host, which provides the\n * specific \"bindings\" to the Deno environment that tsc needs to work.\n *\n * @type {ts.CompilerHost & ts.LanguageServiceHost} */\n const host = {\n fileExists(fileName) {\n debug(`host.fileExists(\"${fileName}\")`);\n return false;\n },\n readFile(specifier) {\n debug(`host.readFile(\"${specifier}\")`);\n return core.jsonOpSync(\"op_load\", { specifier }).data;\n },\n getSourceFile(\n specifier,\n languageVersion,\n _onError,\n _shouldCreateNewSourceFile,\n ) {\n debug(\n `host.getSourceFile(\"${specifier}\", ${\n ts.ScriptTarget[languageVersion]\n })`,\n );\n let sourceFile = sourceFileCache.get(specifier);\n if (sourceFile) {\n return sourceFile;\n }\n\n /** @type {{ data: string; hash?: string; scriptKind: ts.ScriptKind }} */\n const { data, hash, scriptKind } = core.jsonOpSync(\n \"op_load\",\n { specifier },\n );\n assert(\n data != null,\n `\"data\" is unexpectedly null for \"${specifier}\".`,\n );\n sourceFile = ts.createSourceFile(\n specifier,\n data,\n languageVersion,\n false,\n scriptKind,\n );\n sourceFile.moduleName = specifier;\n sourceFile.version = hash;\n sourceFileCache.set(specifier, sourceFile);\n return sourceFile;\n },\n getDefaultLibFileName() {\n return `${ASSETS}/lib.esnext.d.ts`;\n },\n getDefaultLibLocation() {\n return ASSETS;\n },\n writeFile(fileName, data, _writeByteOrderMark, _onError, sourceFiles) {\n debug(`host.writeFile(\"${fileName}\")`);\n let maybeSpecifiers;\n if (sourceFiles) {\n maybeSpecifiers = sourceFiles.map((sf) => sf.moduleName);\n }\n return core.jsonOpSync(\n \"op_emit\",\n { maybeSpecifiers, fileName, data },\n );\n },\n getCurrentDirectory() {\n return CACHE;\n },\n getCanonicalFileName(fileName) {\n return fileName;\n },\n useCaseSensitiveFileNames() {\n return true;\n },\n getNewLine() {\n return \"\\n\";\n },\n resolveModuleNames(specifiers, base) {\n debug(`host.resolveModuleNames()`);\n debug(` base: ${base}`);\n debug(` specifiers: ${specifiers.join(\", \")}`);\n /** @type {Array<[string, ts.Extension] | undefined>} */\n const resolved = core.jsonOpSync(\"op_resolve\", {\n specifiers,\n base,\n });\n if (resolved) {\n const result = resolved.map((item) => {\n if (item) {\n const [resolvedFileName, extension] = item;\n return {\n resolvedFileName,\n extension,\n isExternalLibraryImport: false,\n };\n }\n return undefined;\n });\n result.length = specifiers.length;\n return result;\n } else {\n return new Array(specifiers.length);\n }\n },\n createHash(data) {\n return core.jsonOpSync(\"op_create_hash\", { data }).hash;\n },\n\n // LanguageServiceHost\n getCompilationSettings() {\n debug(\"host.getCompilationSettings()\");\n return compilationSettings;\n },\n getScriptFileNames() {\n debug(\"host.getScriptFileNames()\");\n return core.jsonOpSync(\"op_script_names\", undefined);\n },\n getScriptVersion(specifier) {\n debug(`host.getScriptVersion(\"${specifier}\")`);\n const sourceFile = sourceFileCache.get(specifier);\n if (sourceFile) {\n return sourceFile.version ?? \"1\";\n }\n return core.jsonOpSync(\"op_script_version\", { specifier });\n },\n getScriptSnapshot(specifier) {\n debug(`host.getScriptSnapshot(\"${specifier}\")`);\n const sourceFile = sourceFileCache.get(specifier);\n if (sourceFile) {\n return {\n getText(start, end) {\n return sourceFile.text.substring(start, end);\n },\n getLength() {\n return sourceFile.text.length;\n },\n getChangeRange() {\n return undefined;\n },\n };\n }\n /** @type {string | undefined} */\n const version = core.jsonOpSync(\"op_script_version\", { specifier });\n if (version != null) {\n return new ScriptSnapshot(specifier, version);\n }\n return undefined;\n },\n };\n\n /** @type {Array<[string, number]>} */\n const stats = [];\n let statsStart = 0;\n\n function performanceStart() {\n stats.length = 0;\n statsStart = Date.now();\n ts.performance.enable();\n }\n\n /**\n * @param {{ program: ts.Program | ts.EmitAndSemanticDiagnosticsBuilderProgram, fileCount?: number }} options \n */\n function performanceProgram({ program, fileCount }) {\n if (program) {\n if (\"getProgram\" in program) {\n program = program.getProgram();\n }\n stats.push([\"Files\", program.getSourceFiles().length]);\n stats.push([\"Nodes\", program.getNodeCount()]);\n stats.push([\"Identifiers\", program.getIdentifierCount()]);\n stats.push([\"Symbols\", program.getSymbolCount()]);\n stats.push([\"Types\", program.getTypeCount()]);\n stats.push([\"Instantiations\", program.getInstantiationCount()]);\n } else if (fileCount != null) {\n stats.push([\"Files\", fileCount]);\n }\n const programTime = ts.performance.getDuration(\"Program\");\n const bindTime = ts.performance.getDuration(\"Bind\");\n const checkTime = ts.performance.getDuration(\"Check\");\n const emitTime = ts.performance.getDuration(\"Emit\");\n stats.push([\"Parse time\", programTime]);\n stats.push([\"Bind time\", bindTime]);\n stats.push([\"Check time\", checkTime]);\n stats.push([\"Emit time\", emitTime]);\n stats.push(\n [\"Total TS time\", programTime + bindTime + checkTime + emitTime],\n );\n }\n\n function performanceEnd() {\n const duration = Date.now() - statsStart;\n stats.push([\"Compile time\", duration]);\n return stats;\n }\n\n /**\n * @typedef {object} Request\n * @property {Record} config\n * @property {boolean} debug\n * @property {string[]} rootNames\n */\n\n /** The API that is called by Rust when executing a request.\n * @param {Request} request\n */\n function exec({ config, debug: debugFlag, rootNames }) {\n setLogDebug(debugFlag, \"TS\");\n performanceStart();\n debug(\">>> exec start\", { rootNames });\n debug(config);\n\n const { options, errors: configFileParsingDiagnostics } = ts\n .convertCompilerOptionsFromJson(config, \"\");\n // The `allowNonTsExtensions` is a \"hidden\" compiler option used in VSCode\n // which is not allowed to be passed in JSON, we need it to allow special\n // URLs which Deno supports. So we need to either ignore the diagnostic, or\n // inject it ourselves.\n Object.assign(options, { allowNonTsExtensions: true });\n const program = ts.createIncrementalProgram({\n rootNames,\n options,\n host,\n configFileParsingDiagnostics,\n });\n\n const { diagnostics: emitDiagnostics } = program.emit();\n\n const diagnostics = [\n ...program.getConfigFileParsingDiagnostics(),\n ...program.getSyntacticDiagnostics(),\n ...program.getOptionsDiagnostics(),\n ...program.getGlobalDiagnostics(),\n ...program.getSemanticDiagnostics(),\n ...emitDiagnostics,\n ].filter(({ code }) => !IGNORED_DIAGNOSTICS.includes(code));\n performanceProgram({ program });\n\n core.jsonOpSync(\"op_respond\", {\n diagnostics: fromTypeScriptDiagnostic(diagnostics),\n stats: performanceEnd(),\n });\n debug(\"<<< exec stop\");\n }\n\n /**\n * @param {number} id \n * @param {any} data \n */\n function respond(id, data = null) {\n core.jsonOpSync(\"op_respond\", { id, data });\n }\n\n /**\n * @param {LanguageServerRequest} request \n */\n function serverRequest({ id, ...request }) {\n debug(`serverRequest()`, { id, ...request });\n switch (request.method) {\n case \"configure\": {\n const { options, errors } = ts\n .convertCompilerOptionsFromJson(request.compilerOptions, \"\");\n Object.assign(options, { allowNonTsExtensions: true });\n if (errors.length) {\n debug(ts.formatDiagnostics(errors, host));\n }\n compilationSettings = options;\n return respond(id, true);\n }\n case \"getAsset\": {\n const sourceFile = host.getSourceFile(\n request.specifier,\n ts.ScriptTarget.ESNext,\n );\n return respond(id, sourceFile && sourceFile.text);\n }\n case \"getDiagnostics\": {\n try {\n /** @type {Record} */\n const diagnosticMap = {};\n for (const specifier of request.specifiers) {\n diagnosticMap[specifier] = fromTypeScriptDiagnostic([\n ...languageService.getSemanticDiagnostics(specifier),\n ...languageService.getSuggestionDiagnostics(specifier),\n ...languageService.getSyntacticDiagnostics(specifier),\n ].filter(({ code }) => !IGNORED_DIAGNOSTICS.includes(code)));\n }\n return respond(id, diagnosticMap);\n } catch (e) {\n if (\"stack\" in e) {\n error(e.stack);\n } else {\n error(e);\n }\n return respond(id, {});\n }\n }\n case \"getQuickInfo\": {\n return respond(\n id,\n languageService.getQuickInfoAtPosition(\n request.specifier,\n request.position,\n ),\n );\n }\n case \"getCompletions\": {\n return respond(\n id,\n languageService.getCompletionsAtPosition(\n request.specifier,\n request.position,\n request.preferences,\n ),\n );\n }\n case \"getDocumentHighlights\": {\n return respond(\n id,\n languageService.getDocumentHighlights(\n request.specifier,\n request.position,\n request.filesToSearch,\n ),\n );\n }\n case \"getReferences\": {\n return respond(\n id,\n languageService.getReferencesAtPosition(\n request.specifier,\n request.position,\n ),\n );\n }\n case \"getDefinition\": {\n return respond(\n id,\n languageService.getDefinitionAndBoundSpan(\n request.specifier,\n request.position,\n ),\n );\n }\n case \"getImplementation\": {\n return respond(\n id,\n languageService.getImplementationAtPosition(\n request.specifier,\n request.position,\n ),\n );\n }\n case \"findRenameLocations\": {\n return respond(\n id,\n languageService.findRenameLocations(\n request.specifier,\n request.position,\n request.findInStrings,\n request.findInComments,\n request.providePrefixAndSuffixTextForRename,\n ),\n );\n }\n default:\n throw new TypeError(\n // @ts-ignore exhausted case statement sets type to never\n `Invalid request method for request: \"${request.method}\" (${id})`,\n );\n }\n }\n\n /** @param {{ debug: boolean; }} init */\n function serverInit({ debug: debugFlag }) {\n if (hasStarted) {\n throw new Error(\"The language server has already been initialized.\");\n }\n hasStarted = true;\n languageService = ts.createLanguageService(host);\n core.ops();\n setLogDebug(debugFlag, \"TSLS\");\n debug(\"serverInit()\");\n }\n\n let hasStarted = false;\n\n /** Startup the runtime environment, setting various flags.\n * @param {{ debugFlag?: boolean; legacyFlag?: boolean; }} msg\n */\n function startup({ debugFlag = false }) {\n if (hasStarted) {\n throw new Error(\"The compiler runtime already started.\");\n }\n hasStarted = true;\n core.ops();\n setLogDebug(!!debugFlag, \"TS\");\n }\n\n // Setup the compiler runtime during the build process.\n core.ops();\n core.registerErrorClass(\"Error\", Error);\n\n // A build time only op that provides some setup information that is used to\n // ensure the snapshot is setup properly.\n /** @type {{ buildSpecifier: string; libs: string[] }} */\n const { buildSpecifier, libs } = core.jsonOpSync(\"op_build_info\", {});\n for (const lib of libs) {\n const specifier = `lib.${lib}.d.ts`;\n // we are using internal APIs here to \"inject\" our custom libraries into\n // tsc, so things like `\"lib\": [ \"deno.ns\" ]` are supported.\n if (!ts.libs.includes(lib)) {\n ts.libs.push(lib);\n ts.libMap.set(lib, `lib.${lib}.d.ts`);\n }\n // we are caching in memory common type libraries that will be re-used by\n // tsc on when the snapshot is restored\n assert(\n host.getSourceFile(`${ASSETS}${specifier}`, ts.ScriptTarget.ESNext),\n );\n }\n // this helps ensure as much as possible is in memory that is re-usable\n // before the snapshotting is done, which helps unsure fast \"startup\" for\n // subsequent uses of tsc in Deno.\n const TS_SNAPSHOT_PROGRAM = ts.createProgram({\n rootNames: [buildSpecifier],\n options: SNAPSHOT_COMPILE_OPTIONS,\n host,\n });\n ts.getPreEmitDiagnostics(TS_SNAPSHOT_PROGRAM);\n\n // exposes the two functions that are called by `tsc::exec()` when type\n // checking TypeScript.\n globalThis.startup = startup;\n globalThis.exec = exec;\n\n // exposes the functions that are called when the compiler is used as a\n // language service.\n globalThis.serverInit = serverInit;\n globalThis.serverRequest = serverRequest;\n})(this);\n" - } -} diff --git a/cli/tests/main_module.ts.out b/cli/tests/main_module.ts.out deleted file mode 100644 index 31adb20cba..0000000000 --- a/cli/tests/main_module.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -main_module2 [WILDCARD]tests/main_module.ts -main_module [WILDCARD]tests/main_module.ts diff --git a/cli/tests/redirect_cache.out b/cli/tests/redirect_cache.out deleted file mode 100644 index 609e523f7f..0000000000 --- a/cli/tests/redirect_cache.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://localhost:4548/cli/tests/subdir/redirects/a.ts -Download http://localhost:4546/cli/tests/subdir/redirects/a.ts -Download http://localhost:4545/cli/tests/subdir/redirects/a.ts -Download http://localhost:4545/cli/tests/subdir/redirects/b.ts -Check http://localhost:4548/cli/tests/subdir/redirects/a.ts diff --git a/cli/tests/reference_types_remote.ts b/cli/tests/reference_types_remote.ts deleted file mode 100644 index 2e7a80098c..0000000000 --- a/cli/tests/reference_types_remote.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// - -console.log(globalThis.a); diff --git a/cli/tests/001_hello.js b/cli/tests/testdata/001_hello.js similarity index 100% rename from cli/tests/001_hello.js rename to cli/tests/testdata/001_hello.js diff --git a/cli/tests/001_hello.js.out b/cli/tests/testdata/001_hello.js.out similarity index 100% rename from cli/tests/001_hello.js.out rename to cli/tests/testdata/001_hello.js.out diff --git a/cli/tests/002_hello.ts b/cli/tests/testdata/002_hello.ts similarity index 100% rename from cli/tests/002_hello.ts rename to cli/tests/testdata/002_hello.ts diff --git a/cli/tests/002_hello.ts.out b/cli/tests/testdata/002_hello.ts.out similarity index 100% rename from cli/tests/002_hello.ts.out rename to cli/tests/testdata/002_hello.ts.out diff --git a/cli/tests/003_relative_import.ts b/cli/tests/testdata/003_relative_import.ts similarity index 100% rename from cli/tests/003_relative_import.ts rename to cli/tests/testdata/003_relative_import.ts diff --git a/cli/tests/003_relative_import.ts.out b/cli/tests/testdata/003_relative_import.ts.out similarity index 100% rename from cli/tests/003_relative_import.ts.out rename to cli/tests/testdata/003_relative_import.ts.out diff --git a/cli/tests/004_set_timeout.ts b/cli/tests/testdata/004_set_timeout.ts similarity index 100% rename from cli/tests/004_set_timeout.ts rename to cli/tests/testdata/004_set_timeout.ts diff --git a/cli/tests/004_set_timeout.ts.out b/cli/tests/testdata/004_set_timeout.ts.out similarity index 100% rename from cli/tests/004_set_timeout.ts.out rename to cli/tests/testdata/004_set_timeout.ts.out diff --git a/cli/tests/005_more_imports.ts b/cli/tests/testdata/005_more_imports.ts similarity index 100% rename from cli/tests/005_more_imports.ts rename to cli/tests/testdata/005_more_imports.ts diff --git a/cli/tests/005_more_imports.ts.out b/cli/tests/testdata/005_more_imports.ts.out similarity index 100% rename from cli/tests/005_more_imports.ts.out rename to cli/tests/testdata/005_more_imports.ts.out diff --git a/cli/tests/testdata/006_url_imports.ts b/cli/tests/testdata/006_url_imports.ts new file mode 100644 index 0000000000..4036f27ed8 --- /dev/null +++ b/cli/tests/testdata/006_url_imports.ts @@ -0,0 +1,3 @@ +import { printHello } from "http://localhost:4545/subdir/mod2.ts"; +printHello(); +console.log("success"); diff --git a/cli/tests/006_url_imports.ts.out b/cli/tests/testdata/006_url_imports.ts.out similarity index 100% rename from cli/tests/006_url_imports.ts.out rename to cli/tests/testdata/006_url_imports.ts.out diff --git a/cli/tests/012_async.ts b/cli/tests/testdata/012_async.ts similarity index 100% rename from cli/tests/012_async.ts rename to cli/tests/testdata/012_async.ts diff --git a/cli/tests/012_async.ts.out b/cli/tests/testdata/012_async.ts.out similarity index 100% rename from cli/tests/012_async.ts.out rename to cli/tests/testdata/012_async.ts.out diff --git a/cli/tests/013_dynamic_import.ts b/cli/tests/testdata/013_dynamic_import.ts similarity index 100% rename from cli/tests/013_dynamic_import.ts rename to cli/tests/testdata/013_dynamic_import.ts diff --git a/cli/tests/013_dynamic_import.ts.out b/cli/tests/testdata/013_dynamic_import.ts.out similarity index 100% rename from cli/tests/013_dynamic_import.ts.out rename to cli/tests/testdata/013_dynamic_import.ts.out diff --git a/cli/tests/014_duplicate_import.ts b/cli/tests/testdata/014_duplicate_import.ts similarity index 100% rename from cli/tests/014_duplicate_import.ts rename to cli/tests/testdata/014_duplicate_import.ts diff --git a/cli/tests/014_duplicate_import.ts.out b/cli/tests/testdata/014_duplicate_import.ts.out similarity index 100% rename from cli/tests/014_duplicate_import.ts.out rename to cli/tests/testdata/014_duplicate_import.ts.out diff --git a/cli/tests/015_duplicate_parallel_import.js b/cli/tests/testdata/015_duplicate_parallel_import.js similarity index 100% rename from cli/tests/015_duplicate_parallel_import.js rename to cli/tests/testdata/015_duplicate_parallel_import.js diff --git a/cli/tests/015_duplicate_parallel_import.js.out b/cli/tests/testdata/015_duplicate_parallel_import.js.out similarity index 100% rename from cli/tests/015_duplicate_parallel_import.js.out rename to cli/tests/testdata/015_duplicate_parallel_import.js.out diff --git a/cli/tests/016_double_await.ts b/cli/tests/testdata/016_double_await.ts similarity index 100% rename from cli/tests/016_double_await.ts rename to cli/tests/testdata/016_double_await.ts diff --git a/cli/tests/016_double_await.ts.out b/cli/tests/testdata/016_double_await.ts.out similarity index 100% rename from cli/tests/016_double_await.ts.out rename to cli/tests/testdata/016_double_await.ts.out diff --git a/cli/tests/017_import_redirect.ts b/cli/tests/testdata/017_import_redirect.ts similarity index 100% rename from cli/tests/017_import_redirect.ts rename to cli/tests/testdata/017_import_redirect.ts diff --git a/cli/tests/017_import_redirect.ts.out b/cli/tests/testdata/017_import_redirect.ts.out similarity index 100% rename from cli/tests/017_import_redirect.ts.out rename to cli/tests/testdata/017_import_redirect.ts.out diff --git a/cli/tests/017_import_redirect_info.out b/cli/tests/testdata/017_import_redirect_info.out similarity index 79% rename from cli/tests/017_import_redirect_info.out rename to cli/tests/testdata/017_import_redirect_info.out index 662b237a4c..d3a2e86fc7 100644 --- a/cli/tests/017_import_redirect_info.out +++ b/cli/tests/testdata/017_import_redirect_info.out @@ -2,5 +2,5 @@ local: [WILDCARD]017_import_redirect.ts type: TypeScript dependencies: 1 unique (total 278B) -file:///[WILDCARD]cli/tests/017_import_redirect.ts ([WILDCARD]) +file:///[WILDCARD]/017_import_redirect.ts ([WILDCARD]) └── https://gist.githubusercontent.com/ry/f12b2aa3409e6b52645bc346a9e22929/raw/79318f239f51d764384a8bded8d7c6a833610dde/print_hello.ts ([WILDCARD]) diff --git a/cli/tests/018_async_catch.ts b/cli/tests/testdata/018_async_catch.ts similarity index 100% rename from cli/tests/018_async_catch.ts rename to cli/tests/testdata/018_async_catch.ts diff --git a/cli/tests/018_async_catch.ts.out b/cli/tests/testdata/018_async_catch.ts.out similarity index 100% rename from cli/tests/018_async_catch.ts.out rename to cli/tests/testdata/018_async_catch.ts.out diff --git a/cli/tests/testdata/019_media_types.ts b/cli/tests/testdata/019_media_types.ts new file mode 100644 index 0000000000..d985bd2496 --- /dev/null +++ b/cli/tests/testdata/019_media_types.ts @@ -0,0 +1,24 @@ +// When run against the test HTTP server, it will serve different media types +// based on the URL containing `.t#.` strings, which exercises the different +// mapping of media types end to end. + +import { loaded as loadedTs1 } from "http://localhost:4545/subdir/mt_text_typescript.t1.ts"; +import { loaded as loadedTs2 } from "http://localhost:4545/subdir/mt_video_vdn.t2.ts"; +import { loaded as loadedTs3 } from "http://localhost:4545/subdir/mt_video_mp2t.t3.ts"; +import { loaded as loadedTs4 } from "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts"; +import { loaded as loadedJs1 } from "http://localhost:4545/subdir/mt_text_javascript.j1.js"; +import { loaded as loadedJs2 } from "http://localhost:4545/subdir/mt_application_ecmascript.j2.js"; +import { loaded as loadedJs3 } from "http://localhost:4545/subdir/mt_text_ecmascript.j3.js"; +import { loaded as loadedJs4 } from "http://localhost:4545/subdir/mt_application_x_javascript.j4.js"; + +console.log( + "success", + loadedTs1, + loadedTs2, + loadedTs3, + loadedTs4, + loadedJs1, + loadedJs2, + loadedJs3, + loadedJs4, +); diff --git a/cli/tests/019_media_types.ts.out b/cli/tests/testdata/019_media_types.ts.out similarity index 100% rename from cli/tests/019_media_types.ts.out rename to cli/tests/testdata/019_media_types.ts.out diff --git a/cli/tests/020_json_modules.ts b/cli/tests/testdata/020_json_modules.ts similarity index 100% rename from cli/tests/020_json_modules.ts rename to cli/tests/testdata/020_json_modules.ts diff --git a/cli/tests/020_json_modules.ts.out b/cli/tests/testdata/020_json_modules.ts.out similarity index 68% rename from cli/tests/020_json_modules.ts.out rename to cli/tests/testdata/020_json_modules.ts.out index a89bd2ad66..bfb7c80cfc 100644 --- a/cli/tests/020_json_modules.ts.out +++ b/cli/tests/testdata/020_json_modules.ts.out @@ -1,5 +1,5 @@ [WILDCARD] error: An unsupported media type was attempted to be imported as a module. - Specifier: [WILDCARD]cli/tests/subdir/config.json + Specifier: [WILDCARD]/subdir/config.json MediaType: Json [WILDCARD] \ No newline at end of file diff --git a/cli/tests/021_mjs_modules.ts b/cli/tests/testdata/021_mjs_modules.ts similarity index 100% rename from cli/tests/021_mjs_modules.ts rename to cli/tests/testdata/021_mjs_modules.ts diff --git a/cli/tests/021_mjs_modules.ts.out b/cli/tests/testdata/021_mjs_modules.ts.out similarity index 100% rename from cli/tests/021_mjs_modules.ts.out rename to cli/tests/testdata/021_mjs_modules.ts.out diff --git a/cli/tests/testdata/022_info_flag_script.out b/cli/tests/testdata/022_info_flag_script.out new file mode 100644 index 0000000000..e86b7dda4e --- /dev/null +++ b/cli/tests/testdata/022_info_flag_script.out @@ -0,0 +1,14 @@ +[WILDCARD] +local: [WILDCARD]http[WILDCARD]127.0.0.1_PORT4545[WILDCARD] +type: TypeScript +dependencies: 8 unique (total [WILDCARD]) + +http://127.0.0.1:4545/019_media_types.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_ecmascript.j2.js ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_x_javascript.j4.js ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_x_typescript.t4.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_ecmascript.j3.js ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_javascript.j1.js ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_typescript.t1.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_video_mp2t.t3.ts ([WILDCARD]) +└── http://localhost:4545/subdir/mt_video_vdn.t2.ts ([WILDCARD]) diff --git a/cli/tests/023_no_ext b/cli/tests/testdata/023_no_ext similarity index 100% rename from cli/tests/023_no_ext rename to cli/tests/testdata/023_no_ext diff --git a/cli/tests/023_no_ext.out b/cli/tests/testdata/023_no_ext.out similarity index 100% rename from cli/tests/023_no_ext.out rename to cli/tests/testdata/023_no_ext.out diff --git a/cli/tests/024_import_no_ext_with_headers.ts b/cli/tests/testdata/024_import_no_ext_with_headers.ts similarity index 100% rename from cli/tests/024_import_no_ext_with_headers.ts rename to cli/tests/testdata/024_import_no_ext_with_headers.ts diff --git a/cli/tests/024_import_no_ext_with_headers.ts.out b/cli/tests/testdata/024_import_no_ext_with_headers.ts.out similarity index 100% rename from cli/tests/024_import_no_ext_with_headers.ts.out rename to cli/tests/testdata/024_import_no_ext_with_headers.ts.out diff --git a/cli/tests/025_hrtime.ts b/cli/tests/testdata/025_hrtime.ts similarity index 100% rename from cli/tests/025_hrtime.ts rename to cli/tests/testdata/025_hrtime.ts diff --git a/cli/tests/025_hrtime.ts.out b/cli/tests/testdata/025_hrtime.ts.out similarity index 100% rename from cli/tests/025_hrtime.ts.out rename to cli/tests/testdata/025_hrtime.ts.out diff --git a/cli/tests/025_reload_js_type_error.js b/cli/tests/testdata/025_reload_js_type_error.js similarity index 100% rename from cli/tests/025_reload_js_type_error.js rename to cli/tests/testdata/025_reload_js_type_error.js diff --git a/cli/tests/025_reload_js_type_error.js.out b/cli/tests/testdata/025_reload_js_type_error.js.out similarity index 100% rename from cli/tests/025_reload_js_type_error.js.out rename to cli/tests/testdata/025_reload_js_type_error.js.out diff --git a/cli/tests/026_redirect_javascript.js b/cli/tests/testdata/026_redirect_javascript.js similarity index 100% rename from cli/tests/026_redirect_javascript.js rename to cli/tests/testdata/026_redirect_javascript.js diff --git a/cli/tests/026_redirect_javascript.js.out b/cli/tests/testdata/026_redirect_javascript.js.out similarity index 100% rename from cli/tests/026_redirect_javascript.js.out rename to cli/tests/testdata/026_redirect_javascript.js.out diff --git a/cli/tests/027_redirect_typescript.ts b/cli/tests/testdata/027_redirect_typescript.ts similarity index 100% rename from cli/tests/027_redirect_typescript.ts rename to cli/tests/testdata/027_redirect_typescript.ts diff --git a/cli/tests/027_redirect_typescript.ts.out b/cli/tests/testdata/027_redirect_typescript.ts.out similarity index 100% rename from cli/tests/027_redirect_typescript.ts.out rename to cli/tests/testdata/027_redirect_typescript.ts.out diff --git a/cli/tests/028_args.ts b/cli/tests/testdata/028_args.ts similarity index 100% rename from cli/tests/028_args.ts rename to cli/tests/testdata/028_args.ts diff --git a/cli/tests/028_args.ts.out b/cli/tests/testdata/028_args.ts.out similarity index 100% rename from cli/tests/028_args.ts.out rename to cli/tests/testdata/028_args.ts.out diff --git a/cli/tests/029_eval.out b/cli/tests/testdata/029_eval.out similarity index 100% rename from cli/tests/029_eval.out rename to cli/tests/testdata/029_eval.out diff --git a/cli/tests/030_eval_ts.out b/cli/tests/testdata/030_eval_ts.out similarity index 100% rename from cli/tests/030_eval_ts.out rename to cli/tests/testdata/030_eval_ts.out diff --git a/cli/tests/031_info_ts_error.out b/cli/tests/testdata/031_info_ts_error.out similarity index 100% rename from cli/tests/031_info_ts_error.out rename to cli/tests/testdata/031_info_ts_error.out diff --git a/cli/tests/031_info_ts_error.ts b/cli/tests/testdata/031_info_ts_error.ts similarity index 100% rename from cli/tests/031_info_ts_error.ts rename to cli/tests/testdata/031_info_ts_error.ts diff --git a/cli/tests/033_import_map.out b/cli/tests/testdata/033_import_map.out similarity index 100% rename from cli/tests/033_import_map.out rename to cli/tests/testdata/033_import_map.out diff --git a/cli/tests/033_import_map_remote.out b/cli/tests/testdata/033_import_map_remote.out similarity index 100% rename from cli/tests/033_import_map_remote.out rename to cli/tests/testdata/033_import_map_remote.out diff --git a/cli/tests/034_onload.out b/cli/tests/testdata/034_onload.out similarity index 100% rename from cli/tests/034_onload.out rename to cli/tests/testdata/034_onload.out diff --git a/cli/tests/034_onload/imported.ts b/cli/tests/testdata/034_onload/imported.ts similarity index 80% rename from cli/tests/034_onload/imported.ts rename to cli/tests/testdata/034_onload/imported.ts index 3c7a0aae2d..bac6cf5fad 100644 --- a/cli/tests/034_onload/imported.ts +++ b/cli/tests/testdata/034_onload/imported.ts @@ -1,4 +1,4 @@ -import { assert } from "../../../test_util/std/testing/asserts.ts"; +import { assert } from "../../../../test_util/std/testing/asserts.ts"; import "./nest_imported.ts"; const handler = (e: Event) => { diff --git a/cli/tests/034_onload/main.ts b/cli/tests/testdata/034_onload/main.ts similarity index 89% rename from cli/tests/034_onload/main.ts rename to cli/tests/testdata/034_onload/main.ts index 7696ec122c..42df21c163 100644 --- a/cli/tests/034_onload/main.ts +++ b/cli/tests/testdata/034_onload/main.ts @@ -1,4 +1,4 @@ -import { assert } from "../../../test_util/std/testing/asserts.ts"; +import { assert } from "../../../../test_util/std/testing/asserts.ts"; import "./imported.ts"; assert(window.hasOwnProperty("onload")); diff --git a/cli/tests/034_onload/nest_imported.ts b/cli/tests/testdata/034_onload/nest_imported.ts similarity index 78% rename from cli/tests/034_onload/nest_imported.ts rename to cli/tests/testdata/034_onload/nest_imported.ts index 8ca668de97..259e505a2b 100644 --- a/cli/tests/034_onload/nest_imported.ts +++ b/cli/tests/testdata/034_onload/nest_imported.ts @@ -1,4 +1,4 @@ -import { assert } from "../../../test_util/std/testing/asserts.ts"; +import { assert } from "../../../../test_util/std/testing/asserts.ts"; const handler = (e: Event) => { assert(!e.cancelable); diff --git a/cli/tests/testdata/035_cached_only_flag.out b/cli/tests/testdata/035_cached_only_flag.out new file mode 100644 index 0000000000..aad3f2fbc1 --- /dev/null +++ b/cli/tests/testdata/035_cached_only_flag.out @@ -0,0 +1 @@ +error: Specifier not found in cache: "http://127.0.0.1:4545/019_media_types.ts", --cached-only is specified. diff --git a/cli/tests/036_import_map_fetch.out b/cli/tests/testdata/036_import_map_fetch.out similarity index 100% rename from cli/tests/036_import_map_fetch.out rename to cli/tests/testdata/036_import_map_fetch.out diff --git a/cli/tests/testdata/037_fetch_multiple.out b/cli/tests/testdata/037_fetch_multiple.out new file mode 100644 index 0000000000..09c6c0f60f --- /dev/null +++ b/cli/tests/testdata/037_fetch_multiple.out @@ -0,0 +1,5 @@ +Download http://localhost:4545/subdir/mod2.ts +Download http://localhost:4545/subdir/print_hello.ts +Check [WILDCARD]/fetch/test.ts +Download http://localhost:4545/subdir/mt_text_typescript.t1.ts +Check [WILDCARD]/fetch/other.ts diff --git a/cli/tests/038_checkjs.js b/cli/tests/testdata/038_checkjs.js similarity index 100% rename from cli/tests/038_checkjs.js rename to cli/tests/testdata/038_checkjs.js diff --git a/cli/tests/038_checkjs.js.out b/cli/tests/testdata/038_checkjs.js.out similarity index 76% rename from cli/tests/038_checkjs.js.out rename to cli/tests/testdata/038_checkjs.js.out index bd3fc35481..4ea473e4ff 100644 --- a/cli/tests/038_checkjs.js.out +++ b/cli/tests/testdata/038_checkjs.js.out @@ -2,7 +2,7 @@ error: TS2552 [ERROR]: Cannot find name 'consol'. Did you mean 'console'? consol.log("hello world!"); ~~~~~~ - at [WILDCARD]tests/038_checkjs.js:2:1 + at [WILDCARD]/038_checkjs.js:2:1 'console' is declared here. declare var console: Console; @@ -12,11 +12,11 @@ consol.log("hello world!"); TS2552 [ERROR]: Cannot find name 'Foo'. Did you mean 'foo'? const foo = new Foo(); ~~~ - at [WILDCARD]tests/038_checkjs.js:5:17 + at [WILDCARD]/038_checkjs.js:5:17 'foo' is declared here. const foo = new Foo(); ~~~ - at [WILDCARD]tests/038_checkjs.js:5:7 + at [WILDCARD]/038_checkjs.js:5:7 Found 2 errors. diff --git a/cli/tests/038_checkjs.tsconfig.json b/cli/tests/testdata/038_checkjs.tsconfig.json similarity index 100% rename from cli/tests/038_checkjs.tsconfig.json rename to cli/tests/testdata/038_checkjs.tsconfig.json diff --git a/cli/tests/041_dyn_import_eval.out b/cli/tests/testdata/041_dyn_import_eval.out similarity index 100% rename from cli/tests/041_dyn_import_eval.out rename to cli/tests/testdata/041_dyn_import_eval.out diff --git a/cli/tests/041_info_flag.out b/cli/tests/testdata/041_info_flag.out similarity index 100% rename from cli/tests/041_info_flag.out rename to cli/tests/testdata/041_info_flag.out diff --git a/cli/tests/041_info_flag_location.out b/cli/tests/testdata/041_info_flag_location.out similarity index 100% rename from cli/tests/041_info_flag_location.out rename to cli/tests/testdata/041_info_flag_location.out diff --git a/cli/tests/042_dyn_import_evalcontext.ts b/cli/tests/testdata/042_dyn_import_evalcontext.ts similarity index 100% rename from cli/tests/042_dyn_import_evalcontext.ts rename to cli/tests/testdata/042_dyn_import_evalcontext.ts diff --git a/cli/tests/042_dyn_import_evalcontext.ts.out b/cli/tests/testdata/042_dyn_import_evalcontext.ts.out similarity index 100% rename from cli/tests/042_dyn_import_evalcontext.ts.out rename to cli/tests/testdata/042_dyn_import_evalcontext.ts.out diff --git a/cli/tests/044_bad_resource.ts b/cli/tests/testdata/044_bad_resource.ts similarity index 100% rename from cli/tests/044_bad_resource.ts rename to cli/tests/testdata/044_bad_resource.ts diff --git a/cli/tests/044_bad_resource.ts.out b/cli/tests/testdata/044_bad_resource.ts.out similarity index 100% rename from cli/tests/044_bad_resource.ts.out rename to cli/tests/testdata/044_bad_resource.ts.out diff --git a/cli/tests/testdata/045_mod.ts b/cli/tests/testdata/045_mod.ts new file mode 100644 index 0000000000..b5f2a0b5b4 --- /dev/null +++ b/cli/tests/testdata/045_mod.ts @@ -0,0 +1,5 @@ +import { output } from "./045_output.ts"; + +if (import.meta.main) { + output("Hello!"); +} diff --git a/cli/tests/testdata/045_output.ts b/cli/tests/testdata/045_output.ts new file mode 100644 index 0000000000..398760ca00 --- /dev/null +++ b/cli/tests/testdata/045_output.ts @@ -0,0 +1,3 @@ +export function output(text: string) { + console.log(text); +} diff --git a/cli/tests/045_programmatic_proxy_client.ts b/cli/tests/testdata/045_programmatic_proxy_client.ts similarity index 85% rename from cli/tests/045_programmatic_proxy_client.ts rename to cli/tests/testdata/045_programmatic_proxy_client.ts index 50884407d0..cd66599783 100644 --- a/cli/tests/045_programmatic_proxy_client.ts +++ b/cli/tests/testdata/045_programmatic_proxy_client.ts @@ -8,7 +8,7 @@ const client = Deno.createHttpClient({ }); const res = await fetch( - "http://localhost:4545/test_util/std/examples/colors.ts", + "http://localhost:4545/045_mod.ts", { client }, ); console.log(`Response http: ${await res.text()}`); diff --git a/cli/tests/045_proxy_client.ts b/cli/tests/testdata/045_proxy_client.ts similarity index 71% rename from cli/tests/045_proxy_client.ts rename to cli/tests/testdata/045_proxy_client.ts index 316f0bf852..fe9129312d 100644 --- a/cli/tests/045_proxy_client.ts +++ b/cli/tests/testdata/045_proxy_client.ts @@ -1,5 +1,5 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. const res = await fetch( - "http://localhost:4545/test_util/std/examples/colors.ts", + "http://localhost:4545/045_mod.ts", ); console.log(`Response http: ${await res.text()}`); diff --git a/cli/tests/045_proxy_test.ts b/cli/tests/testdata/045_proxy_test.ts similarity index 91% rename from cli/tests/045_proxy_test.ts rename to cli/tests/testdata/045_proxy_test.ts index db6f008767..6d8359518f 100644 --- a/cli/tests/045_proxy_test.ts +++ b/cli/tests/testdata/045_proxy_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -import { serve, ServerRequest } from "../../test_util/std/http/server.ts"; -import { assertEquals } from "../../test_util/std/testing/asserts.ts"; +import { serve, ServerRequest } from "../../../test_util/std/http/server.ts"; +import { assertEquals } from "../../../test_util/std/testing/asserts.ts"; const addr = Deno.args[1] || "127.0.0.1:4555"; @@ -59,7 +59,7 @@ async function testModuleDownload() { "cache", "--reload", "--quiet", - "http://localhost:4545/test_util/std/examples/colors.ts", + "http://localhost:4545/045_mod.ts", ], stdout: "piped", env: { @@ -101,7 +101,7 @@ async function testModuleDownloadNoProxy() { "cache", "--reload", "--quiet", - "http://localhost:4545/test_util/std/examples/colors.ts", + "http://localhost:4545/045_mod.ts", ], stdout: "piped", env: { diff --git a/cli/tests/testdata/045_proxy_test.ts.out b/cli/tests/testdata/045_proxy_test.ts.out new file mode 100644 index 0000000000..4ebf97dee4 --- /dev/null +++ b/cli/tests/testdata/045_proxy_test.ts.out @@ -0,0 +1,6 @@ +Proxy server listening on [WILDCARD] +Proxy request to: http://localhost:4545/045_mod.ts +Proxy request to: http://localhost:4545/045_mod.ts +Proxy request to: http://localhost:4545/045_output.ts +Proxy request to: http://localhost:4545/045_mod.ts +proxy-authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= diff --git a/cli/tests/046_jsx_test.tsx b/cli/tests/testdata/046_jsx_test.tsx similarity index 100% rename from cli/tests/046_jsx_test.tsx rename to cli/tests/testdata/046_jsx_test.tsx diff --git a/cli/tests/046_jsx_test.tsx.out b/cli/tests/testdata/046_jsx_test.tsx.out similarity index 100% rename from cli/tests/046_jsx_test.tsx.out rename to cli/tests/testdata/046_jsx_test.tsx.out diff --git a/cli/tests/047_jsx_test.jsx b/cli/tests/testdata/047_jsx_test.jsx similarity index 100% rename from cli/tests/047_jsx_test.jsx rename to cli/tests/testdata/047_jsx_test.jsx diff --git a/cli/tests/047_jsx_test.jsx.out b/cli/tests/testdata/047_jsx_test.jsx.out similarity index 100% rename from cli/tests/047_jsx_test.jsx.out rename to cli/tests/testdata/047_jsx_test.jsx.out diff --git a/cli/tests/testdata/048_media_types_jsx.ts b/cli/tests/testdata/048_media_types_jsx.ts new file mode 100644 index 0000000000..8dcd0ad687 --- /dev/null +++ b/cli/tests/testdata/048_media_types_jsx.ts @@ -0,0 +1,32 @@ +// When run against the test HTTP server, it will serve different media types +// based on the URL containing `.t#.` strings, which exercises the different +// mapping of media types end to end. +import { loaded as loadedTsx1 } from "http://localhost:4545/subdir/mt_text_typescript_tsx.t1.tsx"; +import { loaded as loadedTsx2 } from "http://localhost:4545/subdir/mt_video_vdn_tsx.t2.tsx"; +import { loaded as loadedTsx3 } from "http://localhost:4545/subdir/mt_video_mp2t_tsx.t3.tsx"; +import { loaded as loadedTsx4 } from "http://localhost:4545/subdir/mt_application_x_typescript_tsx.t4.tsx"; +import { loaded as loadedJsx1 } from "http://localhost:4545/subdir/mt_text_javascript_jsx.j1.jsx"; +import { loaded as loadedJsx2 } from "http://localhost:4545/subdir/mt_application_ecmascript_jsx.j2.jsx"; +import { loaded as loadedJsx3 } from "http://localhost:4545/subdir/mt_text_ecmascript_jsx.j3.jsx"; +import { loaded as loadedJsx4 } from "http://localhost:4545/subdir/mt_application_x_javascript_jsx.j4.jsx"; + +declare global { + namespace JSX { + interface IntrinsicElements { + // deno-lint-ignore no-explicit-any + [elemName: string]: any; + } + } +} + +console.log( + "success", + loadedTsx1, + loadedTsx2, + loadedTsx3, + loadedTsx4, + loadedJsx1, + loadedJsx2, + loadedJsx3, + loadedJsx4, +); diff --git a/cli/tests/048_media_types_jsx.ts.out b/cli/tests/testdata/048_media_types_jsx.ts.out similarity index 100% rename from cli/tests/048_media_types_jsx.ts.out rename to cli/tests/testdata/048_media_types_jsx.ts.out diff --git a/cli/tests/testdata/049_info_flag_script_jsx.out b/cli/tests/testdata/049_info_flag_script_jsx.out new file mode 100644 index 0000000000..860d127fe6 --- /dev/null +++ b/cli/tests/testdata/049_info_flag_script_jsx.out @@ -0,0 +1,14 @@ +[WILDCARD] +local: [WILDCARD]http[WILDCARD]127.0.0.1_PORT4545[WILDCARD] +type: TypeScript +dependencies: 8 unique (total [WILDCARD]) + +http://127.0.0.1:4545/048_media_types_jsx.ts ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_ecmascript_jsx.j2.jsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_x_javascript_jsx.j4.jsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_application_x_typescript_tsx.t4.tsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_ecmascript_jsx.j3.jsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_javascript_jsx.j1.jsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_text_typescript_tsx.t1.tsx ([WILDCARD]) +├── http://localhost:4545/subdir/mt_video_mp2t_tsx.t3.tsx ([WILDCARD]) +└── http://localhost:4545/subdir/mt_video_vdn_tsx.t2.tsx ([WILDCARD]) diff --git a/cli/tests/052_no_remote_flag.out b/cli/tests/testdata/052_no_remote_flag.out similarity index 51% rename from cli/tests/052_no_remote_flag.out rename to cli/tests/testdata/052_no_remote_flag.out index 9fefc4b922..c1f9f4e131 100644 --- a/cli/tests/052_no_remote_flag.out +++ b/cli/tests/testdata/052_no_remote_flag.out @@ -1 +1 @@ -error: A remote specifier was requested: "http://127.0.0.1:4545/cli/tests/019_media_types.ts", but --no-remote is specified. +error: A remote specifier was requested: "http://127.0.0.1:4545/019_media_types.ts", but --no-remote is specified. diff --git a/cli/tests/053_import_compression.out b/cli/tests/testdata/053_import_compression.out similarity index 100% rename from cli/tests/053_import_compression.out rename to cli/tests/testdata/053_import_compression.out diff --git a/cli/tests/053_import_compression/brotli b/cli/tests/testdata/053_import_compression/brotli similarity index 100% rename from cli/tests/053_import_compression/brotli rename to cli/tests/testdata/053_import_compression/brotli diff --git a/cli/tests/053_import_compression/gziped b/cli/tests/testdata/053_import_compression/gziped similarity index 100% rename from cli/tests/053_import_compression/gziped rename to cli/tests/testdata/053_import_compression/gziped diff --git a/cli/tests/testdata/053_import_compression/main.ts b/cli/tests/testdata/053_import_compression/main.ts new file mode 100644 index 0000000000..1ff1b0c831 --- /dev/null +++ b/cli/tests/testdata/053_import_compression/main.ts @@ -0,0 +1,13 @@ +import "http://127.0.0.1:4545/053_import_compression/gziped"; +import "http://127.0.0.1:4545/053_import_compression/brotli"; + +console.log( + await fetch( + "http://127.0.0.1:4545/053_import_compression/gziped", + ).then((res) => res.text()), +); +console.log( + await fetch( + "http://127.0.0.1:4545/053_import_compression/brotli", + ).then((res) => res.text()), +); diff --git a/cli/tests/054_info_local_imports.out b/cli/tests/testdata/054_info_local_imports.out similarity index 100% rename from cli/tests/054_info_local_imports.out rename to cli/tests/testdata/054_info_local_imports.out diff --git a/cli/tests/055_info_file_json.out b/cli/tests/testdata/055_info_file_json.out similarity index 60% rename from cli/tests/055_info_file_json.out rename to cli/tests/testdata/055_info_file_json.out index 0706689223..4753ef0ef1 100644 --- a/cli/tests/055_info_file_json.out +++ b/cli/tests/testdata/055_info_file_json.out @@ -1,12 +1,12 @@ { - "root": "file://[WILDCARD]/cli/tests/005_more_imports.ts", + "root": "file://[WILDCARD]/005_more_imports.ts", "modules": [ { - "specifier": "file://[WILDCARD]/cli/tests/005_more_imports.ts", + "specifier": "file://[WILDCARD]/005_more_imports.ts", "dependencies": [ { "specifier": "./subdir/mod1.ts", - "code": "file://[WILDCARD]/cli/tests/subdir/mod1.ts" + "code": "file://[WILDCARD]/subdir/mod1.ts" } ], "size": 211, @@ -15,11 +15,11 @@ [WILDCARD] }, { - "specifier": "file://[WILDCARD]/cli/tests/subdir/mod1.ts", + "specifier": "file://[WILDCARD]/subdir/mod1.ts", "dependencies": [ { "specifier": "./subdir2/mod2.ts", - "code": "file://[WILDCARD]/cli/tests/subdir/subdir2/mod2.ts" + "code": "file://[WILDCARD]/subdir/subdir2/mod2.ts" } ], "size": 308, @@ -28,7 +28,7 @@ [WILDCARD] }, { - "specifier": "file://[WILDCARD]/cli/tests/subdir/print_hello.ts", + "specifier": "file://[WILDCARD]/subdir/print_hello.ts", "dependencies": [], "size": 57, "mediaType": "TypeScript", @@ -36,11 +36,11 @@ [WILDCARD] }, { - "specifier": "file://[WILDCARD]/cli/tests/subdir/subdir2/mod2.ts", + "specifier": "file://[WILDCARD]/subdir/subdir2/mod2.ts", "dependencies": [ { "specifier": "../print_hello.ts", - "code": "file://[WILDCARD]/cli/tests/subdir/print_hello.ts" + "code": "file://[WILDCARD]/subdir/print_hello.ts" } ], "size": 157, diff --git a/cli/tests/056_make_temp_file_write_perm.out b/cli/tests/testdata/056_make_temp_file_write_perm.out similarity index 100% rename from cli/tests/056_make_temp_file_write_perm.out rename to cli/tests/testdata/056_make_temp_file_write_perm.out diff --git a/cli/tests/056_make_temp_file_write_perm.ts b/cli/tests/testdata/056_make_temp_file_write_perm.ts similarity index 100% rename from cli/tests/056_make_temp_file_write_perm.ts rename to cli/tests/testdata/056_make_temp_file_write_perm.ts diff --git a/cli/tests/058_tasks_microtasks_close.ts b/cli/tests/testdata/058_tasks_microtasks_close.ts similarity index 100% rename from cli/tests/058_tasks_microtasks_close.ts rename to cli/tests/testdata/058_tasks_microtasks_close.ts diff --git a/cli/tests/058_tasks_microtasks_close.ts.out b/cli/tests/testdata/058_tasks_microtasks_close.ts.out similarity index 100% rename from cli/tests/058_tasks_microtasks_close.ts.out rename to cli/tests/testdata/058_tasks_microtasks_close.ts.out diff --git a/cli/tests/059_fs_relative_path_perm.ts b/cli/tests/testdata/059_fs_relative_path_perm.ts similarity index 100% rename from cli/tests/059_fs_relative_path_perm.ts rename to cli/tests/testdata/059_fs_relative_path_perm.ts diff --git a/cli/tests/059_fs_relative_path_perm.ts.out b/cli/tests/testdata/059_fs_relative_path_perm.ts.out similarity index 100% rename from cli/tests/059_fs_relative_path_perm.ts.out rename to cli/tests/testdata/059_fs_relative_path_perm.ts.out diff --git a/cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts b/cli/tests/testdata/060_deno_doc_displays_all_overloads_in_details_view.ts similarity index 100% rename from cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts rename to cli/tests/testdata/060_deno_doc_displays_all_overloads_in_details_view.ts diff --git a/cli/tests/testdata/060_deno_doc_displays_all_overloads_in_details_view.ts.out b/cli/tests/testdata/060_deno_doc_displays_all_overloads_in_details_view.ts.out new file mode 100644 index 0000000000..f1a5077d8d --- /dev/null +++ b/cli/tests/testdata/060_deno_doc_displays_all_overloads_in_details_view.ts.out @@ -0,0 +1,12 @@ +Defined in [WILDCARD]/060_deno_doc_displays_all_overloads_in_details_view.ts:3:2 + +function test(name: string, fn: Function): void + +Defined in [WILDCARD]/060_deno_doc_displays_all_overloads_in_details_view.ts:4:2 + +function test(options: object): void + +Defined in [WILDCARD]/060_deno_doc_displays_all_overloads_in_details_view.ts:5:2 + +function test(name: string | object, fn?: Function): void + diff --git a/cli/tests/061_permissions_request.ts b/cli/tests/testdata/061_permissions_request.ts similarity index 100% rename from cli/tests/061_permissions_request.ts rename to cli/tests/testdata/061_permissions_request.ts diff --git a/cli/tests/061_permissions_request.ts.out b/cli/tests/testdata/061_permissions_request.ts.out similarity index 100% rename from cli/tests/061_permissions_request.ts.out rename to cli/tests/testdata/061_permissions_request.ts.out diff --git a/cli/tests/062_permissions_request_global.ts b/cli/tests/testdata/062_permissions_request_global.ts similarity index 100% rename from cli/tests/062_permissions_request_global.ts rename to cli/tests/testdata/062_permissions_request_global.ts diff --git a/cli/tests/062_permissions_request_global.ts.out b/cli/tests/testdata/062_permissions_request_global.ts.out similarity index 100% rename from cli/tests/062_permissions_request_global.ts.out rename to cli/tests/testdata/062_permissions_request_global.ts.out diff --git a/cli/tests/063_permissions_revoke.ts b/cli/tests/testdata/063_permissions_revoke.ts similarity index 100% rename from cli/tests/063_permissions_revoke.ts rename to cli/tests/testdata/063_permissions_revoke.ts diff --git a/cli/tests/063_permissions_revoke.ts.out b/cli/tests/testdata/063_permissions_revoke.ts.out similarity index 100% rename from cli/tests/063_permissions_revoke.ts.out rename to cli/tests/testdata/063_permissions_revoke.ts.out diff --git a/cli/tests/064_permissions_revoke_global.ts b/cli/tests/testdata/064_permissions_revoke_global.ts similarity index 100% rename from cli/tests/064_permissions_revoke_global.ts rename to cli/tests/testdata/064_permissions_revoke_global.ts diff --git a/cli/tests/064_permissions_revoke_global.ts.out b/cli/tests/testdata/064_permissions_revoke_global.ts.out similarity index 100% rename from cli/tests/064_permissions_revoke_global.ts.out rename to cli/tests/testdata/064_permissions_revoke_global.ts.out diff --git a/cli/tests/065_import_map_info.out b/cli/tests/testdata/065_import_map_info.out similarity index 100% rename from cli/tests/065_import_map_info.out rename to cli/tests/testdata/065_import_map_info.out diff --git a/cli/tests/066_prompt.ts b/cli/tests/testdata/066_prompt.ts similarity index 100% rename from cli/tests/066_prompt.ts rename to cli/tests/testdata/066_prompt.ts diff --git a/cli/tests/066_prompt.ts.out b/cli/tests/testdata/066_prompt.ts.out similarity index 100% rename from cli/tests/066_prompt.ts.out rename to cli/tests/testdata/066_prompt.ts.out diff --git a/cli/tests/070_location.ts b/cli/tests/testdata/070_location.ts similarity index 100% rename from cli/tests/070_location.ts rename to cli/tests/testdata/070_location.ts diff --git a/cli/tests/070_location.ts.out b/cli/tests/testdata/070_location.ts.out similarity index 100% rename from cli/tests/070_location.ts.out rename to cli/tests/testdata/070_location.ts.out diff --git a/cli/tests/071_location_unset.ts b/cli/tests/testdata/071_location_unset.ts similarity index 100% rename from cli/tests/071_location_unset.ts rename to cli/tests/testdata/071_location_unset.ts diff --git a/cli/tests/071_location_unset.ts.out b/cli/tests/testdata/071_location_unset.ts.out similarity index 100% rename from cli/tests/071_location_unset.ts.out rename to cli/tests/testdata/071_location_unset.ts.out diff --git a/cli/tests/072_location_relative_fetch.ts b/cli/tests/testdata/072_location_relative_fetch.ts similarity index 100% rename from cli/tests/072_location_relative_fetch.ts rename to cli/tests/testdata/072_location_relative_fetch.ts diff --git a/cli/tests/072_location_relative_fetch.ts.out b/cli/tests/testdata/072_location_relative_fetch.ts.out similarity index 100% rename from cli/tests/072_location_relative_fetch.ts.out rename to cli/tests/testdata/072_location_relative_fetch.ts.out diff --git a/cli/tests/075_import_local_query_hash.ts b/cli/tests/testdata/075_import_local_query_hash.ts similarity index 100% rename from cli/tests/075_import_local_query_hash.ts rename to cli/tests/testdata/075_import_local_query_hash.ts diff --git a/cli/tests/075_import_local_query_hash.ts.out b/cli/tests/testdata/075_import_local_query_hash.ts.out similarity index 100% rename from cli/tests/075_import_local_query_hash.ts.out rename to cli/tests/testdata/075_import_local_query_hash.ts.out diff --git a/cli/tests/076_info_json_deps_order.out b/cli/tests/testdata/076_info_json_deps_order.out similarity index 61% rename from cli/tests/076_info_json_deps_order.out rename to cli/tests/testdata/076_info_json_deps_order.out index f8b26057d9..bcb2c70ed7 100644 --- a/cli/tests/076_info_json_deps_order.out +++ b/cli/tests/testdata/076_info_json_deps_order.out @@ -1,12 +1,12 @@ { - "root": "file://[WILDCARD]/cli/tests/076_info_json_deps_order.ts", + "root": "file://[WILDCARD]/076_info_json_deps_order.ts", "modules": [ { - "specifier": "file://[WILDCARD]/cli/tests/076_info_json_deps_order.ts", + "specifier": "file://[WILDCARD]/076_info_json_deps_order.ts", "dependencies": [ { "specifier": "./recursive_imports/A.ts", - "code": "file://[WILDCARD]/cli/tests/recursive_imports/A.ts" + "code": "file://[WILDCARD]/recursive_imports/A.ts" } ], "size": 81, @@ -15,15 +15,15 @@ "checksum": "5dd40fe33e5924cca513489ce568e86c9b9fe318a87975403c8923629018680d" }, { - "specifier": "file://[WILDCARD]/cli/tests/recursive_imports/A.ts", + "specifier": "file://[WILDCARD]/recursive_imports/A.ts", "dependencies": [ { "specifier": "./B.ts", - "code": "file://[WILDCARD]/cli/tests/recursive_imports/B.ts" + "code": "file://[WILDCARD]/recursive_imports/B.ts" }, { "specifier": "./common.ts", - "code": "file://[WILDCARD]/cli/tests/recursive_imports/common.ts" + "code": "file://[WILDCARD]/recursive_imports/common.ts" } ], "size": 108, @@ -32,15 +32,15 @@ "checksum": "3b45a105d892584298490cb73372b2cac57118e1e42a677a1d5cacea704d8d3a" }, { - "specifier": "file://[WILDCARD]/cli/tests/recursive_imports/B.ts", + "specifier": "file://[WILDCARD]/recursive_imports/B.ts", "dependencies": [ { "specifier": "./C.ts", - "code": "file://[WILDCARD]/cli/tests/recursive_imports/C.ts" + "code": "file://[WILDCARD]/recursive_imports/C.ts" }, { "specifier": "./common.ts", - "code": "file://[WILDCARD]/cli/tests/recursive_imports/common.ts" + "code": "file://[WILDCARD]/recursive_imports/common.ts" } ], "size": 108, @@ -49,15 +49,15 @@ "checksum": "b12b0437ef9a91c4a4b1f66e8e4339f986b60bd8134031ccb296ce49df15b54e" }, { - "specifier": "file://[WILDCARD]/cli/tests/recursive_imports/C.ts", + "specifier": "file://[WILDCARD]/recursive_imports/C.ts", "dependencies": [ { "specifier": "./A.ts", - "code": "file://[WILDCARD]/cli/tests/recursive_imports/A.ts" + "code": "file://[WILDCARD]/recursive_imports/A.ts" }, { "specifier": "./common.ts", - "code": "file://[WILDCARD]/cli/tests/recursive_imports/common.ts" + "code": "file://[WILDCARD]/recursive_imports/common.ts" } ], "size": 126, @@ -66,7 +66,7 @@ "checksum": "605875a410741bfaeeade28cbccf45f219ad99d987ea695e35eda75d2c53a658" }, { - "specifier": "file://[WILDCARD]/cli/tests/recursive_imports/common.ts", + "specifier": "file://[WILDCARD]/recursive_imports/common.ts", "dependencies": [], "size": 28, "mediaType": "TypeScript", diff --git a/cli/tests/076_info_json_deps_order.ts b/cli/tests/testdata/076_info_json_deps_order.ts similarity index 100% rename from cli/tests/076_info_json_deps_order.ts rename to cli/tests/testdata/076_info_json_deps_order.ts diff --git a/cli/tests/077_fetch_empty.ts b/cli/tests/testdata/077_fetch_empty.ts similarity index 100% rename from cli/tests/077_fetch_empty.ts rename to cli/tests/testdata/077_fetch_empty.ts diff --git a/cli/tests/077_fetch_empty.ts.out b/cli/tests/testdata/077_fetch_empty.ts.out similarity index 100% rename from cli/tests/077_fetch_empty.ts.out rename to cli/tests/testdata/077_fetch_empty.ts.out diff --git a/cli/tests/078_unload_on_exit.ts b/cli/tests/testdata/078_unload_on_exit.ts similarity index 100% rename from cli/tests/078_unload_on_exit.ts rename to cli/tests/testdata/078_unload_on_exit.ts diff --git a/cli/tests/078_unload_on_exit.ts.out b/cli/tests/testdata/078_unload_on_exit.ts.out similarity index 100% rename from cli/tests/078_unload_on_exit.ts.out rename to cli/tests/testdata/078_unload_on_exit.ts.out diff --git a/cli/tests/079_location_authentication.ts b/cli/tests/testdata/079_location_authentication.ts similarity index 100% rename from cli/tests/079_location_authentication.ts rename to cli/tests/testdata/079_location_authentication.ts diff --git a/cli/tests/079_location_authentication.ts.out b/cli/tests/testdata/079_location_authentication.ts.out similarity index 100% rename from cli/tests/079_location_authentication.ts.out rename to cli/tests/testdata/079_location_authentication.ts.out diff --git a/cli/tests/080_deno_emit_permissions.ts b/cli/tests/testdata/080_deno_emit_permissions.ts similarity index 100% rename from cli/tests/080_deno_emit_permissions.ts rename to cli/tests/testdata/080_deno_emit_permissions.ts diff --git a/cli/tests/080_deno_emit_permissions.ts.out b/cli/tests/testdata/080_deno_emit_permissions.ts.out similarity index 100% rename from cli/tests/080_deno_emit_permissions.ts.out rename to cli/tests/testdata/080_deno_emit_permissions.ts.out diff --git a/cli/tests/081_location_relative_fetch_redirect.ts b/cli/tests/testdata/081_location_relative_fetch_redirect.ts similarity index 100% rename from cli/tests/081_location_relative_fetch_redirect.ts rename to cli/tests/testdata/081_location_relative_fetch_redirect.ts diff --git a/cli/tests/081_location_relative_fetch_redirect.ts.out b/cli/tests/testdata/081_location_relative_fetch_redirect.ts.out similarity index 100% rename from cli/tests/081_location_relative_fetch_redirect.ts.out rename to cli/tests/testdata/081_location_relative_fetch_redirect.ts.out diff --git a/cli/tests/082_prepare_stack_trace_throw.js b/cli/tests/testdata/082_prepare_stack_trace_throw.js similarity index 100% rename from cli/tests/082_prepare_stack_trace_throw.js rename to cli/tests/testdata/082_prepare_stack_trace_throw.js diff --git a/cli/tests/082_prepare_stack_trace_throw.js.out b/cli/tests/testdata/082_prepare_stack_trace_throw.js.out similarity index 100% rename from cli/tests/082_prepare_stack_trace_throw.js.out rename to cli/tests/testdata/082_prepare_stack_trace_throw.js.out diff --git a/cli/tests/083_legacy_external_source_map.ts b/cli/tests/testdata/083_legacy_external_source_map.ts similarity index 100% rename from cli/tests/083_legacy_external_source_map.ts rename to cli/tests/testdata/083_legacy_external_source_map.ts diff --git a/cli/tests/084_worker_custom_inspect.ts b/cli/tests/testdata/084_worker_custom_inspect.ts similarity index 100% rename from cli/tests/084_worker_custom_inspect.ts rename to cli/tests/testdata/084_worker_custom_inspect.ts diff --git a/cli/tests/084_worker_custom_inspect.ts.out b/cli/tests/testdata/084_worker_custom_inspect.ts.out similarity index 100% rename from cli/tests/084_worker_custom_inspect.ts.out rename to cli/tests/testdata/084_worker_custom_inspect.ts.out diff --git a/cli/tests/084_worker_custom_inspect_worker.ts b/cli/tests/testdata/084_worker_custom_inspect_worker.ts similarity index 100% rename from cli/tests/084_worker_custom_inspect_worker.ts rename to cli/tests/testdata/084_worker_custom_inspect_worker.ts diff --git a/cli/tests/085_dynamic_import_async_error.ts b/cli/tests/testdata/085_dynamic_import_async_error.ts similarity index 100% rename from cli/tests/085_dynamic_import_async_error.ts rename to cli/tests/testdata/085_dynamic_import_async_error.ts diff --git a/cli/tests/085_dynamic_import_async_error.ts.out b/cli/tests/testdata/085_dynamic_import_async_error.ts.out similarity index 100% rename from cli/tests/085_dynamic_import_async_error.ts.out rename to cli/tests/testdata/085_dynamic_import_async_error.ts.out diff --git a/cli/tests/086_dynamic_import_already_rejected.ts b/cli/tests/testdata/086_dynamic_import_already_rejected.ts similarity index 100% rename from cli/tests/086_dynamic_import_already_rejected.ts rename to cli/tests/testdata/086_dynamic_import_already_rejected.ts diff --git a/cli/tests/086_dynamic_import_already_rejected.ts.out b/cli/tests/testdata/086_dynamic_import_already_rejected.ts.out similarity index 100% rename from cli/tests/086_dynamic_import_already_rejected.ts.out rename to cli/tests/testdata/086_dynamic_import_already_rejected.ts.out diff --git a/cli/tests/087_hello.ts b/cli/tests/testdata/087_hello.ts similarity index 100% rename from cli/tests/087_hello.ts rename to cli/tests/testdata/087_hello.ts diff --git a/cli/tests/087_no_check_imports_not_used_as_values.ts b/cli/tests/testdata/087_no_check_imports_not_used_as_values.ts similarity index 100% rename from cli/tests/087_no_check_imports_not_used_as_values.ts rename to cli/tests/testdata/087_no_check_imports_not_used_as_values.ts diff --git a/cli/tests/087_no_check_imports_not_used_as_values.ts.out b/cli/tests/testdata/087_no_check_imports_not_used_as_values.ts.out similarity index 100% rename from cli/tests/087_no_check_imports_not_used_as_values.ts.out rename to cli/tests/testdata/087_no_check_imports_not_used_as_values.ts.out diff --git a/cli/tests/088_dynamic_import_already_evaluating.ts b/cli/tests/testdata/088_dynamic_import_already_evaluating.ts similarity index 100% rename from cli/tests/088_dynamic_import_already_evaluating.ts rename to cli/tests/testdata/088_dynamic_import_already_evaluating.ts diff --git a/cli/tests/088_dynamic_import_already_evaluating.ts.out b/cli/tests/testdata/088_dynamic_import_already_evaluating.ts.out similarity index 100% rename from cli/tests/088_dynamic_import_already_evaluating.ts.out rename to cli/tests/testdata/088_dynamic_import_already_evaluating.ts.out diff --git a/cli/tests/088_dynamic_import_target.ts b/cli/tests/testdata/088_dynamic_import_target.ts similarity index 100% rename from cli/tests/088_dynamic_import_target.ts rename to cli/tests/testdata/088_dynamic_import_target.ts diff --git a/cli/tests/089_run_allow_list.ts b/cli/tests/testdata/089_run_allow_list.ts similarity index 100% rename from cli/tests/089_run_allow_list.ts rename to cli/tests/testdata/089_run_allow_list.ts diff --git a/cli/tests/089_run_allow_list.ts.out b/cli/tests/testdata/089_run_allow_list.ts.out similarity index 100% rename from cli/tests/089_run_allow_list.ts.out rename to cli/tests/testdata/089_run_allow_list.ts.out diff --git a/cli/tests/090_run_permissions_request.ts b/cli/tests/testdata/090_run_permissions_request.ts similarity index 100% rename from cli/tests/090_run_permissions_request.ts rename to cli/tests/testdata/090_run_permissions_request.ts diff --git a/cli/tests/090_run_permissions_request.ts.out b/cli/tests/testdata/090_run_permissions_request.ts.out similarity index 100% rename from cli/tests/090_run_permissions_request.ts.out rename to cli/tests/testdata/090_run_permissions_request.ts.out diff --git a/cli/tests/091_use_define_for_class_fields.ts b/cli/tests/testdata/091_use_define_for_class_fields.ts similarity index 100% rename from cli/tests/091_use_define_for_class_fields.ts rename to cli/tests/testdata/091_use_define_for_class_fields.ts diff --git a/cli/tests/091_use_define_for_class_fields.ts.out b/cli/tests/testdata/091_use_define_for_class_fields.ts.out similarity index 100% rename from cli/tests/091_use_define_for_class_fields.ts.out rename to cli/tests/testdata/091_use_define_for_class_fields.ts.out diff --git a/cli/tests/092_import_map_unmapped_bare_specifier.ts b/cli/tests/testdata/092_import_map_unmapped_bare_specifier.ts similarity index 100% rename from cli/tests/092_import_map_unmapped_bare_specifier.ts rename to cli/tests/testdata/092_import_map_unmapped_bare_specifier.ts diff --git a/cli/tests/092_import_map_unmapped_bare_specifier.ts.out b/cli/tests/testdata/092_import_map_unmapped_bare_specifier.ts.out similarity index 100% rename from cli/tests/092_import_map_unmapped_bare_specifier.ts.out rename to cli/tests/testdata/092_import_map_unmapped_bare_specifier.ts.out diff --git a/cli/tests/095_cache_with_bare_import.ts b/cli/tests/testdata/095_cache_with_bare_import.ts similarity index 100% rename from cli/tests/095_cache_with_bare_import.ts rename to cli/tests/testdata/095_cache_with_bare_import.ts diff --git a/cli/tests/095_cache_with_bare_import.ts.out b/cli/tests/testdata/095_cache_with_bare_import.ts.out similarity index 100% rename from cli/tests/095_cache_with_bare_import.ts.out rename to cli/tests/testdata/095_cache_with_bare_import.ts.out diff --git a/cli/tests/Component.tsx b/cli/tests/testdata/Component.tsx similarity index 100% rename from cli/tests/Component.tsx rename to cli/tests/testdata/Component.tsx diff --git a/cli/tests/DenoWinRunner.cs b/cli/tests/testdata/DenoWinRunner.cs similarity index 100% rename from cli/tests/DenoWinRunner.cs rename to cli/tests/testdata/DenoWinRunner.cs diff --git a/cli/tests/DenoWinRunner.ps1 b/cli/tests/testdata/DenoWinRunner.ps1 similarity index 100% rename from cli/tests/DenoWinRunner.ps1 rename to cli/tests/testdata/DenoWinRunner.ps1 diff --git a/cli/tests/async_error.ts b/cli/tests/testdata/async_error.ts similarity index 100% rename from cli/tests/async_error.ts rename to cli/tests/testdata/async_error.ts diff --git a/cli/tests/async_error.ts.out b/cli/tests/testdata/async_error.ts.out similarity index 55% rename from cli/tests/async_error.ts.out rename to cli/tests/testdata/async_error.ts.out index 77406352cc..b424f9072b 100644 --- a/cli/tests/async_error.ts.out +++ b/cli/tests/testdata/async_error.ts.out @@ -4,5 +4,5 @@ world error: Uncaught (in promise) Error: error throw Error("error"); ^ - at foo ([WILDCARD]tests/async_error.ts:5:9) - at [WILDCARD]tests/async_error.ts:8:1 + at foo ([WILDCARD]/async_error.ts:5:9) + at [WILDCARD]/async_error.ts:8:1 diff --git a/cli/tests/badly_formatted.json b/cli/tests/testdata/badly_formatted.json similarity index 100% rename from cli/tests/badly_formatted.json rename to cli/tests/testdata/badly_formatted.json diff --git a/cli/tests/badly_formatted.md b/cli/tests/testdata/badly_formatted.md similarity index 100% rename from cli/tests/badly_formatted.md rename to cli/tests/testdata/badly_formatted.md diff --git a/cli/tests/badly_formatted.mjs b/cli/tests/testdata/badly_formatted.mjs similarity index 100% rename from cli/tests/badly_formatted.mjs rename to cli/tests/testdata/badly_formatted.mjs diff --git a/cli/tests/badly_formatted_fixed.js b/cli/tests/testdata/badly_formatted_fixed.js similarity index 100% rename from cli/tests/badly_formatted_fixed.js rename to cli/tests/testdata/badly_formatted_fixed.js diff --git a/cli/tests/badly_formatted_fixed.json b/cli/tests/testdata/badly_formatted_fixed.json similarity index 100% rename from cli/tests/badly_formatted_fixed.json rename to cli/tests/testdata/badly_formatted_fixed.json diff --git a/cli/tests/badly_formatted_fixed.md b/cli/tests/testdata/badly_formatted_fixed.md similarity index 100% rename from cli/tests/badly_formatted_fixed.md rename to cli/tests/testdata/badly_formatted_fixed.md diff --git a/cli/tests/blob_gc_finalization.js b/cli/tests/testdata/blob_gc_finalization.js similarity index 100% rename from cli/tests/blob_gc_finalization.js rename to cli/tests/testdata/blob_gc_finalization.js diff --git a/cli/tests/blob_gc_finalization.js.out b/cli/tests/testdata/blob_gc_finalization.js.out similarity index 100% rename from cli/tests/blob_gc_finalization.js.out rename to cli/tests/testdata/blob_gc_finalization.js.out diff --git a/cli/tests/bundle.test.out b/cli/tests/testdata/bundle.test.out similarity index 100% rename from cli/tests/bundle.test.out rename to cli/tests/testdata/bundle.test.out diff --git a/cli/tests/bundle/file_tests-fixture01.ts b/cli/tests/testdata/bundle/file_tests-fixture01.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture01.ts rename to cli/tests/testdata/bundle/file_tests-fixture01.ts diff --git a/cli/tests/bundle/file_tests-fixture02.ts b/cli/tests/testdata/bundle/file_tests-fixture02.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture02.ts rename to cli/tests/testdata/bundle/file_tests-fixture02.ts diff --git a/cli/tests/bundle/file_tests-fixture03.ts b/cli/tests/testdata/bundle/file_tests-fixture03.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture03.ts rename to cli/tests/testdata/bundle/file_tests-fixture03.ts diff --git a/cli/tests/bundle/file_tests-fixture04.ts b/cli/tests/testdata/bundle/file_tests-fixture04.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture04.ts rename to cli/tests/testdata/bundle/file_tests-fixture04.ts diff --git a/cli/tests/bundle/file_tests-fixture05.ts b/cli/tests/testdata/bundle/file_tests-fixture05.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture05.ts rename to cli/tests/testdata/bundle/file_tests-fixture05.ts diff --git a/cli/tests/bundle/file_tests-fixture06.ts b/cli/tests/testdata/bundle/file_tests-fixture06.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture06.ts rename to cli/tests/testdata/bundle/file_tests-fixture06.ts diff --git a/cli/tests/bundle/file_tests-fixture07.ts b/cli/tests/testdata/bundle/file_tests-fixture07.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture07.ts rename to cli/tests/testdata/bundle/file_tests-fixture07.ts diff --git a/cli/tests/bundle/file_tests-fixture08.ts b/cli/tests/testdata/bundle/file_tests-fixture08.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture08.ts rename to cli/tests/testdata/bundle/file_tests-fixture08.ts diff --git a/cli/tests/bundle/file_tests-fixture09.ts b/cli/tests/testdata/bundle/file_tests-fixture09.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture09.ts rename to cli/tests/testdata/bundle/file_tests-fixture09.ts diff --git a/cli/tests/bundle/file_tests-fixture10.ts b/cli/tests/testdata/bundle/file_tests-fixture10.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture10.ts rename to cli/tests/testdata/bundle/file_tests-fixture10.ts diff --git a/cli/tests/bundle/file_tests-fixture11.ts b/cli/tests/testdata/bundle/file_tests-fixture11.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture11.ts rename to cli/tests/testdata/bundle/file_tests-fixture11.ts diff --git a/cli/tests/bundle/file_tests-fixture12.ts b/cli/tests/testdata/bundle/file_tests-fixture12.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture12.ts rename to cli/tests/testdata/bundle/file_tests-fixture12.ts diff --git a/cli/tests/bundle/file_tests-fixture13.ts b/cli/tests/testdata/bundle/file_tests-fixture13.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture13.ts rename to cli/tests/testdata/bundle/file_tests-fixture13.ts diff --git a/cli/tests/bundle/file_tests-fixture14.ts b/cli/tests/testdata/bundle/file_tests-fixture14.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture14.ts rename to cli/tests/testdata/bundle/file_tests-fixture14.ts diff --git a/cli/tests/bundle/file_tests-fixture15.ts b/cli/tests/testdata/bundle/file_tests-fixture15.ts similarity index 100% rename from cli/tests/bundle/file_tests-fixture15.ts rename to cli/tests/testdata/bundle/file_tests-fixture15.ts diff --git a/cli/tests/bundle/file_tests-subdir-a.ts b/cli/tests/testdata/bundle/file_tests-subdir-a.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-a.ts rename to cli/tests/testdata/bundle/file_tests-subdir-a.ts diff --git a/cli/tests/bundle/file_tests-subdir-b.ts b/cli/tests/testdata/bundle/file_tests-subdir-b.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-b.ts rename to cli/tests/testdata/bundle/file_tests-subdir-b.ts diff --git a/cli/tests/bundle/file_tests-subdir-c.ts b/cli/tests/testdata/bundle/file_tests-subdir-c.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-c.ts rename to cli/tests/testdata/bundle/file_tests-subdir-c.ts diff --git a/cli/tests/bundle/file_tests-subdir-d.ts b/cli/tests/testdata/bundle/file_tests-subdir-d.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-d.ts rename to cli/tests/testdata/bundle/file_tests-subdir-d.ts diff --git a/cli/tests/bundle/file_tests-subdir-e.ts b/cli/tests/testdata/bundle/file_tests-subdir-e.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-e.ts rename to cli/tests/testdata/bundle/file_tests-subdir-e.ts diff --git a/cli/tests/bundle/file_tests-subdir-f.ts b/cli/tests/testdata/bundle/file_tests-subdir-f.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-f.ts rename to cli/tests/testdata/bundle/file_tests-subdir-f.ts diff --git a/cli/tests/bundle/file_tests-subdir-g.ts b/cli/tests/testdata/bundle/file_tests-subdir-g.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-g.ts rename to cli/tests/testdata/bundle/file_tests-subdir-g.ts diff --git a/cli/tests/bundle/file_tests-subdir-h.ts b/cli/tests/testdata/bundle/file_tests-subdir-h.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-h.ts rename to cli/tests/testdata/bundle/file_tests-subdir-h.ts diff --git a/cli/tests/bundle/file_tests-subdir-i.ts b/cli/tests/testdata/bundle/file_tests-subdir-i.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-i.ts rename to cli/tests/testdata/bundle/file_tests-subdir-i.ts diff --git a/cli/tests/bundle/file_tests-subdir-j.ts b/cli/tests/testdata/bundle/file_tests-subdir-j.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-j.ts rename to cli/tests/testdata/bundle/file_tests-subdir-j.ts diff --git a/cli/tests/bundle/file_tests-subdir-k.ts b/cli/tests/testdata/bundle/file_tests-subdir-k.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-k.ts rename to cli/tests/testdata/bundle/file_tests-subdir-k.ts diff --git a/cli/tests/bundle/file_tests-subdir-l.ts b/cli/tests/testdata/bundle/file_tests-subdir-l.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-l.ts rename to cli/tests/testdata/bundle/file_tests-subdir-l.ts diff --git a/cli/tests/bundle/file_tests-subdir-m.ts b/cli/tests/testdata/bundle/file_tests-subdir-m.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-m.ts rename to cli/tests/testdata/bundle/file_tests-subdir-m.ts diff --git a/cli/tests/bundle/file_tests-subdir-n.ts b/cli/tests/testdata/bundle/file_tests-subdir-n.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-n.ts rename to cli/tests/testdata/bundle/file_tests-subdir-n.ts diff --git a/cli/tests/bundle/file_tests-subdir-o.ts b/cli/tests/testdata/bundle/file_tests-subdir-o.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-o.ts rename to cli/tests/testdata/bundle/file_tests-subdir-o.ts diff --git a/cli/tests/bundle/file_tests-subdir-p.ts b/cli/tests/testdata/bundle/file_tests-subdir-p.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-p.ts rename to cli/tests/testdata/bundle/file_tests-subdir-p.ts diff --git a/cli/tests/bundle/file_tests-subdir-q.ts b/cli/tests/testdata/bundle/file_tests-subdir-q.ts similarity index 100% rename from cli/tests/bundle/file_tests-subdir-q.ts rename to cli/tests/testdata/bundle/file_tests-subdir-q.ts diff --git a/cli/tests/bundle/fixture01.out b/cli/tests/testdata/bundle/fixture01.out similarity index 100% rename from cli/tests/bundle/fixture01.out rename to cli/tests/testdata/bundle/fixture01.out diff --git a/cli/tests/bundle/fixture02.out b/cli/tests/testdata/bundle/fixture02.out similarity index 100% rename from cli/tests/bundle/fixture02.out rename to cli/tests/testdata/bundle/fixture02.out diff --git a/cli/tests/bundle/fixture03.out b/cli/tests/testdata/bundle/fixture03.out similarity index 100% rename from cli/tests/bundle/fixture03.out rename to cli/tests/testdata/bundle/fixture03.out diff --git a/cli/tests/bundle/fixture04.out b/cli/tests/testdata/bundle/fixture04.out similarity index 100% rename from cli/tests/bundle/fixture04.out rename to cli/tests/testdata/bundle/fixture04.out diff --git a/cli/tests/bundle/fixture05.out b/cli/tests/testdata/bundle/fixture05.out similarity index 100% rename from cli/tests/bundle/fixture05.out rename to cli/tests/testdata/bundle/fixture05.out diff --git a/cli/tests/bundle/fixture06.out b/cli/tests/testdata/bundle/fixture06.out similarity index 100% rename from cli/tests/bundle/fixture06.out rename to cli/tests/testdata/bundle/fixture06.out diff --git a/cli/tests/bundle/fixture07.out b/cli/tests/testdata/bundle/fixture07.out similarity index 100% rename from cli/tests/bundle/fixture07.out rename to cli/tests/testdata/bundle/fixture07.out diff --git a/cli/tests/bundle/fixture08.out b/cli/tests/testdata/bundle/fixture08.out similarity index 100% rename from cli/tests/bundle/fixture08.out rename to cli/tests/testdata/bundle/fixture08.out diff --git a/cli/tests/bundle/fixture09.out b/cli/tests/testdata/bundle/fixture09.out similarity index 100% rename from cli/tests/bundle/fixture09.out rename to cli/tests/testdata/bundle/fixture09.out diff --git a/cli/tests/bundle/fixture10.out b/cli/tests/testdata/bundle/fixture10.out similarity index 100% rename from cli/tests/bundle/fixture10.out rename to cli/tests/testdata/bundle/fixture10.out diff --git a/cli/tests/bundle/fixture11.out b/cli/tests/testdata/bundle/fixture11.out similarity index 100% rename from cli/tests/bundle/fixture11.out rename to cli/tests/testdata/bundle/fixture11.out diff --git a/cli/tests/bundle/fixture12.out b/cli/tests/testdata/bundle/fixture12.out similarity index 100% rename from cli/tests/bundle/fixture12.out rename to cli/tests/testdata/bundle/fixture12.out diff --git a/cli/tests/bundle/fixture13.out b/cli/tests/testdata/bundle/fixture13.out similarity index 100% rename from cli/tests/bundle/fixture13.out rename to cli/tests/testdata/bundle/fixture13.out diff --git a/cli/tests/bundle/fixture14.out b/cli/tests/testdata/bundle/fixture14.out similarity index 100% rename from cli/tests/bundle/fixture14.out rename to cli/tests/testdata/bundle/fixture14.out diff --git a/cli/tests/bundle/fixture15.out b/cli/tests/testdata/bundle/fixture15.out similarity index 100% rename from cli/tests/bundle/fixture15.out rename to cli/tests/testdata/bundle/fixture15.out diff --git a/cli/tests/bundle/https_deno.land-x-lib-a.ts b/cli/tests/testdata/bundle/https_deno.land-x-lib-a.ts similarity index 100% rename from cli/tests/bundle/https_deno.land-x-lib-a.ts rename to cli/tests/testdata/bundle/https_deno.land-x-lib-a.ts diff --git a/cli/tests/bundle/https_deno.land-x-lib-b.js b/cli/tests/testdata/bundle/https_deno.land-x-lib-b.js similarity index 100% rename from cli/tests/bundle/https_deno.land-x-lib-b.js rename to cli/tests/testdata/bundle/https_deno.land-x-lib-b.js diff --git a/cli/tests/bundle/https_deno.land-x-lib-c.d.ts b/cli/tests/testdata/bundle/https_deno.land-x-lib-c.d.ts similarity index 100% rename from cli/tests/bundle/https_deno.land-x-lib-c.d.ts rename to cli/tests/testdata/bundle/https_deno.land-x-lib-c.d.ts diff --git a/cli/tests/bundle/https_deno.land-x-lib-c.js b/cli/tests/testdata/bundle/https_deno.land-x-lib-c.js similarity index 100% rename from cli/tests/bundle/https_deno.land-x-lib-c.js rename to cli/tests/testdata/bundle/https_deno.land-x-lib-c.js diff --git a/cli/tests/bundle/https_deno.land-x-lib-mod.d.ts b/cli/tests/testdata/bundle/https_deno.land-x-lib-mod.d.ts similarity index 100% rename from cli/tests/bundle/https_deno.land-x-lib-mod.d.ts rename to cli/tests/testdata/bundle/https_deno.land-x-lib-mod.d.ts diff --git a/cli/tests/bundle/https_deno.land-x-lib-mod.js b/cli/tests/testdata/bundle/https_deno.land-x-lib-mod.js similarity index 100% rename from cli/tests/bundle/https_deno.land-x-lib-mod.js rename to cli/tests/testdata/bundle/https_deno.land-x-lib-mod.js diff --git a/cli/tests/testdata/bundle_dynamic_import.ts b/cli/tests/testdata/bundle_dynamic_import.ts new file mode 100644 index 0000000000..d8c7d08ec5 --- /dev/null +++ b/cli/tests/testdata/bundle_dynamic_import.ts @@ -0,0 +1,3 @@ +const mod1 = await import("http://localhost:4545/subdir/mod1.ts"); + +mod1.printHello3(); diff --git a/cli/tests/bundle_im.json b/cli/tests/testdata/bundle_im.json similarity index 100% rename from cli/tests/bundle_im.json rename to cli/tests/testdata/bundle_im.json diff --git a/cli/tests/bundle_im.ts b/cli/tests/testdata/bundle_im.ts similarity index 100% rename from cli/tests/bundle_im.ts rename to cli/tests/testdata/bundle_im.ts diff --git a/cli/tests/bundle_jsx.out b/cli/tests/testdata/bundle_jsx.out similarity index 100% rename from cli/tests/bundle_jsx.out rename to cli/tests/testdata/bundle_jsx.out diff --git a/cli/tests/testdata/cache_extensionless.out b/cli/tests/testdata/cache_extensionless.out new file mode 100644 index 0000000000..3694c67cb7 --- /dev/null +++ b/cli/tests/testdata/cache_extensionless.out @@ -0,0 +1,2 @@ +[WILDCARD] +Check http://localhost:4545/subdir/no_js_ext diff --git a/cli/tests/testdata/cache_random_extension.out b/cli/tests/testdata/cache_random_extension.out new file mode 100644 index 0000000000..745a2e0e31 --- /dev/null +++ b/cli/tests/testdata/cache_random_extension.out @@ -0,0 +1,2 @@ +[WILDCARD] +Check http://localhost:4545/subdir/no_js_ext@1.0.0 diff --git a/cli/tests/testdata/cafile_info.ts b/cli/tests/testdata/cafile_info.ts new file mode 100644 index 0000000000..b41873f737 --- /dev/null +++ b/cli/tests/testdata/cafile_info.ts @@ -0,0 +1,24 @@ +// When run against the test HTTP server, it will serve different media types +// based on the URL containing `.t#.` strings, which exercises the different +// mapping of media types end to end. + +import { loaded as loadedTs1 } from "https://localhost:5545/subdir/mt_text_typescript.t1.ts"; +import { loaded as loadedTs2 } from "https://localhost:5545/subdir/mt_video_vdn.t2.ts"; +import { loaded as loadedTs3 } from "https://localhost:5545/subdir/mt_video_mp2t.t3.ts"; +import { loaded as loadedTs4 } from "https://localhost:5545/subdir/mt_application_x_typescript.t4.ts"; +import { loaded as loadedJs1 } from "https://localhost:5545/subdir/mt_text_javascript.j1.js"; +import { loaded as loadedJs2 } from "https://localhost:5545/subdir/mt_application_ecmascript.j2.js"; +import { loaded as loadedJs3 } from "https://localhost:5545/subdir/mt_text_ecmascript.j3.js"; +import { loaded as loadedJs4 } from "https://localhost:5545/subdir/mt_application_x_javascript.j4.js"; + +console.log( + "success", + loadedTs1, + loadedTs2, + loadedTs3, + loadedTs4, + loadedJs1, + loadedJs2, + loadedJs3, + loadedJs4, +); diff --git a/cli/tests/testdata/cafile_info.ts.out b/cli/tests/testdata/cafile_info.ts.out new file mode 100644 index 0000000000..3ce03961da --- /dev/null +++ b/cli/tests/testdata/cafile_info.ts.out @@ -0,0 +1,13 @@ +local: [WILDCARD]https[WILDCARD]localhost_PORT5545[WILDCARD] +type: TypeScript +dependencies: 8 unique (total [WILDCARD]) + +https://localhost:5545/cafile_info.ts ([WILDCARD]) +├── https://localhost:5545/subdir/mt_application_ecmascript.j2.js ([WILDCARD]) +├── https://localhost:5545/subdir/mt_application_x_javascript.j4.js ([WILDCARD]) +├── https://localhost:5545/subdir/mt_application_x_typescript.t4.ts ([WILDCARD]) +├── https://localhost:5545/subdir/mt_text_ecmascript.j3.js ([WILDCARD]) +├── https://localhost:5545/subdir/mt_text_javascript.j1.js ([WILDCARD]) +├── https://localhost:5545/subdir/mt_text_typescript.t1.ts ([WILDCARD]) +├── https://localhost:5545/subdir/mt_video_mp2t.t3.ts ([WILDCARD]) +└── https://localhost:5545/subdir/mt_video_vdn.t2.ts ([WILDCARD]) diff --git a/cli/tests/cafile_ts_fetch.ts b/cli/tests/testdata/cafile_ts_fetch.ts similarity index 50% rename from cli/tests/cafile_ts_fetch.ts rename to cli/tests/testdata/cafile_ts_fetch.ts index 14f39ef973..03afb6d2f9 100644 --- a/cli/tests/cafile_ts_fetch.ts +++ b/cli/tests/testdata/cafile_ts_fetch.ts @@ -1,3 +1,3 @@ -fetch("https://localhost:5545/cli/tests/cafile_ts_fetch.ts.out") +fetch("https://localhost:5545/cafile_ts_fetch.ts.out") .then((r) => r.text()) .then((t) => console.log(t.trimEnd())); diff --git a/cli/tests/cafile_ts_fetch.ts.out b/cli/tests/testdata/cafile_ts_fetch.ts.out similarity index 100% rename from cli/tests/cafile_ts_fetch.ts.out rename to cli/tests/testdata/cafile_ts_fetch.ts.out diff --git a/cli/tests/cafile_ts_fetch_unsafe_ssl.ts.out b/cli/tests/testdata/cafile_ts_fetch_unsafe_ssl.ts.out similarity index 100% rename from cli/tests/cafile_ts_fetch_unsafe_ssl.ts.out rename to cli/tests/testdata/cafile_ts_fetch_unsafe_ssl.ts.out diff --git a/cli/tests/testdata/cafile_url_imports.ts b/cli/tests/testdata/cafile_url_imports.ts new file mode 100644 index 0000000000..2355a8628d --- /dev/null +++ b/cli/tests/testdata/cafile_url_imports.ts @@ -0,0 +1,3 @@ +import { printHello } from "https://localhost:5545/subdir/mod2.ts"; +printHello(); +console.log("success"); diff --git a/cli/tests/cafile_url_imports.ts.out b/cli/tests/testdata/cafile_url_imports.ts.out similarity index 100% rename from cli/tests/cafile_url_imports.ts.out rename to cli/tests/testdata/cafile_url_imports.ts.out diff --git a/cli/tests/cafile_url_imports_unsafe_ssl.ts.out b/cli/tests/testdata/cafile_url_imports_unsafe_ssl.ts.out similarity index 100% rename from cli/tests/cafile_url_imports_unsafe_ssl.ts.out rename to cli/tests/testdata/cafile_url_imports_unsafe_ssl.ts.out diff --git a/cli/tests/cat.ts b/cli/tests/testdata/cat.ts similarity index 77% rename from cli/tests/cat.ts rename to cli/tests/testdata/cat.ts index 14ceec5530..6d8f150e32 100644 --- a/cli/tests/cat.ts +++ b/cli/tests/testdata/cat.ts @@ -1,4 +1,4 @@ -import { copy } from "../../test_util/std/io/util.ts"; +import { copy } from "../../../test_util/std/io/util.ts"; async function main() { for (let i = 1; i < Deno.args.length; i++) { const filename = Deno.args[i]; diff --git a/cli/tests/circular1.js b/cli/tests/testdata/circular1.js similarity index 100% rename from cli/tests/circular1.js rename to cli/tests/testdata/circular1.js diff --git a/cli/tests/circular1.js.out b/cli/tests/testdata/circular1.js.out similarity index 100% rename from cli/tests/circular1.js.out rename to cli/tests/testdata/circular1.js.out diff --git a/cli/tests/circular2.js b/cli/tests/testdata/circular2.js similarity index 100% rename from cli/tests/circular2.js rename to cli/tests/testdata/circular2.js diff --git a/cli/tests/cjs_imports.ts b/cli/tests/testdata/cjs_imports.ts similarity index 100% rename from cli/tests/cjs_imports.ts rename to cli/tests/testdata/cjs_imports.ts diff --git a/cli/tests/cjs_imports.ts.out b/cli/tests/testdata/cjs_imports.ts.out similarity index 100% rename from cli/tests/cjs_imports.ts.out rename to cli/tests/testdata/cjs_imports.ts.out diff --git a/cli/tests/commonjs.cjs b/cli/tests/testdata/commonjs.cjs similarity index 100% rename from cli/tests/commonjs.cjs rename to cli/tests/testdata/commonjs.cjs diff --git a/cli/tests/compiler_api_test.ts b/cli/tests/testdata/compiler_api_test.ts similarity index 98% rename from cli/tests/compiler_api_test.ts rename to cli/tests/testdata/compiler_api_test.ts index 2e0a8820c3..92eb4c519e 100644 --- a/cli/tests/compiler_api_test.ts +++ b/cli/tests/testdata/compiler_api_test.ts @@ -4,7 +4,7 @@ import { assertEquals, assertStringIncludes, assertThrowsAsync, -} from "../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/testing/asserts.ts"; Deno.test({ name: "Deno.emit() - sources provided", @@ -40,8 +40,8 @@ Deno.test({ assertEquals(stats.length, 12); const keys = Object.keys(files).sort(); assertEquals(keys.length, 6); - assert(keys[0].endsWith("cli/tests/subdir/mod1.ts.js")); - assert(keys[1].endsWith("cli/tests/subdir/mod1.ts.js.map")); + assert(keys[0].endsWith("subdir/mod1.ts.js")); + assert(keys[1].endsWith("subdir/mod1.ts.js.map")); }, }); diff --git a/cli/tests/complex_permissions_test.ts b/cli/tests/testdata/complex_permissions_test.ts similarity index 100% rename from cli/tests/complex_permissions_test.ts rename to cli/tests/testdata/complex_permissions_test.ts diff --git a/cli/tests/config.ts b/cli/tests/testdata/config.ts similarity index 100% rename from cli/tests/config.ts rename to cli/tests/testdata/config.ts diff --git a/cli/tests/config.ts.out b/cli/tests/testdata/config.ts.out similarity index 86% rename from cli/tests/config.ts.out rename to cli/tests/testdata/config.ts.out index 99b4a7ea4f..9f8a8ddd16 100644 --- a/cli/tests/config.ts.out +++ b/cli/tests/testdata/config.ts.out @@ -4,4 +4,4 @@ error: TS1219 [ERROR]: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. a() { ^ - at file:///[WILDCARD]cli/tests/config.ts:[WILDCARD] + at file:///[WILDCARD]/config.ts:[WILDCARD] diff --git a/cli/tests/config.tsconfig.json b/cli/tests/testdata/config.tsconfig.json similarity index 100% rename from cli/tests/config.tsconfig.json rename to cli/tests/testdata/config.tsconfig.json diff --git a/cli/tests/config_types.ts b/cli/tests/testdata/config_types.ts similarity index 100% rename from cli/tests/config_types.ts rename to cli/tests/testdata/config_types.ts diff --git a/cli/tests/config_types.ts.out b/cli/tests/testdata/config_types.ts.out similarity index 100% rename from cli/tests/config_types.ts.out rename to cli/tests/testdata/config_types.ts.out diff --git a/cli/tests/config_types.tsconfig.json b/cli/tests/testdata/config_types.tsconfig.json similarity index 100% rename from cli/tests/config_types.tsconfig.json rename to cli/tests/testdata/config_types.tsconfig.json diff --git a/cli/tests/testdata/config_types_remote.tsconfig.json b/cli/tests/testdata/config_types_remote.tsconfig.json new file mode 100644 index 0000000000..f40d5b1c46 --- /dev/null +++ b/cli/tests/testdata/config_types_remote.tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "types": [ + "http://localhost:4545/subdir/types.d.ts" + ] + } +} diff --git a/cli/tests/coverage/branch.ts b/cli/tests/testdata/coverage/branch.ts similarity index 100% rename from cli/tests/coverage/branch.ts rename to cli/tests/testdata/coverage/branch.ts diff --git a/cli/tests/coverage/branch_test.ts b/cli/tests/testdata/coverage/branch_test.ts similarity index 100% rename from cli/tests/coverage/branch_test.ts rename to cli/tests/testdata/coverage/branch_test.ts diff --git a/cli/tests/coverage/complex.ts b/cli/tests/testdata/coverage/complex.ts similarity index 100% rename from cli/tests/coverage/complex.ts rename to cli/tests/testdata/coverage/complex.ts diff --git a/cli/tests/coverage/complex_test.ts b/cli/tests/testdata/coverage/complex_test.ts similarity index 100% rename from cli/tests/coverage/complex_test.ts rename to cli/tests/testdata/coverage/complex_test.ts diff --git a/cli/tests/coverage/expected_branch.lcov b/cli/tests/testdata/coverage/expected_branch.lcov similarity index 100% rename from cli/tests/coverage/expected_branch.lcov rename to cli/tests/testdata/coverage/expected_branch.lcov diff --git a/cli/tests/coverage/expected_branch.out b/cli/tests/testdata/coverage/expected_branch.out similarity index 100% rename from cli/tests/coverage/expected_branch.out rename to cli/tests/testdata/coverage/expected_branch.out diff --git a/cli/tests/coverage/expected_complex.lcov b/cli/tests/testdata/coverage/expected_complex.lcov similarity index 100% rename from cli/tests/coverage/expected_complex.lcov rename to cli/tests/testdata/coverage/expected_complex.lcov diff --git a/cli/tests/coverage/expected_complex.out b/cli/tests/testdata/coverage/expected_complex.out similarity index 100% rename from cli/tests/coverage/expected_complex.out rename to cli/tests/testdata/coverage/expected_complex.out diff --git a/cli/tests/delayed_error.ts b/cli/tests/testdata/delayed_error.ts similarity index 100% rename from cli/tests/delayed_error.ts rename to cli/tests/testdata/delayed_error.ts diff --git a/cli/tests/deno_doc.out b/cli/tests/testdata/deno_doc.out similarity index 100% rename from cli/tests/deno_doc.out rename to cli/tests/testdata/deno_doc.out diff --git a/cli/tests/deno_doc.ts b/cli/tests/testdata/deno_doc.ts similarity index 100% rename from cli/tests/deno_doc.ts rename to cli/tests/testdata/deno_doc.ts diff --git a/cli/tests/deno_doc_builtin.out b/cli/tests/testdata/deno_doc_builtin.out similarity index 100% rename from cli/tests/deno_doc_builtin.out rename to cli/tests/testdata/deno_doc_builtin.out diff --git a/cli/tests/deno_dom_0.1.3-alpha2.wasm b/cli/tests/testdata/deno_dom_0.1.3-alpha2.wasm similarity index 100% rename from cli/tests/deno_dom_0.1.3-alpha2.wasm rename to cli/tests/testdata/deno_dom_0.1.3-alpha2.wasm diff --git a/cli/tests/deno_land_unsafe_ssl.ts b/cli/tests/testdata/deno_land_unsafe_ssl.ts similarity index 100% rename from cli/tests/deno_land_unsafe_ssl.ts rename to cli/tests/testdata/deno_land_unsafe_ssl.ts diff --git a/cli/tests/deno_land_unsafe_ssl.ts.out b/cli/tests/testdata/deno_land_unsafe_ssl.ts.out similarity index 100% rename from cli/tests/deno_land_unsafe_ssl.ts.out rename to cli/tests/testdata/deno_land_unsafe_ssl.ts.out diff --git a/cli/tests/disallow_http_from_https.js b/cli/tests/testdata/disallow_http_from_https.js similarity index 57% rename from cli/tests/disallow_http_from_https.js rename to cli/tests/testdata/disallow_http_from_https.js index fd30a023da..bff407b5ec 100644 --- a/cli/tests/disallow_http_from_https.js +++ b/cli/tests/testdata/disallow_http_from_https.js @@ -1,2 +1,2 @@ // Trying to import "http://", while this file is accessed by "https://" -import "http://localhost:4545/cli/tests/001_hello.js"; +import "http://localhost:4545/001_hello.js"; diff --git a/cli/tests/disallow_http_from_https.ts b/cli/tests/testdata/disallow_http_from_https.ts similarity index 57% rename from cli/tests/disallow_http_from_https.ts rename to cli/tests/testdata/disallow_http_from_https.ts index fd30a023da..bff407b5ec 100644 --- a/cli/tests/disallow_http_from_https.ts +++ b/cli/tests/testdata/disallow_http_from_https.ts @@ -1,2 +1,2 @@ // Trying to import "http://", while this file is accessed by "https://" -import "http://localhost:4545/cli/tests/001_hello.js"; +import "http://localhost:4545/001_hello.js"; diff --git a/cli/tests/testdata/disallow_http_from_https_js.out b/cli/tests/testdata/disallow_http_from_https_js.out new file mode 100644 index 0000000000..3219b7d35e --- /dev/null +++ b/cli/tests/testdata/disallow_http_from_https_js.out @@ -0,0 +1,3 @@ +error: Modules imported via https are not allowed to import http modules. + Importing: http://localhost:4545/001_hello.js + at https://localhost:5545/disallow_http_from_https.js:2:0 diff --git a/cli/tests/testdata/disallow_http_from_https_ts.out b/cli/tests/testdata/disallow_http_from_https_ts.out new file mode 100644 index 0000000000..d1ab64394c --- /dev/null +++ b/cli/tests/testdata/disallow_http_from_https_ts.out @@ -0,0 +1,3 @@ +error: Modules imported via https are not allowed to import http modules. + Importing: http://localhost:4545/001_hello.js + at https://localhost:5545/disallow_http_from_https.ts:2:0 diff --git a/cli/tests/doc/import_map.json b/cli/tests/testdata/doc/import_map.json similarity index 100% rename from cli/tests/doc/import_map.json rename to cli/tests/testdata/doc/import_map.json diff --git a/cli/tests/doc/invalid_url.out b/cli/tests/testdata/doc/invalid_url.out similarity index 100% rename from cli/tests/doc/invalid_url.out rename to cli/tests/testdata/doc/invalid_url.out diff --git a/cli/tests/doc/module/fun.js b/cli/tests/testdata/doc/module/fun.js similarity index 100% rename from cli/tests/doc/module/fun.js rename to cli/tests/testdata/doc/module/fun.js diff --git a/cli/tests/doc/types_header.out b/cli/tests/testdata/doc/types_header.out similarity index 100% rename from cli/tests/doc/types_header.out rename to cli/tests/testdata/doc/types_header.out diff --git a/cli/tests/doc/types_header.ts b/cli/tests/testdata/doc/types_header.ts similarity index 100% rename from cli/tests/doc/types_header.ts rename to cli/tests/testdata/doc/types_header.ts diff --git a/cli/tests/doc/types_hint.out b/cli/tests/testdata/doc/types_hint.out similarity index 100% rename from cli/tests/doc/types_hint.out rename to cli/tests/testdata/doc/types_hint.out diff --git a/cli/tests/doc/types_hint.ts b/cli/tests/testdata/doc/types_hint.ts similarity index 100% rename from cli/tests/doc/types_hint.ts rename to cli/tests/testdata/doc/types_hint.ts diff --git a/cli/tests/doc/types_ref.js b/cli/tests/testdata/doc/types_ref.js similarity index 100% rename from cli/tests/doc/types_ref.js rename to cli/tests/testdata/doc/types_ref.js diff --git a/cli/tests/doc/types_ref.out b/cli/tests/testdata/doc/types_ref.out similarity index 100% rename from cli/tests/doc/types_ref.out rename to cli/tests/testdata/doc/types_ref.out diff --git a/cli/tests/doc/use_import_map.js b/cli/tests/testdata/doc/use_import_map.js similarity index 100% rename from cli/tests/doc/use_import_map.js rename to cli/tests/testdata/doc/use_import_map.js diff --git a/cli/tests/doc/use_import_map.out b/cli/tests/testdata/doc/use_import_map.out similarity index 100% rename from cli/tests/doc/use_import_map.out rename to cli/tests/testdata/doc/use_import_map.out diff --git a/cli/tests/dynamic_import/b.js b/cli/tests/testdata/dynamic_import/b.js similarity index 100% rename from cli/tests/dynamic_import/b.js rename to cli/tests/testdata/dynamic_import/b.js diff --git a/cli/tests/dynamic_import/c.js b/cli/tests/testdata/dynamic_import/c.js similarity index 100% rename from cli/tests/dynamic_import/c.js rename to cli/tests/testdata/dynamic_import/c.js diff --git a/cli/tests/dynamic_import/permissions_blob_local.ts b/cli/tests/testdata/dynamic_import/permissions_blob_local.ts similarity index 100% rename from cli/tests/dynamic_import/permissions_blob_local.ts rename to cli/tests/testdata/dynamic_import/permissions_blob_local.ts diff --git a/cli/tests/dynamic_import/permissions_blob_local.ts.out b/cli/tests/testdata/dynamic_import/permissions_blob_local.ts.out similarity index 70% rename from cli/tests/dynamic_import/permissions_blob_local.ts.out rename to cli/tests/testdata/dynamic_import/permissions_blob_local.ts.out index 5a2da0536e..6dfa8e527a 100644 --- a/cli/tests/dynamic_import/permissions_blob_local.ts.out +++ b/cli/tests/testdata/dynamic_import/permissions_blob_local.ts.out @@ -2,4 +2,4 @@ error: Uncaught (in promise) TypeError: Requires read access to "[WILDCARD]local at blob:null/[WILDCARD]:1:0 await import(URL.createObjectURL(blob)); ^ - at async file:///[WILDCARD]/cli/tests/dynamic_import/permissions_blob_local.ts:6:1 + at async file:///[WILDCARD]/dynamic_import/permissions_blob_local.ts:6:1 diff --git a/cli/tests/dynamic_import/permissions_blob_remote.ts b/cli/tests/testdata/dynamic_import/permissions_blob_remote.ts similarity index 100% rename from cli/tests/dynamic_import/permissions_blob_remote.ts rename to cli/tests/testdata/dynamic_import/permissions_blob_remote.ts diff --git a/cli/tests/dynamic_import/permissions_blob_remote.ts.out b/cli/tests/testdata/dynamic_import/permissions_blob_remote.ts.out similarity index 68% rename from cli/tests/dynamic_import/permissions_blob_remote.ts.out rename to cli/tests/testdata/dynamic_import/permissions_blob_remote.ts.out index 7992e08554..60d71ed6d6 100644 --- a/cli/tests/dynamic_import/permissions_blob_remote.ts.out +++ b/cli/tests/testdata/dynamic_import/permissions_blob_remote.ts.out @@ -2,4 +2,4 @@ error: Uncaught (in promise) TypeError: Requires net access to "example.com", ru at blob:null/[WILDCARD]:1:0 await import(URL.createObjectURL(blob)); ^ - at async file:///[WILDCARD]/cli/tests/dynamic_import/permissions_blob_remote.ts:4:1 + at async file:///[WILDCARD]/dynamic_import/permissions_blob_remote.ts:4:1 diff --git a/cli/tests/dynamic_import/permissions_data_local.ts b/cli/tests/testdata/dynamic_import/permissions_data_local.ts similarity index 100% rename from cli/tests/dynamic_import/permissions_data_local.ts rename to cli/tests/testdata/dynamic_import/permissions_data_local.ts diff --git a/cli/tests/dynamic_import/permissions_data_local.ts.out b/cli/tests/testdata/dynamic_import/permissions_data_local.ts.out similarity index 74% rename from cli/tests/dynamic_import/permissions_data_local.ts.out rename to cli/tests/testdata/dynamic_import/permissions_data_local.ts.out index 39686740ad..c9fcb0a173 100644 --- a/cli/tests/dynamic_import/permissions_data_local.ts.out +++ b/cli/tests/testdata/dynamic_import/permissions_data_local.ts.out @@ -2,4 +2,4 @@ error: Uncaught (in promise) TypeError: Requires read access to "[WILDCARD]local at data:application/javascript;base64,[WILDCARD]:1:0 await import(`data:application/javascript;base64,${btoa(code)}`); ^ - at async file:///[WILDCARD]/cli/tests/dynamic_import/permissions_data_local.ts:5:1 + at async file:///[WILDCARD]/dynamic_import/permissions_data_local.ts:5:1 diff --git a/cli/tests/dynamic_import/permissions_data_remote.ts b/cli/tests/testdata/dynamic_import/permissions_data_remote.ts similarity index 100% rename from cli/tests/dynamic_import/permissions_data_remote.ts rename to cli/tests/testdata/dynamic_import/permissions_data_remote.ts diff --git a/cli/tests/dynamic_import/permissions_data_remote.ts.out b/cli/tests/testdata/dynamic_import/permissions_data_remote.ts.out similarity index 76% rename from cli/tests/dynamic_import/permissions_data_remote.ts.out rename to cli/tests/testdata/dynamic_import/permissions_data_remote.ts.out index 6bb1370913..772f0b51e2 100644 --- a/cli/tests/dynamic_import/permissions_data_remote.ts.out +++ b/cli/tests/testdata/dynamic_import/permissions_data_remote.ts.out @@ -2,4 +2,4 @@ error: Uncaught (in promise) TypeError: Requires net access to "example.com", ru at data:application/javascript;base64,aW1wb3J0ICJodHRwczovL2V4YW1wbGUuY29tL3NvbWUvZmlsZS50cyI7:1:0 await import(`data:application/javascript;base64,${btoa(code)}`); ^ - at async file:///[WILDCARD]/cli/tests/dynamic_import/permissions_data_remote.ts:3:1 + at async file:///[WILDCARD]/dynamic_import/permissions_data_remote.ts:3:1 diff --git a/cli/tests/testdata/dynamic_import/permissions_remote_remote.ts b/cli/tests/testdata/dynamic_import/permissions_remote_remote.ts new file mode 100644 index 0000000000..0033bcccce --- /dev/null +++ b/cli/tests/testdata/dynamic_import/permissions_remote_remote.ts @@ -0,0 +1,3 @@ +await import( + "http://localhost:4545/dynamic_import/static_remote.ts" +); diff --git a/cli/tests/testdata/dynamic_import/permissions_remote_remote.ts.out b/cli/tests/testdata/dynamic_import/permissions_remote_remote.ts.out new file mode 100644 index 0000000000..cd7f58bb94 --- /dev/null +++ b/cli/tests/testdata/dynamic_import/permissions_remote_remote.ts.out @@ -0,0 +1,5 @@ +error: Uncaught (in promise) TypeError: Requires net access to "example.com", run again with the --allow-net flag + at http://localhost:4545/dynamic_import/static_remote.ts:2:0 +await import( +^ + at async file:///[WILDCARD]/dynamic_import/permissions_remote_remote.ts:1:1 diff --git a/cli/tests/dynamic_import/static_remote.ts b/cli/tests/testdata/dynamic_import/static_remote.ts similarity index 100% rename from cli/tests/dynamic_import/static_remote.ts rename to cli/tests/testdata/dynamic_import/static_remote.ts diff --git a/cli/tests/dynamic_import_conditional.js b/cli/tests/testdata/dynamic_import_conditional.js similarity index 100% rename from cli/tests/dynamic_import_conditional.js rename to cli/tests/testdata/dynamic_import_conditional.js diff --git a/cli/tests/dynamic_import_conditional.js.out b/cli/tests/testdata/dynamic_import_conditional.js.out similarity index 100% rename from cli/tests/dynamic_import_conditional.js.out rename to cli/tests/testdata/dynamic_import_conditional.js.out diff --git a/cli/tests/echo.ts b/cli/tests/testdata/echo.ts similarity index 100% rename from cli/tests/echo.ts rename to cli/tests/testdata/echo.ts diff --git a/cli/tests/echo_server.ts b/cli/tests/testdata/echo_server.ts similarity index 85% rename from cli/tests/echo_server.ts rename to cli/tests/testdata/echo_server.ts index 84284bea11..b23867cddc 100644 --- a/cli/tests/echo_server.ts +++ b/cli/tests/testdata/echo_server.ts @@ -1,4 +1,4 @@ -import { copy } from "../../test_util/std/io/util.ts"; +import { copy } from "../../../test_util/std/io/util.ts"; const addr = Deno.args[0] || "0.0.0.0:4544"; const [hostname, port] = addr.split(":"); const listener = Deno.listen({ hostname, port: Number(port) }); diff --git a/cli/tests/encoding/utf-16be.ts b/cli/tests/testdata/encoding/utf-16be.ts similarity index 100% rename from cli/tests/encoding/utf-16be.ts rename to cli/tests/testdata/encoding/utf-16be.ts diff --git a/cli/tests/encoding/utf-16le.ts b/cli/tests/testdata/encoding/utf-16le.ts similarity index 100% rename from cli/tests/encoding/utf-16le.ts rename to cli/tests/testdata/encoding/utf-16le.ts diff --git a/cli/tests/encoding/utf-8.ts b/cli/tests/testdata/encoding/utf-8.ts similarity index 100% rename from cli/tests/encoding/utf-8.ts rename to cli/tests/testdata/encoding/utf-8.ts diff --git a/cli/tests/encoding/windows-1255 b/cli/tests/testdata/encoding/windows-1255 similarity index 100% rename from cli/tests/encoding/windows-1255 rename to cli/tests/testdata/encoding/windows-1255 diff --git a/cli/tests/error_001.ts b/cli/tests/testdata/error_001.ts similarity index 100% rename from cli/tests/error_001.ts rename to cli/tests/testdata/error_001.ts diff --git a/cli/tests/testdata/error_001.ts.out b/cli/tests/testdata/error_001.ts.out new file mode 100644 index 0000000000..25664a9a45 --- /dev/null +++ b/cli/tests/testdata/error_001.ts.out @@ -0,0 +1,6 @@ +[WILDCARD]error: Uncaught Error: bad + throw Error("bad"); + ^ + at foo ([WILDCARD]/error_001.ts:2:9) + at bar ([WILDCARD]/error_001.ts:6:3) + at [WILDCARD]/error_001.ts:9:1 diff --git a/cli/tests/error_002.ts b/cli/tests/testdata/error_002.ts similarity index 100% rename from cli/tests/error_002.ts rename to cli/tests/testdata/error_002.ts diff --git a/cli/tests/testdata/error_002.ts.out b/cli/tests/testdata/error_002.ts.out new file mode 100644 index 0000000000..96b9e602af --- /dev/null +++ b/cli/tests/testdata/error_002.ts.out @@ -0,0 +1,6 @@ +[WILDCARD]error: Uncaught Error: exception from mod1 + throw Error("exception from mod1"); + ^ + at throwsError ([WILDCARD]/subdir/mod1.ts:16:9) + at foo ([WILDCARD]/error_002.ts:4:3) + at [WILDCARD]/error_002.ts:7:1 diff --git a/cli/tests/error_003_typescript.ts b/cli/tests/testdata/error_003_typescript.ts similarity index 100% rename from cli/tests/error_003_typescript.ts rename to cli/tests/testdata/error_003_typescript.ts diff --git a/cli/tests/error_003_typescript.ts.out b/cli/tests/testdata/error_003_typescript.ts.out similarity index 84% rename from cli/tests/error_003_typescript.ts.out rename to cli/tests/testdata/error_003_typescript.ts.out index 49cd274f42..bbb2ec4708 100644 --- a/cli/tests/error_003_typescript.ts.out +++ b/cli/tests/testdata/error_003_typescript.ts.out @@ -4,4 +4,4 @@ error: TS2322 [ERROR]: Type '{ a: { b: { c(): { d: number; }; }; }; }' is not as Type 'number' is not assignable to type 'string'. x = y; ^ - at [WILDCARD]/tests/error_003_typescript.ts:20:1 + at [WILDCARD]/error_003_typescript.ts:20:1 diff --git a/cli/tests/error_004_missing_module.ts b/cli/tests/testdata/error_004_missing_module.ts similarity index 100% rename from cli/tests/error_004_missing_module.ts rename to cli/tests/testdata/error_004_missing_module.ts diff --git a/cli/tests/testdata/error_004_missing_module.ts.out b/cli/tests/testdata/error_004_missing_module.ts.out new file mode 100644 index 0000000000..8521f4424b --- /dev/null +++ b/cli/tests/testdata/error_004_missing_module.ts.out @@ -0,0 +1,2 @@ +[WILDCARD]error: Cannot resolve module "file:///[WILDCARD]/bad-module.ts" from "file:///[WILDCARD]/error_004_missing_module.ts". + at file:///[WILDCARD]/error_004_missing_module.ts:1:0 diff --git a/cli/tests/error_005_missing_dynamic_import.ts b/cli/tests/testdata/error_005_missing_dynamic_import.ts similarity index 100% rename from cli/tests/error_005_missing_dynamic_import.ts rename to cli/tests/testdata/error_005_missing_dynamic_import.ts diff --git a/cli/tests/error_005_missing_dynamic_import.ts.out b/cli/tests/testdata/error_005_missing_dynamic_import.ts.out similarity index 85% rename from cli/tests/error_005_missing_dynamic_import.ts.out rename to cli/tests/testdata/error_005_missing_dynamic_import.ts.out index da680e1957..e8647a44e9 100644 --- a/cli/tests/error_005_missing_dynamic_import.ts.out +++ b/cli/tests/testdata/error_005_missing_dynamic_import.ts.out @@ -1,4 +1,4 @@ -error: Uncaught (in promise) TypeError: Cannot resolve module "[WILDCARD]/cli/tests/bad-module.ts". +error: Uncaught (in promise) TypeError: Cannot resolve module "[WILDCARD]/bad-module.ts". const _badModule = await import("./bad-module.ts"); ^ at async file://[WILDCARD]/error_005_missing_dynamic_import.ts:2:22 diff --git a/cli/tests/error_006_import_ext_failure.ts b/cli/tests/testdata/error_006_import_ext_failure.ts similarity index 100% rename from cli/tests/error_006_import_ext_failure.ts rename to cli/tests/testdata/error_006_import_ext_failure.ts diff --git a/cli/tests/error_006_import_ext_failure.ts.out b/cli/tests/testdata/error_006_import_ext_failure.ts.out similarity index 62% rename from cli/tests/error_006_import_ext_failure.ts.out rename to cli/tests/testdata/error_006_import_ext_failure.ts.out index 601e527cf3..24d819e5d3 100644 --- a/cli/tests/error_006_import_ext_failure.ts.out +++ b/cli/tests/testdata/error_006_import_ext_failure.ts.out @@ -1,2 +1,2 @@ [WILDCARD]error: Cannot resolve module "[WILDCARD]/non-existent" from "[WILDCARD]/error_006_import_ext_failure.ts". - at file:///[WILDCARD]cli/tests/error_006_import_ext_failure.ts:1:0 + at file:///[WILDCARD]/error_006_import_ext_failure.ts:1:0 diff --git a/cli/tests/error_007_any.ts b/cli/tests/testdata/error_007_any.ts similarity index 100% rename from cli/tests/error_007_any.ts rename to cli/tests/testdata/error_007_any.ts diff --git a/cli/tests/error_007_any.ts.out b/cli/tests/testdata/error_007_any.ts.out similarity index 100% rename from cli/tests/error_007_any.ts.out rename to cli/tests/testdata/error_007_any.ts.out diff --git a/cli/tests/error_008_checkjs.js b/cli/tests/testdata/error_008_checkjs.js similarity index 100% rename from cli/tests/error_008_checkjs.js rename to cli/tests/testdata/error_008_checkjs.js diff --git a/cli/tests/error_008_checkjs.js.out b/cli/tests/testdata/error_008_checkjs.js.out similarity index 66% rename from cli/tests/error_008_checkjs.js.out rename to cli/tests/testdata/error_008_checkjs.js.out index 2d93ffd017..e43187382b 100644 --- a/cli/tests/error_008_checkjs.js.out +++ b/cli/tests/testdata/error_008_checkjs.js.out @@ -1,4 +1,4 @@ [WILDCARD]error: Uncaught ReferenceError: consol is not defined consol.log("hello world!"); ^ - at [WILDCARD]tests/error_008_checkjs.js:2:1 + at [WILDCARD]/error_008_checkjs.js:2:1 diff --git a/cli/tests/error_009_extensions_error.js b/cli/tests/testdata/error_009_extensions_error.js similarity index 100% rename from cli/tests/error_009_extensions_error.js rename to cli/tests/testdata/error_009_extensions_error.js diff --git a/cli/tests/error_009_extensions_error.js.out b/cli/tests/testdata/error_009_extensions_error.js.out similarity index 100% rename from cli/tests/error_009_extensions_error.js.out rename to cli/tests/testdata/error_009_extensions_error.js.out diff --git a/cli/tests/error_009_missing_js_module.disabled b/cli/tests/testdata/error_009_missing_js_module.disabled similarity index 100% rename from cli/tests/error_009_missing_js_module.disabled rename to cli/tests/testdata/error_009_missing_js_module.disabled diff --git a/cli/tests/error_009_missing_js_module.js b/cli/tests/testdata/error_009_missing_js_module.js similarity index 100% rename from cli/tests/error_009_missing_js_module.js rename to cli/tests/testdata/error_009_missing_js_module.js diff --git a/cli/tests/error_009_missing_js_module.js.out b/cli/tests/testdata/error_009_missing_js_module.js.out similarity index 100% rename from cli/tests/error_009_missing_js_module.js.out rename to cli/tests/testdata/error_009_missing_js_module.js.out diff --git a/cli/tests/error_010_nonexistent_arg.disabled b/cli/tests/testdata/error_010_nonexistent_arg.disabled similarity index 100% rename from cli/tests/error_010_nonexistent_arg.disabled rename to cli/tests/testdata/error_010_nonexistent_arg.disabled diff --git a/cli/tests/error_010_nonexistent_arg.out b/cli/tests/testdata/error_010_nonexistent_arg.out similarity index 100% rename from cli/tests/error_010_nonexistent_arg.out rename to cli/tests/testdata/error_010_nonexistent_arg.out diff --git a/cli/tests/error_011_bad_module_specifier.ts b/cli/tests/testdata/error_011_bad_module_specifier.ts similarity index 100% rename from cli/tests/error_011_bad_module_specifier.ts rename to cli/tests/testdata/error_011_bad_module_specifier.ts diff --git a/cli/tests/error_011_bad_module_specifier.ts.out b/cli/tests/testdata/error_011_bad_module_specifier.ts.out similarity index 100% rename from cli/tests/error_011_bad_module_specifier.ts.out rename to cli/tests/testdata/error_011_bad_module_specifier.ts.out diff --git a/cli/tests/error_012_bad_dynamic_import_specifier.ts b/cli/tests/testdata/error_012_bad_dynamic_import_specifier.ts similarity index 100% rename from cli/tests/error_012_bad_dynamic_import_specifier.ts rename to cli/tests/testdata/error_012_bad_dynamic_import_specifier.ts diff --git a/cli/tests/error_012_bad_dynamic_import_specifier.ts.out b/cli/tests/testdata/error_012_bad_dynamic_import_specifier.ts.out similarity index 100% rename from cli/tests/error_012_bad_dynamic_import_specifier.ts.out rename to cli/tests/testdata/error_012_bad_dynamic_import_specifier.ts.out diff --git a/cli/tests/error_013_missing_script.out b/cli/tests/testdata/error_013_missing_script.out similarity index 100% rename from cli/tests/error_013_missing_script.out rename to cli/tests/testdata/error_013_missing_script.out diff --git a/cli/tests/error_014_catch_dynamic_import_error.js b/cli/tests/testdata/error_014_catch_dynamic_import_error.js similarity index 100% rename from cli/tests/error_014_catch_dynamic_import_error.js rename to cli/tests/testdata/error_014_catch_dynamic_import_error.js diff --git a/cli/tests/error_014_catch_dynamic_import_error.js.out b/cli/tests/testdata/error_014_catch_dynamic_import_error.js.out similarity index 86% rename from cli/tests/error_014_catch_dynamic_import_error.js.out rename to cli/tests/testdata/error_014_catch_dynamic_import_error.js.out index 60de400db9..8f2d695f73 100644 --- a/cli/tests/error_014_catch_dynamic_import_error.js.out +++ b/cli/tests/testdata/error_014_catch_dynamic_import_error.js.out @@ -6,7 +6,7 @@ TypeError: Relative import path "does not exist either" not prefixed with / or . at async file:///[WILDCARD]/error_014_catch_dynamic_import_error.js:10:5 Caught error thrown by dynamically imported module. Error: An error - at file:///[WILDCARD]tests/subdir/throws.js:6:7 + at file:///[WILDCARD]/subdir/throws.js:6:7 Caught error thrown indirectly by dynamically imported module. Error: An error - at file:///[WILDCARD]tests/subdir/throws.js:6:7 + at file:///[WILDCARD]/subdir/throws.js:6:7 diff --git a/cli/tests/testdata/error_015_dynamic_import_permissions.js b/cli/tests/testdata/error_015_dynamic_import_permissions.js new file mode 100644 index 0000000000..73da56fd89 --- /dev/null +++ b/cli/tests/testdata/error_015_dynamic_import_permissions.js @@ -0,0 +1,3 @@ +(async () => { + await import("http://localhost:4545/subdir/mod4.js"); +})(); diff --git a/cli/tests/error_015_dynamic_import_permissions.out b/cli/tests/testdata/error_015_dynamic_import_permissions.out similarity index 74% rename from cli/tests/error_015_dynamic_import_permissions.out rename to cli/tests/testdata/error_015_dynamic_import_permissions.out index de6585dcd3..a509cfdab6 100644 --- a/cli/tests/error_015_dynamic_import_permissions.out +++ b/cli/tests/testdata/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/cli/tests/subdir/mod4.js"); + await import("http://localhost:4545/subdir/mod4.js"); ^ at async file:///[WILDCARD]/error_015_dynamic_import_permissions.js:2:3 diff --git a/cli/tests/error_016_dynamic_import_permissions2.js b/cli/tests/testdata/error_016_dynamic_import_permissions2.js similarity index 64% rename from cli/tests/error_016_dynamic_import_permissions2.js rename to cli/tests/testdata/error_016_dynamic_import_permissions2.js index 34e1a43d2d..f018d4a2ef 100644 --- a/cli/tests/error_016_dynamic_import_permissions2.js +++ b/cli/tests/testdata/error_016_dynamic_import_permissions2.js @@ -1,5 +1,5 @@ // If this is executed with --allow-net but not --allow-read the following // import should cause a permission denied error. (async () => { - await import("http://localhost:4545/cli/tests/subdir/evil_remote_import.js"); + await import("http://localhost:4545/subdir/evil_remote_import.js"); })(); diff --git a/cli/tests/error_016_dynamic_import_permissions2.out b/cli/tests/testdata/error_016_dynamic_import_permissions2.out similarity index 67% rename from cli/tests/error_016_dynamic_import_permissions2.out rename to cli/tests/testdata/error_016_dynamic_import_permissions2.out index f54b4a7fe0..0b43c5b910 100644 --- a/cli/tests/error_016_dynamic_import_permissions2.out +++ b/cli/tests/testdata/error_016_dynamic_import_permissions2.out @@ -1,4 +1,4 @@ [WILDCARD] error: Remote modules are not allowed to import local modules. Consider using a dynamic import instead. Importing: file:///c:/etc/passwd - at http://localhost:4545/cli/tests/subdir/evil_remote_import.js:3:0 + at http://localhost:4545/subdir/evil_remote_import.js:3:0 diff --git a/cli/tests/error_017_hide_long_source_ts.ts b/cli/tests/testdata/error_017_hide_long_source_ts.ts similarity index 100% rename from cli/tests/error_017_hide_long_source_ts.ts rename to cli/tests/testdata/error_017_hide_long_source_ts.ts diff --git a/cli/tests/error_017_hide_long_source_ts.ts.out b/cli/tests/testdata/error_017_hide_long_source_ts.ts.out similarity index 52% rename from cli/tests/error_017_hide_long_source_ts.ts.out rename to cli/tests/testdata/error_017_hide_long_source_ts.ts.out index 52c2f7cc22..917061ab9c 100644 --- a/cli/tests/error_017_hide_long_source_ts.ts.out +++ b/cli/tests/testdata/error_017_hide_long_source_ts.ts.out @@ -1,3 +1,3 @@ [WILDCARD] error: TS2532 [ERROR]: Object is possibly 'undefined'. - at [WILDCARD]tests/error_017_hide_long_source_ts.ts:3:1 + at [WILDCARD]/error_017_hide_long_source_ts.ts:3:1 diff --git a/cli/tests/error_018_hide_long_source_js.js b/cli/tests/testdata/error_018_hide_long_source_js.js similarity index 100% rename from cli/tests/error_018_hide_long_source_js.js rename to cli/tests/testdata/error_018_hide_long_source_js.js diff --git a/cli/tests/error_018_hide_long_source_js.js.out b/cli/tests/testdata/error_018_hide_long_source_js.js.out similarity index 50% rename from cli/tests/error_018_hide_long_source_js.js.out rename to cli/tests/testdata/error_018_hide_long_source_js.js.out index c83778dc0e..cc98669a76 100644 --- a/cli/tests/error_018_hide_long_source_js.js.out +++ b/cli/tests/testdata/error_018_hide_long_source_js.js.out @@ -1,2 +1,2 @@ error: Uncaught TypeError: Cannot read properties of undefined (reading 'a') - at file:///[WILDCARD]cli/tests/error_018_hide_long_source_js.js:3:206 + at file:///[WILDCARD]/error_018_hide_long_source_js.js:3:206 diff --git a/cli/tests/error_019_stack_function.ts b/cli/tests/testdata/error_019_stack_function.ts similarity index 100% rename from cli/tests/error_019_stack_function.ts rename to cli/tests/testdata/error_019_stack_function.ts diff --git a/cli/tests/testdata/error_019_stack_function.ts.out b/cli/tests/testdata/error_019_stack_function.ts.out new file mode 100644 index 0000000000..03967d12b9 --- /dev/null +++ b/cli/tests/testdata/error_019_stack_function.ts.out @@ -0,0 +1,8 @@ +[WILDCARD]Error: function + at foo ([WILDCARD]/error_019_stack_function.ts:[WILDCARD]) + at [WILDCARD]/error_019_stack_function.ts:[WILDCARD] +error: Uncaught Error: function + throw new Error("function"); + ^ + at foo ([WILDCARD]/error_019_stack_function.ts:[WILDCARD]) + at [WILDCARD]/error_019_stack_function.ts:[WILDCARD] diff --git a/cli/tests/error_020_stack_constructor.ts b/cli/tests/testdata/error_020_stack_constructor.ts similarity index 100% rename from cli/tests/error_020_stack_constructor.ts rename to cli/tests/testdata/error_020_stack_constructor.ts diff --git a/cli/tests/testdata/error_020_stack_constructor.ts.out b/cli/tests/testdata/error_020_stack_constructor.ts.out new file mode 100644 index 0000000000..01fdfb3c4e --- /dev/null +++ b/cli/tests/testdata/error_020_stack_constructor.ts.out @@ -0,0 +1,8 @@ +[WILDCARD]Error: constructor + at new A ([WILDCARD]/error_020_stack_constructor.ts:[WILDCARD]) + at [WILDCARD]/error_020_stack_constructor.ts:[WILDCARD] +error: Uncaught Error: constructor + throw new Error("constructor"); + ^ + at new A ([WILDCARD]/error_020_stack_constructor.ts:[WILDCARD]) + at [WILDCARD]/error_020_stack_constructor.ts:[WILDCARD] diff --git a/cli/tests/error_021_stack_method.ts b/cli/tests/testdata/error_021_stack_method.ts similarity index 100% rename from cli/tests/error_021_stack_method.ts rename to cli/tests/testdata/error_021_stack_method.ts diff --git a/cli/tests/testdata/error_021_stack_method.ts.out b/cli/tests/testdata/error_021_stack_method.ts.out new file mode 100644 index 0000000000..999f0aaa0c --- /dev/null +++ b/cli/tests/testdata/error_021_stack_method.ts.out @@ -0,0 +1,8 @@ +[WILDCARD]Error: method + at A.m ([WILDCARD]/error_021_stack_method.ts:[WILDCARD]) + at [WILDCARD]/error_021_stack_method.ts:[WILDCARD] +error: Uncaught Error: method + throw new Error("method"); + ^ + at A.m ([WILDCARD]/error_021_stack_method.ts:[WILDCARD]) + at [WILDCARD]/error_021_stack_method.ts:[WILDCARD] diff --git a/cli/tests/error_022_stack_custom_error.ts b/cli/tests/testdata/error_022_stack_custom_error.ts similarity index 100% rename from cli/tests/error_022_stack_custom_error.ts rename to cli/tests/testdata/error_022_stack_custom_error.ts diff --git a/cli/tests/testdata/error_022_stack_custom_error.ts.out b/cli/tests/testdata/error_022_stack_custom_error.ts.out new file mode 100644 index 0000000000..78b0dcaea8 --- /dev/null +++ b/cli/tests/testdata/error_022_stack_custom_error.ts.out @@ -0,0 +1,6 @@ +[WILDCARD]CustomError: custom error + at [WILDCARD]/error_022_stack_custom_error.ts:[WILDCARD] +error: Uncaught CustomError: custom error +const error = new CustomError(); + ^ + at [WILDCARD]/error_022_stack_custom_error.ts:[WILDCARD] diff --git a/cli/tests/error_023_stack_async.ts b/cli/tests/testdata/error_023_stack_async.ts similarity index 100% rename from cli/tests/error_023_stack_async.ts rename to cli/tests/testdata/error_023_stack_async.ts diff --git a/cli/tests/testdata/error_023_stack_async.ts.out b/cli/tests/testdata/error_023_stack_async.ts.out new file mode 100644 index 0000000000..95f0eae64b --- /dev/null +++ b/cli/tests/testdata/error_023_stack_async.ts.out @@ -0,0 +1,10 @@ +[WILDCARD]Error: async + at [WILDCARD]/error_023_stack_async.ts:[WILDCARD] + at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] + at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] +error: Uncaught Error: async + throw new Error("async"); + ^ + at [WILDCARD]/error_023_stack_async.ts:[WILDCARD] + at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] + at async [WILDCARD]/error_023_stack_async.ts:[WILDCARD] diff --git a/cli/tests/error_024_stack_promise_all.ts b/cli/tests/testdata/error_024_stack_promise_all.ts similarity index 100% rename from cli/tests/error_024_stack_promise_all.ts rename to cli/tests/testdata/error_024_stack_promise_all.ts diff --git a/cli/tests/testdata/error_024_stack_promise_all.ts.out b/cli/tests/testdata/error_024_stack_promise_all.ts.out new file mode 100644 index 0000000000..6cd88715c0 --- /dev/null +++ b/cli/tests/testdata/error_024_stack_promise_all.ts.out @@ -0,0 +1,10 @@ +[WILDCARD]Error: Promise.all() + at [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] + at async Promise.all (index 1) + at async [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] +error: Uncaught Error: Promise.all() + throw new Error("Promise.all()"); + ^ + at [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] + at async Promise.all (index 1) + at async [WILDCARD]/error_024_stack_promise_all.ts:[WILDCARD] diff --git a/cli/tests/error_025_tab_indent b/cli/tests/testdata/error_025_tab_indent similarity index 100% rename from cli/tests/error_025_tab_indent rename to cli/tests/testdata/error_025_tab_indent diff --git a/cli/tests/testdata/error_025_tab_indent.out b/cli/tests/testdata/error_025_tab_indent.out new file mode 100644 index 0000000000..f1466ce3f6 --- /dev/null +++ b/cli/tests/testdata/error_025_tab_indent.out @@ -0,0 +1,6 @@ +[WILDCARD]error: Uncaught Error: bad + throw Error("bad"); + ^ + at foo ([WILDCARD]/error_025_tab_indent:2:8) + at bar ([WILDCARD]/error_025_tab_indent:6:2) + at [WILDCARD]/error_025_tab_indent:9:1 diff --git a/cli/tests/testdata/error_026_remote_import_error.ts b/cli/tests/testdata/error_026_remote_import_error.ts new file mode 100644 index 0000000000..2718e768af --- /dev/null +++ b/cli/tests/testdata/error_026_remote_import_error.ts @@ -0,0 +1 @@ +import "http://localhost:4545/error_001.ts"; diff --git a/cli/tests/testdata/error_026_remote_import_error.ts.out b/cli/tests/testdata/error_026_remote_import_error.ts.out new file mode 100644 index 0000000000..bec0cf1c56 --- /dev/null +++ b/cli/tests/testdata/error_026_remote_import_error.ts.out @@ -0,0 +1,7 @@ +[WILDCARD]error: Uncaught Error: bad + throw Error("bad"); + ^ + at foo (http://localhost:4545/error_001.ts:2:9) + at bar (http://localhost:4545/error_001.ts:6:3) + at http://localhost:4545/error_001.ts:9:1 +[WILDCARD] diff --git a/cli/tests/error_027_bundle_with_bare_import.ts b/cli/tests/testdata/error_027_bundle_with_bare_import.ts similarity index 100% rename from cli/tests/error_027_bundle_with_bare_import.ts rename to cli/tests/testdata/error_027_bundle_with_bare_import.ts diff --git a/cli/tests/error_027_bundle_with_bare_import.ts.out b/cli/tests/testdata/error_027_bundle_with_bare_import.ts.out similarity index 100% rename from cli/tests/error_027_bundle_with_bare_import.ts.out rename to cli/tests/testdata/error_027_bundle_with_bare_import.ts.out diff --git a/cli/tests/error_import_map_unable_to_load.out b/cli/tests/testdata/error_import_map_unable_to_load.out similarity index 100% rename from cli/tests/error_import_map_unable_to_load.out rename to cli/tests/testdata/error_import_map_unable_to_load.out diff --git a/cli/tests/error_local_static_import_from_remote.js b/cli/tests/testdata/error_local_static_import_from_remote.js similarity index 100% rename from cli/tests/error_local_static_import_from_remote.js rename to cli/tests/testdata/error_local_static_import_from_remote.js diff --git a/cli/tests/error_local_static_import_from_remote.js.out b/cli/tests/testdata/error_local_static_import_from_remote.js.out similarity index 64% rename from cli/tests/error_local_static_import_from_remote.js.out rename to cli/tests/testdata/error_local_static_import_from_remote.js.out index 071ca36d4f..44b6765327 100644 --- a/cli/tests/error_local_static_import_from_remote.js.out +++ b/cli/tests/testdata/error_local_static_import_from_remote.js.out @@ -1,4 +1,4 @@ [WILDCARD] error: Remote modules are not allowed to import local modules. Consider using a dynamic import instead. Importing: file:///some/dir/file.js - at http://localhost:4545/cli/tests/error_local_static_import_from_remote.js:1:0 + at http://localhost:4545/error_local_static_import_from_remote.js:1:0 diff --git a/cli/tests/error_local_static_import_from_remote.ts b/cli/tests/testdata/error_local_static_import_from_remote.ts similarity index 100% rename from cli/tests/error_local_static_import_from_remote.ts rename to cli/tests/testdata/error_local_static_import_from_remote.ts diff --git a/cli/tests/error_local_static_import_from_remote.ts.out b/cli/tests/testdata/error_local_static_import_from_remote.ts.out similarity index 64% rename from cli/tests/error_local_static_import_from_remote.ts.out rename to cli/tests/testdata/error_local_static_import_from_remote.ts.out index 38f4c02bcc..f8f409de0e 100644 --- a/cli/tests/error_local_static_import_from_remote.ts.out +++ b/cli/tests/testdata/error_local_static_import_from_remote.ts.out @@ -1,4 +1,4 @@ [WILDCARD] error: Remote modules are not allowed to import local modules. Consider using a dynamic import instead. Importing: file:///some/dir/file.ts - at http://localhost:4545/cli/tests/error_local_static_import_from_remote.ts:1:0 + at http://localhost:4545/error_local_static_import_from_remote.ts:1:0 diff --git a/cli/tests/error_missing_module_named_import.ts b/cli/tests/testdata/error_missing_module_named_import.ts similarity index 100% rename from cli/tests/error_missing_module_named_import.ts rename to cli/tests/testdata/error_missing_module_named_import.ts diff --git a/cli/tests/testdata/error_missing_module_named_import.ts.out b/cli/tests/testdata/error_missing_module_named_import.ts.out new file mode 100644 index 0000000000..6f09f0c0d5 --- /dev/null +++ b/cli/tests/testdata/error_missing_module_named_import.ts.out @@ -0,0 +1,2 @@ +error: Cannot resolve module "[WILDCARD]/does_not_exist.js" from "[WILDCARD]/error_missing_module_named_import.ts". + at [WILDCARD]/error_missing_module_named_import.ts:1:0 diff --git a/cli/tests/error_no_check.ts b/cli/tests/testdata/error_no_check.ts similarity index 100% rename from cli/tests/error_no_check.ts rename to cli/tests/testdata/error_no_check.ts diff --git a/cli/tests/error_no_check.ts.out b/cli/tests/testdata/error_no_check.ts.out similarity index 100% rename from cli/tests/error_no_check.ts.out rename to cli/tests/testdata/error_no_check.ts.out diff --git a/cli/tests/error_syntax.js b/cli/tests/testdata/error_syntax.js similarity index 100% rename from cli/tests/error_syntax.js rename to cli/tests/testdata/error_syntax.js diff --git a/cli/tests/testdata/error_syntax.js.out b/cli/tests/testdata/error_syntax.js.out new file mode 100644 index 0000000000..4c2a007f17 --- /dev/null +++ b/cli/tests/testdata/error_syntax.js.out @@ -0,0 +1 @@ +error: Expected ,, got following at [WILDCARD]/error_syntax.js:3:5 diff --git a/cli/tests/error_syntax_empty_trailing_line.mjs b/cli/tests/testdata/error_syntax_empty_trailing_line.mjs similarity index 100% rename from cli/tests/error_syntax_empty_trailing_line.mjs rename to cli/tests/testdata/error_syntax_empty_trailing_line.mjs diff --git a/cli/tests/testdata/error_syntax_empty_trailing_line.mjs.out b/cli/tests/testdata/error_syntax_empty_trailing_line.mjs.out new file mode 100644 index 0000000000..daa37818dc --- /dev/null +++ b/cli/tests/testdata/error_syntax_empty_trailing_line.mjs.out @@ -0,0 +1 @@ +error: Unexpected eof at [WILDCARD]/error_syntax_empty_trailing_line.mjs:2:21 diff --git a/cli/tests/error_type_definitions.ts b/cli/tests/testdata/error_type_definitions.ts similarity index 100% rename from cli/tests/error_type_definitions.ts rename to cli/tests/testdata/error_type_definitions.ts diff --git a/cli/tests/error_type_definitions.ts.out b/cli/tests/testdata/error_type_definitions.ts.out similarity index 100% rename from cli/tests/error_type_definitions.ts.out rename to cli/tests/testdata/error_type_definitions.ts.out diff --git a/cli/tests/error_worker_permissions_local.ts b/cli/tests/testdata/error_worker_permissions_local.ts similarity index 100% rename from cli/tests/error_worker_permissions_local.ts rename to cli/tests/testdata/error_worker_permissions_local.ts diff --git a/cli/tests/error_worker_permissions_local.ts.out b/cli/tests/testdata/error_worker_permissions_local.ts.out similarity index 100% rename from cli/tests/error_worker_permissions_local.ts.out rename to cli/tests/testdata/error_worker_permissions_local.ts.out diff --git a/cli/tests/testdata/error_worker_permissions_remote.ts b/cli/tests/testdata/error_worker_permissions_remote.ts new file mode 100644 index 0000000000..878c7080a7 --- /dev/null +++ b/cli/tests/testdata/error_worker_permissions_remote.ts @@ -0,0 +1,4 @@ +new Worker( + "http://localhost:4545/subdir/worker_types.ts", + { type: "module" }, +); diff --git a/cli/tests/error_worker_permissions_remote.ts.out b/cli/tests/testdata/error_worker_permissions_remote.ts.out similarity index 100% rename from cli/tests/error_worker_permissions_remote.ts.out rename to cli/tests/testdata/error_worker_permissions_remote.ts.out diff --git a/cli/tests/es_private_fields.js b/cli/tests/testdata/es_private_fields.js similarity index 100% rename from cli/tests/es_private_fields.js rename to cli/tests/testdata/es_private_fields.js diff --git a/cli/tests/es_private_fields.js.out b/cli/tests/testdata/es_private_fields.js.out similarity index 100% rename from cli/tests/es_private_fields.js.out rename to cli/tests/testdata/es_private_fields.js.out diff --git a/cli/tests/esm_imports_a.js b/cli/tests/testdata/esm_imports_a.js similarity index 100% rename from cli/tests/esm_imports_a.js rename to cli/tests/testdata/esm_imports_a.js diff --git a/cli/tests/esm_imports_b.js b/cli/tests/testdata/esm_imports_b.js similarity index 100% rename from cli/tests/esm_imports_b.js rename to cli/tests/testdata/esm_imports_b.js diff --git a/cli/tests/exec_path.ts b/cli/tests/testdata/exec_path.ts similarity index 100% rename from cli/tests/exec_path.ts rename to cli/tests/testdata/exec_path.ts diff --git a/cli/tests/exit_error42.ts b/cli/tests/testdata/exit_error42.ts similarity index 100% rename from cli/tests/exit_error42.ts rename to cli/tests/testdata/exit_error42.ts diff --git a/cli/tests/exit_error42.ts.out b/cli/tests/testdata/exit_error42.ts.out similarity index 100% rename from cli/tests/exit_error42.ts.out rename to cli/tests/testdata/exit_error42.ts.out diff --git a/cli/tests/export_type_def.ts b/cli/tests/testdata/export_type_def.ts similarity index 100% rename from cli/tests/export_type_def.ts rename to cli/tests/testdata/export_type_def.ts diff --git a/cli/tests/fetch/hello.txt b/cli/tests/testdata/fetch/hello.txt similarity index 100% rename from cli/tests/fetch/hello.txt rename to cli/tests/testdata/fetch/hello.txt diff --git a/cli/tests/testdata/fetch/other.ts b/cli/tests/testdata/fetch/other.ts new file mode 100644 index 0000000000..91fe376b38 --- /dev/null +++ b/cli/tests/testdata/fetch/other.ts @@ -0,0 +1 @@ +import "http://localhost:4545/subdir/mt_text_typescript.t1.ts"; diff --git a/cli/tests/testdata/fetch/test.ts b/cli/tests/testdata/fetch/test.ts new file mode 100644 index 0000000000..baa52775d4 --- /dev/null +++ b/cli/tests/testdata/fetch/test.ts @@ -0,0 +1 @@ +import "http://localhost:4545/subdir/mod2.ts"; diff --git a/cli/tests/fetch_response_finalization.js b/cli/tests/testdata/fetch_response_finalization.js similarity index 100% rename from cli/tests/fetch_response_finalization.js rename to cli/tests/testdata/fetch_response_finalization.js diff --git a/cli/tests/fetch_response_finalization.js.out b/cli/tests/testdata/fetch_response_finalization.js.out similarity index 100% rename from cli/tests/fetch_response_finalization.js.out rename to cli/tests/testdata/fetch_response_finalization.js.out diff --git a/cli/tests/file_exists.ts b/cli/tests/testdata/file_exists.ts similarity index 100% rename from cli/tests/file_exists.ts rename to cli/tests/testdata/file_exists.ts diff --git a/cli/tests/finalization_registry.js b/cli/tests/testdata/finalization_registry.js similarity index 100% rename from cli/tests/finalization_registry.js rename to cli/tests/testdata/finalization_registry.js diff --git a/cli/tests/finalization_registry.js.out b/cli/tests/testdata/finalization_registry.js.out similarity index 100% rename from cli/tests/finalization_registry.js.out rename to cli/tests/testdata/finalization_registry.js.out diff --git a/cli/tests/fix_dynamic_import_errors.js b/cli/tests/testdata/fix_dynamic_import_errors.js similarity index 100% rename from cli/tests/fix_dynamic_import_errors.js rename to cli/tests/testdata/fix_dynamic_import_errors.js diff --git a/cli/tests/fix_dynamic_import_errors.js.out b/cli/tests/testdata/fix_dynamic_import_errors.js.out similarity index 100% rename from cli/tests/fix_dynamic_import_errors.js.out rename to cli/tests/testdata/fix_dynamic_import_errors.js.out diff --git a/cli/tests/fix_emittable_skipped.js b/cli/tests/testdata/fix_emittable_skipped.js similarity index 100% rename from cli/tests/fix_emittable_skipped.js rename to cli/tests/testdata/fix_emittable_skipped.js diff --git a/cli/tests/fix_emittable_skipped.ts.out b/cli/tests/testdata/fix_emittable_skipped.ts.out similarity index 100% rename from cli/tests/fix_emittable_skipped.ts.out rename to cli/tests/testdata/fix_emittable_skipped.ts.out diff --git a/cli/tests/fix_exotic_specifiers.ts b/cli/tests/testdata/fix_exotic_specifiers.ts similarity index 100% rename from cli/tests/fix_exotic_specifiers.ts rename to cli/tests/testdata/fix_exotic_specifiers.ts diff --git a/cli/tests/fix_exotic_specifiers.ts.out b/cli/tests/testdata/fix_exotic_specifiers.ts.out similarity index 100% rename from cli/tests/fix_exotic_specifiers.ts.out rename to cli/tests/testdata/fix_exotic_specifiers.ts.out diff --git a/cli/tests/fix_js_import_js.ts b/cli/tests/testdata/fix_js_import_js.ts similarity index 100% rename from cli/tests/fix_js_import_js.ts rename to cli/tests/testdata/fix_js_import_js.ts diff --git a/cli/tests/fix_js_import_js.ts.out b/cli/tests/testdata/fix_js_import_js.ts.out similarity index 100% rename from cli/tests/fix_js_import_js.ts.out rename to cli/tests/testdata/fix_js_import_js.ts.out diff --git a/cli/tests/fix_js_imports.ts b/cli/tests/testdata/fix_js_imports.ts similarity index 100% rename from cli/tests/fix_js_imports.ts rename to cli/tests/testdata/fix_js_imports.ts diff --git a/cli/tests/fix_js_imports.ts.out b/cli/tests/testdata/fix_js_imports.ts.out similarity index 100% rename from cli/tests/fix_js_imports.ts.out rename to cli/tests/testdata/fix_js_imports.ts.out diff --git a/cli/tests/fix_tsc_file_exists.out b/cli/tests/testdata/fix_tsc_file_exists.out similarity index 100% rename from cli/tests/fix_tsc_file_exists.out rename to cli/tests/testdata/fix_tsc_file_exists.out diff --git a/cli/tests/fix_worker_dispatchevent.ts b/cli/tests/testdata/fix_worker_dispatchevent.ts similarity index 100% rename from cli/tests/fix_worker_dispatchevent.ts rename to cli/tests/testdata/fix_worker_dispatchevent.ts diff --git a/cli/tests/fix_worker_dispatchevent.ts.out b/cli/tests/testdata/fix_worker_dispatchevent.ts.out similarity index 100% rename from cli/tests/fix_worker_dispatchevent.ts.out rename to cli/tests/testdata/fix_worker_dispatchevent.ts.out diff --git a/cli/tests/fixture.json b/cli/tests/testdata/fixture.json similarity index 100% rename from cli/tests/fixture.json rename to cli/tests/testdata/fixture.json diff --git a/cli/tests/fmt/expected_fmt_check_formatted_files.out b/cli/tests/testdata/fmt/expected_fmt_check_formatted_files.out similarity index 100% rename from cli/tests/fmt/expected_fmt_check_formatted_files.out rename to cli/tests/testdata/fmt/expected_fmt_check_formatted_files.out diff --git a/cli/tests/fmt/expected_fmt_check_ignore.out b/cli/tests/testdata/fmt/expected_fmt_check_ignore.out similarity index 100% rename from cli/tests/fmt/expected_fmt_check_ignore.out rename to cli/tests/testdata/fmt/expected_fmt_check_ignore.out diff --git a/cli/tests/fmt/expected_fmt_check_tests_dir.out b/cli/tests/testdata/fmt/expected_fmt_check_tests_dir.out similarity index 100% rename from cli/tests/fmt/expected_fmt_check_tests_dir.out rename to cli/tests/testdata/fmt/expected_fmt_check_tests_dir.out diff --git a/cli/tests/fmt/expected_fmt_check_verbose_formatted_files.out b/cli/tests/testdata/fmt/expected_fmt_check_verbose_formatted_files.out similarity index 100% rename from cli/tests/fmt/expected_fmt_check_verbose_formatted_files.out rename to cli/tests/testdata/fmt/expected_fmt_check_verbose_formatted_files.out diff --git a/cli/tests/fmt/expected_fmt_check_verbose_tests_dir.out b/cli/tests/testdata/fmt/expected_fmt_check_verbose_tests_dir.out similarity index 100% rename from cli/tests/fmt/expected_fmt_check_verbose_tests_dir.out rename to cli/tests/testdata/fmt/expected_fmt_check_verbose_tests_dir.out diff --git a/cli/tests/fmt/formatted1.js b/cli/tests/testdata/fmt/formatted1.js similarity index 100% rename from cli/tests/fmt/formatted1.js rename to cli/tests/testdata/fmt/formatted1.js diff --git a/cli/tests/fmt/formatted2.ts b/cli/tests/testdata/fmt/formatted2.ts similarity index 100% rename from cli/tests/fmt/formatted2.ts rename to cli/tests/testdata/fmt/formatted2.ts diff --git a/cli/tests/fmt/formatted3.md b/cli/tests/testdata/fmt/formatted3.md similarity index 100% rename from cli/tests/fmt/formatted3.md rename to cli/tests/testdata/fmt/formatted3.md diff --git a/cli/tests/fmt/formatted4.jsonc b/cli/tests/testdata/fmt/formatted4.jsonc similarity index 100% rename from cli/tests/fmt/formatted4.jsonc rename to cli/tests/testdata/fmt/formatted4.jsonc diff --git a/cli/tests/heapstats.js b/cli/tests/testdata/heapstats.js similarity index 100% rename from cli/tests/heapstats.js rename to cli/tests/testdata/heapstats.js diff --git a/cli/tests/heapstats.js.out b/cli/tests/testdata/heapstats.js.out similarity index 100% rename from cli/tests/heapstats.js.out rename to cli/tests/testdata/heapstats.js.out diff --git a/cli/tests/hello.txt b/cli/tests/testdata/hello.txt similarity index 100% rename from cli/tests/hello.txt rename to cli/tests/testdata/hello.txt diff --git a/cli/tests/testdata/https_import.ts b/cli/tests/testdata/https_import.ts new file mode 100644 index 0000000000..3bcc903264 --- /dev/null +++ b/cli/tests/testdata/https_import.ts @@ -0,0 +1,3 @@ +import { printHello } from "https://localhost:5545/subdir/print_hello.ts"; + +printHello(); diff --git a/cli/tests/https_import.ts.out b/cli/tests/testdata/https_import.ts.out similarity index 100% rename from cli/tests/https_import.ts.out rename to cli/tests/testdata/https_import.ts.out diff --git a/cli/tests/if_main.ts b/cli/tests/testdata/if_main.ts similarity index 100% rename from cli/tests/if_main.ts rename to cli/tests/testdata/if_main.ts diff --git a/cli/tests/if_main.ts.out b/cli/tests/testdata/if_main.ts.out similarity index 100% rename from cli/tests/if_main.ts.out rename to cli/tests/testdata/if_main.ts.out diff --git a/cli/tests/ignore_require.js b/cli/tests/testdata/ignore_require.js similarity index 100% rename from cli/tests/ignore_require.js rename to cli/tests/testdata/ignore_require.js diff --git a/cli/tests/import_blob_url.ts b/cli/tests/testdata/import_blob_url.ts similarity index 100% rename from cli/tests/import_blob_url.ts rename to cli/tests/testdata/import_blob_url.ts diff --git a/cli/tests/import_blob_url.ts.out b/cli/tests/testdata/import_blob_url.ts.out similarity index 100% rename from cli/tests/import_blob_url.ts.out rename to cli/tests/testdata/import_blob_url.ts.out diff --git a/cli/tests/import_blob_url_error_stack.ts b/cli/tests/testdata/import_blob_url_error_stack.ts similarity index 100% rename from cli/tests/import_blob_url_error_stack.ts rename to cli/tests/testdata/import_blob_url_error_stack.ts diff --git a/cli/tests/import_blob_url_error_stack.ts.out b/cli/tests/testdata/import_blob_url_error_stack.ts.out similarity index 67% rename from cli/tests/import_blob_url_error_stack.ts.out rename to cli/tests/testdata/import_blob_url_error_stack.ts.out index 18ca023e33..52b76fd5c2 100644 --- a/cli/tests/import_blob_url_error_stack.ts.out +++ b/cli/tests/testdata/import_blob_url_error_stack.ts.out @@ -2,5 +2,5 @@ throw new Error(`Hello ${A.C}`); ^ at a (blob:null/[WILDCARD]:8:10) - at file:///[WILDCARD]/cli/tests/import_blob_url_error_stack.ts:13:1 + at file:///[WILDCARD]/import_blob_url_error_stack.ts:13:1 [WILDCARD] diff --git a/cli/tests/import_blob_url_import_relative.ts b/cli/tests/testdata/import_blob_url_import_relative.ts similarity index 100% rename from cli/tests/import_blob_url_import_relative.ts rename to cli/tests/testdata/import_blob_url_import_relative.ts diff --git a/cli/tests/import_blob_url_import_relative.ts.out b/cli/tests/testdata/import_blob_url_import_relative.ts.out similarity index 62% rename from cli/tests/import_blob_url_import_relative.ts.out rename to cli/tests/testdata/import_blob_url_import_relative.ts.out index 9d47ab7195..77f399763b 100644 --- a/cli/tests/import_blob_url_import_relative.ts.out +++ b/cli/tests/testdata/import_blob_url_import_relative.ts.out @@ -1,4 +1,4 @@ error: Uncaught (in promise) TypeError: invalid URL: relative URL with a cannot-be-a-base base const a = await import(url); ^ - at async file://[WILDCARD]/cli/tests/import_blob_url_import_relative.ts:6:11 + at async file://[WILDCARD]/import_blob_url_import_relative.ts:6:11 diff --git a/cli/tests/import_blob_url_imports.ts b/cli/tests/testdata/import_blob_url_imports.ts similarity index 67% rename from cli/tests/import_blob_url_imports.ts rename to cli/tests/testdata/import_blob_url_imports.ts index 7c2b108654..a7c639152d 100644 --- a/cli/tests/import_blob_url_imports.ts +++ b/cli/tests/testdata/import_blob_url_imports.ts @@ -1,6 +1,6 @@ const blob = new Blob( [ - 'export { printHello } from "http://localhost:4545/cli/tests/subdir/mod2.ts"', + 'export { printHello } from "http://localhost:4545/subdir/mod2.ts"', ], { type: "application/javascript" }, ); diff --git a/cli/tests/import_blob_url_imports.ts.out b/cli/tests/testdata/import_blob_url_imports.ts.out similarity index 100% rename from cli/tests/import_blob_url_imports.ts.out rename to cli/tests/testdata/import_blob_url_imports.ts.out diff --git a/cli/tests/import_blob_url_jsx.ts b/cli/tests/testdata/import_blob_url_jsx.ts similarity index 100% rename from cli/tests/import_blob_url_jsx.ts rename to cli/tests/testdata/import_blob_url_jsx.ts diff --git a/cli/tests/import_blob_url_jsx.ts.out b/cli/tests/testdata/import_blob_url_jsx.ts.out similarity index 100% rename from cli/tests/import_blob_url_jsx.ts.out rename to cli/tests/testdata/import_blob_url_jsx.ts.out diff --git a/cli/tests/import_data_url.ts b/cli/tests/testdata/import_data_url.ts similarity index 100% rename from cli/tests/import_data_url.ts rename to cli/tests/testdata/import_data_url.ts diff --git a/cli/tests/import_data_url.ts.out b/cli/tests/testdata/import_data_url.ts.out similarity index 100% rename from cli/tests/import_data_url.ts.out rename to cli/tests/testdata/import_data_url.ts.out diff --git a/cli/tests/import_data_url_error_stack.ts b/cli/tests/testdata/import_data_url_error_stack.ts similarity index 100% rename from cli/tests/import_data_url_error_stack.ts rename to cli/tests/testdata/import_data_url_error_stack.ts diff --git a/cli/tests/import_data_url_error_stack.ts.out b/cli/tests/testdata/import_data_url_error_stack.ts.out similarity index 79% rename from cli/tests/import_data_url_error_stack.ts.out rename to cli/tests/testdata/import_data_url_error_stack.ts.out index 466c1beed0..d456ad0ea4 100644 --- a/cli/tests/import_data_url_error_stack.ts.out +++ b/cli/tests/testdata/import_data_url_error_stack.ts.out @@ -2,5 +2,5 @@ throw new Error(`Hello ${A.C}`); ^ at a (data:application/typescript;base64,ZW51bSBBIHsKICBBLAogIEIsCiAgQywKIH0KIAogZXhwb3J0IGZ1bmN0aW9uIGEoKSB7CiAgIHRocm93IG5ldyBFcnJvcihgSGVsbG8gJHtBLkN9YCk7CiB9CiA=:8:10) - at file:///[WILDCARD]/cli/tests/import_data_url_error_stack.ts:3:1 + at file:///[WILDCARD]/import_data_url_error_stack.ts:3:1 [WILDCARD] diff --git a/cli/tests/import_data_url_import_relative.ts b/cli/tests/testdata/import_data_url_import_relative.ts similarity index 100% rename from cli/tests/import_data_url_import_relative.ts rename to cli/tests/testdata/import_data_url_import_relative.ts diff --git a/cli/tests/import_data_url_import_relative.ts.out b/cli/tests/testdata/import_data_url_import_relative.ts.out similarity index 100% rename from cli/tests/import_data_url_import_relative.ts.out rename to cli/tests/testdata/import_data_url_import_relative.ts.out diff --git a/cli/tests/import_data_url_imports.ts b/cli/tests/testdata/import_data_url_imports.ts similarity index 53% rename from cli/tests/import_data_url_imports.ts rename to cli/tests/testdata/import_data_url_imports.ts index f25c2c3895..df7dae7272 100644 --- a/cli/tests/import_data_url_imports.ts +++ b/cli/tests/testdata/import_data_url_imports.ts @@ -1,4 +1,4 @@ -// export { printHello } from "http://localhost:4545/cli/tests/subdir/mod2.ts"; -import { printHello } from "data:application/typescript;base64,ZXhwb3J0IHsgcHJpbnRIZWxsbyB9IGZyb20gImh0dHA6Ly9sb2NhbGhvc3Q6NDU0NS9jbGkvdGVzdHMvc3ViZGlyL21vZDIudHMiOwo="; +// export { printHello } from "http://localhost:4545/subdir/mod2.ts"; +import { printHello } from "data:application/typescript;base64,ZXhwb3J0IHsgcHJpbnRIZWxsbyB9IGZyb20gImh0dHA6Ly9sb2NhbGhvc3Q6NDU0NS9zdWJkaXIvbW9kMi50cyI7"; printHello(); diff --git a/cli/tests/import_data_url_imports.ts.out b/cli/tests/testdata/import_data_url_imports.ts.out similarity index 100% rename from cli/tests/import_data_url_imports.ts.out rename to cli/tests/testdata/import_data_url_imports.ts.out diff --git a/cli/tests/import_data_url_jsx.ts b/cli/tests/testdata/import_data_url_jsx.ts similarity index 100% rename from cli/tests/import_data_url_jsx.ts rename to cli/tests/testdata/import_data_url_jsx.ts diff --git a/cli/tests/import_data_url_jsx.ts.out b/cli/tests/testdata/import_data_url_jsx.ts.out similarity index 100% rename from cli/tests/import_data_url_jsx.ts.out rename to cli/tests/testdata/import_data_url_jsx.ts.out diff --git a/cli/tests/import_dynamic_data_url.ts b/cli/tests/testdata/import_dynamic_data_url.ts similarity index 100% rename from cli/tests/import_dynamic_data_url.ts rename to cli/tests/testdata/import_dynamic_data_url.ts diff --git a/cli/tests/import_dynamic_data_url.ts.out b/cli/tests/testdata/import_dynamic_data_url.ts.out similarity index 100% rename from cli/tests/import_dynamic_data_url.ts.out rename to cli/tests/testdata/import_dynamic_data_url.ts.out diff --git a/cli/tests/testdata/import_file_with_colon.ts b/cli/tests/testdata/import_file_with_colon.ts new file mode 100644 index 0000000000..619bdd66d7 --- /dev/null +++ b/cli/tests/testdata/import_file_with_colon.ts @@ -0,0 +1 @@ +import "http://localhost:4545/subdir/file_with_:_in_name.ts"; diff --git a/cli/tests/import_file_with_colon.ts.out b/cli/tests/testdata/import_file_with_colon.ts.out similarity index 100% rename from cli/tests/import_file_with_colon.ts.out rename to cli/tests/testdata/import_file_with_colon.ts.out diff --git a/cli/tests/import_maps/import_map.json b/cli/tests/testdata/import_maps/import_map.json similarity index 100% rename from cli/tests/import_maps/import_map.json rename to cli/tests/testdata/import_maps/import_map.json diff --git a/cli/tests/import_maps/import_map_remote.json b/cli/tests/testdata/import_maps/import_map_remote.json similarity index 100% rename from cli/tests/import_maps/import_map_remote.json rename to cli/tests/testdata/import_maps/import_map_remote.json diff --git a/cli/tests/import_maps/lodash/lodash.ts b/cli/tests/testdata/import_maps/lodash/lodash.ts similarity index 100% rename from cli/tests/import_maps/lodash/lodash.ts rename to cli/tests/testdata/import_maps/lodash/lodash.ts diff --git a/cli/tests/import_maps/lodash/other_file.ts b/cli/tests/testdata/import_maps/lodash/other_file.ts similarity index 100% rename from cli/tests/import_maps/lodash/other_file.ts rename to cli/tests/testdata/import_maps/lodash/other_file.ts diff --git a/cli/tests/import_maps/moment/moment.ts b/cli/tests/testdata/import_maps/moment/moment.ts similarity index 100% rename from cli/tests/import_maps/moment/moment.ts rename to cli/tests/testdata/import_maps/moment/moment.ts diff --git a/cli/tests/import_maps/moment/other_file.ts b/cli/tests/testdata/import_maps/moment/other_file.ts similarity index 100% rename from cli/tests/import_maps/moment/other_file.ts rename to cli/tests/testdata/import_maps/moment/other_file.ts diff --git a/cli/tests/import_maps/scope/scoped.ts b/cli/tests/testdata/import_maps/scope/scoped.ts similarity index 100% rename from cli/tests/import_maps/scope/scoped.ts rename to cli/tests/testdata/import_maps/scope/scoped.ts diff --git a/cli/tests/import_maps/scoped_moment.ts b/cli/tests/testdata/import_maps/scoped_moment.ts similarity index 100% rename from cli/tests/import_maps/scoped_moment.ts rename to cli/tests/testdata/import_maps/scoped_moment.ts diff --git a/cli/tests/import_maps/test.ts b/cli/tests/testdata/import_maps/test.ts similarity index 100% rename from cli/tests/import_maps/test.ts rename to cli/tests/testdata/import_maps/test.ts diff --git a/cli/tests/import_maps/test_remote.ts b/cli/tests/testdata/import_maps/test_remote.ts similarity index 100% rename from cli/tests/import_maps/test_remote.ts rename to cli/tests/testdata/import_maps/test_remote.ts diff --git a/cli/tests/import_maps/vue.ts b/cli/tests/testdata/import_maps/vue.ts similarity index 100% rename from cli/tests/import_maps/vue.ts rename to cli/tests/testdata/import_maps/vue.ts diff --git a/cli/tests/import_meta.ts b/cli/tests/testdata/import_meta.ts similarity index 100% rename from cli/tests/import_meta.ts rename to cli/tests/testdata/import_meta.ts diff --git a/cli/tests/import_meta.ts.out b/cli/tests/testdata/import_meta.ts.out similarity index 100% rename from cli/tests/import_meta.ts.out rename to cli/tests/testdata/import_meta.ts.out diff --git a/cli/tests/import_meta2.ts b/cli/tests/testdata/import_meta2.ts similarity index 100% rename from cli/tests/import_meta2.ts rename to cli/tests/testdata/import_meta2.ts diff --git a/cli/tests/info/data_null_error/data_null_error.out b/cli/tests/testdata/info/data_null_error/data_null_error.out similarity index 100% rename from cli/tests/info/data_null_error/data_null_error.out rename to cli/tests/testdata/info/data_null_error/data_null_error.out diff --git a/cli/tests/info/data_null_error/mod.ts b/cli/tests/testdata/info/data_null_error/mod.ts similarity index 100% rename from cli/tests/info/data_null_error/mod.ts rename to cli/tests/testdata/info/data_null_error/mod.ts diff --git a/cli/tests/info/data_null_error/types.d.ts b/cli/tests/testdata/info/data_null_error/types.d.ts similarity index 100% rename from cli/tests/info/data_null_error/types.d.ts rename to cli/tests/testdata/info/data_null_error/types.d.ts diff --git a/cli/tests/info/types_header.out b/cli/tests/testdata/info/types_header.out similarity index 100% rename from cli/tests/info/types_header.out rename to cli/tests/testdata/info/types_header.out diff --git a/cli/tests/info_json.out b/cli/tests/testdata/info_json.out similarity index 100% rename from cli/tests/info_json.out rename to cli/tests/testdata/info_json.out diff --git a/cli/tests/info_json_location.out b/cli/tests/testdata/info_json_location.out similarity index 100% rename from cli/tests/info_json_location.out rename to cli/tests/testdata/info_json_location.out diff --git a/cli/tests/testdata/info_missing_module.out b/cli/tests/testdata/info_missing_module.out new file mode 100644 index 0000000000..75b0774071 --- /dev/null +++ b/cli/tests/testdata/info_missing_module.out @@ -0,0 +1,6 @@ +local: [WILDCARD]error_009_missing_js_module.js +type: JavaScript +dependencies: 1 unique (total 26B) + +file://[WILDCARD]/error_009_missing_js_module.js (26B) +└── file://[WILDCARD]/bad-module.js (error) diff --git a/cli/tests/testdata/info_recursive_imports_test.out b/cli/tests/testdata/info_recursive_imports_test.out new file mode 100644 index 0000000000..10ee545340 --- /dev/null +++ b/cli/tests/testdata/info_recursive_imports_test.out @@ -0,0 +1,12 @@ +local: [WILDCARD]info_recursive_imports_test.ts +type: TypeScript +dependencies: 4 unique (total [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/cli/tests/info_recursive_imports_test.ts b/cli/tests/testdata/info_recursive_imports_test.ts similarity index 100% rename from cli/tests/info_recursive_imports_test.ts rename to cli/tests/testdata/info_recursive_imports_test.ts diff --git a/cli/tests/info_type_import.out b/cli/tests/testdata/info_type_import.out similarity index 100% rename from cli/tests/info_type_import.out rename to cli/tests/testdata/info_type_import.out diff --git a/cli/tests/info_type_import.ts b/cli/tests/testdata/info_type_import.ts similarity index 100% rename from cli/tests/info_type_import.ts rename to cli/tests/testdata/info_type_import.ts diff --git a/cli/tests/inline_js_source_map.ts b/cli/tests/testdata/inline_js_source_map.ts similarity index 100% rename from cli/tests/inline_js_source_map.ts rename to cli/tests/testdata/inline_js_source_map.ts diff --git a/cli/tests/testdata/inline_js_source_map_2.js b/cli/tests/testdata/inline_js_source_map_2.js new file mode 100644 index 0000000000..036f351b9b --- /dev/null +++ b/cli/tests/testdata/inline_js_source_map_2.js @@ -0,0 +1,4 @@ +"use strict"; +1 + 1; +throw new Error("Hello world!"); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L2lubGluZV9qc19zb3VyY2VfbWFwXzIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLENBQUMsR0FBQyxDQUFDLENBQUM7QUFLSixNQUFNLElBQUksS0FBSyxDQUFDLGNBQStCLENBQUMsQ0FBQyJ9 \ No newline at end of file diff --git a/cli/tests/testdata/inline_js_source_map_2.js.out b/cli/tests/testdata/inline_js_source_map_2.js.out new file mode 100644 index 0000000000..4f9127da66 --- /dev/null +++ b/cli/tests/testdata/inline_js_source_map_2.js.out @@ -0,0 +1,2 @@ +error: Uncaught Error: Hello world! + at http://localhost:4545/inline_js_source_map_2.ts:6:7 diff --git a/cli/tests/inline_js_source_map_2.ts b/cli/tests/testdata/inline_js_source_map_2.ts similarity index 100% rename from cli/tests/inline_js_source_map_2.ts rename to cli/tests/testdata/inline_js_source_map_2.ts diff --git a/cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js b/cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js new file mode 100644 index 0000000000..5bea615b8c --- /dev/null +++ b/cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js @@ -0,0 +1,4 @@ +"use strict"; + +throw new Error("Hello world!"); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L2lubGluZV9qc19zb3VyY2VfbWFwXzIudHMiXSwic291cmNlc0NvbnRlbnQiOlsiMSsxO1xuaW50ZXJmYWNlIFRlc3Qge1xuICBoZWxsbzogc3RyaW5nO1xufVxuXG50aHJvdyBuZXcgRXJyb3IoXCJIZWxsbyB3b3JsZCFcIiBhcyB1bmtub3duIGFzIHN0cmluZyk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLENBQUMsR0FBQyxDQUFDLENBQUM7QUFLSixNQUFNLElBQUksS0FBSyxDQUFDLGNBQStCLENBQUMsQ0FBQyJ9 \ No newline at end of file diff --git a/cli/tests/inline_js_source_map_2_with_inline_contents.js.out b/cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js.out similarity index 58% rename from cli/tests/inline_js_source_map_2_with_inline_contents.js.out rename to cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js.out index c123de41e1..9280361f71 100644 --- a/cli/tests/inline_js_source_map_2_with_inline_contents.js.out +++ b/cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js.out @@ -1,4 +1,4 @@ error: Uncaught Error: Hello world! throw new Error("Hello world!" as unknown as string); ^ - at http://localhost:4545/cli/tests/inline_js_source_map_2.ts:6:7 + at http://localhost:4545/inline_js_source_map_2.ts:6:7 diff --git a/cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js b/cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js new file mode 100644 index 0000000000..decf47bdcc --- /dev/null +++ b/cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js @@ -0,0 +1,4 @@ +"use strict"; +import "http://localhost:4545/inline_js_source_map.ts"; +throw new Error("Hello world!"); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L2lubGluZV9qc19zb3VyY2VfbWFwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/cli/tests/inline_js_source_map_with_contents_from_graph.js.out b/cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js.out similarity index 57% rename from cli/tests/inline_js_source_map_with_contents_from_graph.js.out rename to cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js.out index a0ba9fe982..7304fc5f64 100644 --- a/cli/tests/inline_js_source_map_with_contents_from_graph.js.out +++ b/cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js.out @@ -1,4 +1,4 @@ error: Uncaught Error: Hello world! // throw new Error("Hello world!" as string); ^ - at http://localhost:4545/cli/tests/inline_js_source_map.ts:6:7 + at http://localhost:4545/inline_js_source_map.ts:6:7 diff --git a/cli/tests/inspector1.js b/cli/tests/testdata/inspector1.js similarity index 100% rename from cli/tests/inspector1.js rename to cli/tests/testdata/inspector1.js diff --git a/cli/tests/inspector2.js b/cli/tests/testdata/inspector2.js similarity index 100% rename from cli/tests/inspector2.js rename to cli/tests/testdata/inspector2.js diff --git a/cli/tests/inspector3.js b/cli/tests/testdata/inspector3.js similarity index 100% rename from cli/tests/inspector3.js rename to cli/tests/testdata/inspector3.js diff --git a/cli/tests/inspector4.js b/cli/tests/testdata/inspector4.js similarity index 100% rename from cli/tests/inspector4.js rename to cli/tests/testdata/inspector4.js diff --git a/cli/tests/js_import_detect.ts b/cli/tests/testdata/js_import_detect.ts similarity index 100% rename from cli/tests/js_import_detect.ts rename to cli/tests/testdata/js_import_detect.ts diff --git a/cli/tests/js_import_detect.ts.out b/cli/tests/testdata/js_import_detect.ts.out similarity index 100% rename from cli/tests/js_import_detect.ts.out rename to cli/tests/testdata/js_import_detect.ts.out diff --git a/cli/tests/jsx_import_from_ts.App.jsx b/cli/tests/testdata/jsx_import_from_ts.App.jsx similarity index 100% rename from cli/tests/jsx_import_from_ts.App.jsx rename to cli/tests/testdata/jsx_import_from_ts.App.jsx diff --git a/cli/tests/jsx_import_from_ts.ts b/cli/tests/testdata/jsx_import_from_ts.ts similarity index 100% rename from cli/tests/jsx_import_from_ts.ts rename to cli/tests/testdata/jsx_import_from_ts.ts diff --git a/cli/tests/jsx_import_from_ts.ts.out b/cli/tests/testdata/jsx_import_from_ts.ts.out similarity index 100% rename from cli/tests/jsx_import_from_ts.ts.out rename to cli/tests/testdata/jsx_import_from_ts.ts.out diff --git a/cli/tests/lib_dom_asynciterable.ts b/cli/tests/testdata/lib_dom_asynciterable.ts similarity index 100% rename from cli/tests/lib_dom_asynciterable.ts rename to cli/tests/testdata/lib_dom_asynciterable.ts diff --git a/cli/tests/lib_dom_asynciterable.ts.out b/cli/tests/testdata/lib_dom_asynciterable.ts.out similarity index 100% rename from cli/tests/lib_dom_asynciterable.ts.out rename to cli/tests/testdata/lib_dom_asynciterable.ts.out diff --git a/cli/tests/lib_ref.ts b/cli/tests/testdata/lib_ref.ts similarity index 100% rename from cli/tests/lib_ref.ts rename to cli/tests/testdata/lib_ref.ts diff --git a/cli/tests/lib_ref.ts.out b/cli/tests/testdata/lib_ref.ts.out similarity index 100% rename from cli/tests/lib_ref.ts.out rename to cli/tests/testdata/lib_ref.ts.out diff --git a/cli/tests/lib_runtime_api.ts b/cli/tests/testdata/lib_runtime_api.ts similarity index 100% rename from cli/tests/lib_runtime_api.ts rename to cli/tests/testdata/lib_runtime_api.ts diff --git a/cli/tests/lib_runtime_api.ts.out b/cli/tests/testdata/lib_runtime_api.ts.out similarity index 100% rename from cli/tests/lib_runtime_api.ts.out rename to cli/tests/testdata/lib_runtime_api.ts.out diff --git a/cli/tests/lint/expected.out b/cli/tests/testdata/lint/expected.out similarity index 100% rename from cli/tests/lint/expected.out rename to cli/tests/testdata/lint/expected.out diff --git a/cli/tests/lint/expected_from_stdin.out b/cli/tests/testdata/lint/expected_from_stdin.out similarity index 100% rename from cli/tests/lint/expected_from_stdin.out rename to cli/tests/testdata/lint/expected_from_stdin.out diff --git a/cli/tests/lint/expected_from_stdin_json.out b/cli/tests/testdata/lint/expected_from_stdin_json.out similarity index 100% rename from cli/tests/lint/expected_from_stdin_json.out rename to cli/tests/testdata/lint/expected_from_stdin_json.out diff --git a/cli/tests/lint/expected_glob.out b/cli/tests/testdata/lint/expected_glob.out similarity index 100% rename from cli/tests/lint/expected_glob.out rename to cli/tests/testdata/lint/expected_glob.out diff --git a/cli/tests/lint/expected_ignore.out b/cli/tests/testdata/lint/expected_ignore.out similarity index 100% rename from cli/tests/lint/expected_ignore.out rename to cli/tests/testdata/lint/expected_ignore.out diff --git a/cli/tests/lint/expected_json.out b/cli/tests/testdata/lint/expected_json.out similarity index 100% rename from cli/tests/lint/expected_json.out rename to cli/tests/testdata/lint/expected_json.out diff --git a/cli/tests/lint/expected_quiet.out b/cli/tests/testdata/lint/expected_quiet.out similarity index 100% rename from cli/tests/lint/expected_quiet.out rename to cli/tests/testdata/lint/expected_quiet.out diff --git a/cli/tests/lint/expected_rules.out b/cli/tests/testdata/lint/expected_rules.out similarity index 100% rename from cli/tests/lint/expected_rules.out rename to cli/tests/testdata/lint/expected_rules.out diff --git a/cli/tests/lint/expected_verbose.out b/cli/tests/testdata/lint/expected_verbose.out similarity index 100% rename from cli/tests/lint/expected_verbose.out rename to cli/tests/testdata/lint/expected_verbose.out diff --git a/cli/tests/lint/file1.js b/cli/tests/testdata/lint/file1.js similarity index 100% rename from cli/tests/lint/file1.js rename to cli/tests/testdata/lint/file1.js diff --git a/cli/tests/lint/file2.ts b/cli/tests/testdata/lint/file2.ts similarity index 100% rename from cli/tests/lint/file2.ts rename to cli/tests/testdata/lint/file2.ts diff --git a/cli/tests/lint/ignored_file.ts b/cli/tests/testdata/lint/ignored_file.ts similarity index 100% rename from cli/tests/lint/ignored_file.ts rename to cli/tests/testdata/lint/ignored_file.ts diff --git a/cli/tests/lint/malformed.js b/cli/tests/testdata/lint/malformed.js similarity index 100% rename from cli/tests/lint/malformed.js rename to cli/tests/testdata/lint/malformed.js diff --git a/cli/tests/listen_tls_alpn.ts b/cli/tests/testdata/listen_tls_alpn.ts similarity index 68% rename from cli/tests/listen_tls_alpn.ts rename to cli/tests/testdata/listen_tls_alpn.ts index 6aedf0e4f0..5d58065d99 100644 --- a/cli/tests/listen_tls_alpn.ts +++ b/cli/tests/testdata/listen_tls_alpn.ts @@ -1,7 +1,7 @@ const listener = Deno.listenTls({ port: Number(Deno.args[0]), - certFile: "./cli/tests/tls/localhost.crt", - keyFile: "./cli/tests/tls/localhost.key", + certFile: "./tls/localhost.crt", + keyFile: "./tls/localhost.key", alpnProtocols: ["h2", "http/1.1", "foobar"], }); diff --git a/cli/tests/testdata/localhost_unsafe_ssl.ts.out b/cli/tests/testdata/localhost_unsafe_ssl.ts.out new file mode 100644 index 0000000000..c482bd81ca --- /dev/null +++ b/cli/tests/testdata/localhost_unsafe_ssl.ts.out @@ -0,0 +1,3 @@ +DANGER: TLS certificate validation is disabled for: deno.land +error: error sending request for url (https://localhost:5545/subdir/mod2.ts): error trying to connect: invalid certificate: UnknownIssuer + at [WILDCARD]/cafile_url_imports.ts:1:0 diff --git a/cli/tests/testdata/lock_check_err.json b/cli/tests/testdata/lock_check_err.json new file mode 100644 index 0000000000..9bf52adca5 --- /dev/null +++ b/cli/tests/testdata/lock_check_err.json @@ -0,0 +1,4 @@ +{ + "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", + "http://127.0.0.1:4545/003_relative_import.ts": "bad" +} diff --git a/cli/tests/lock_check_err.out b/cli/tests/testdata/lock_check_err.out similarity index 65% rename from cli/tests/lock_check_err.out rename to cli/tests/testdata/lock_check_err.out index c12f4af349..3c5eceb8cf 100644 --- a/cli/tests/lock_check_err.out +++ b/cli/tests/testdata/lock_check_err.out @@ -1,3 +1,3 @@ [WILDCARD]The source code is invalid, as it does not match the expected hash in the lock file. - Specifier: http://127.0.0.1:4545/cli/tests/003_relative_import.ts + Specifier: http://127.0.0.1:4545/003_relative_import.ts Lock file: lock_check_err.json diff --git a/cli/tests/testdata/lock_check_err2.json b/cli/tests/testdata/lock_check_err2.json new file mode 100644 index 0000000000..a59cbc9e30 --- /dev/null +++ b/cli/tests/testdata/lock_check_err2.json @@ -0,0 +1,10 @@ +{ + "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "bad", + "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" +} diff --git a/cli/tests/lock_check_err2.out b/cli/tests/testdata/lock_check_err2.out similarity index 62% rename from cli/tests/lock_check_err2.out rename to cli/tests/testdata/lock_check_err2.out index d3ccfc46ef..958c01654b 100644 --- a/cli/tests/lock_check_err2.out +++ b/cli/tests/testdata/lock_check_err2.out @@ -1,3 +1,3 @@ [WILDCARD]The source code is invalid, as it does not match the expected hash in the lock file. - Specifier: http://localhost:4545/cli/tests/subdir/mt_text_ecmascript.j3.js + Specifier: http://localhost:4545/subdir/mt_text_ecmascript.j3.js Lock file: lock_check_err2.json diff --git a/cli/tests/testdata/lock_check_err_with_bundle.json b/cli/tests/testdata/lock_check_err_with_bundle.json new file mode 100644 index 0000000000..a218d70000 --- /dev/null +++ b/cli/tests/testdata/lock_check_err_with_bundle.json @@ -0,0 +1,5 @@ +{ + "http://127.0.0.1:4545/subdir/mod1.ts": "bfc1037b02c99abc20367f739bca7455813a5950066abd77965bff33b6eece0f", + "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", + "http://127.0.0.1:4545/subdir/subdir2/mod2.ts": "bad" +} diff --git a/cli/tests/lock_check_err_with_bundle.out b/cli/tests/testdata/lock_check_err_with_bundle.out similarity index 67% rename from cli/tests/lock_check_err_with_bundle.out rename to cli/tests/testdata/lock_check_err_with_bundle.out index d6eae26b1f..a47cbc6068 100644 --- a/cli/tests/lock_check_err_with_bundle.out +++ b/cli/tests/testdata/lock_check_err_with_bundle.out @@ -1,4 +1,4 @@ [WILDCARD] The source code is invalid, as it does not match the expected hash in the lock file. - Specifier: http://127.0.0.1:4545/cli/tests/subdir/subdir2/mod2.ts + Specifier: http://127.0.0.1:4545/subdir/subdir2/mod2.ts Lock file: lock_check_err_with_bundle.json diff --git a/cli/tests/testdata/lock_check_ok.json b/cli/tests/testdata/lock_check_ok.json new file mode 100644 index 0000000000..9dd5b05481 --- /dev/null +++ b/cli/tests/testdata/lock_check_ok.json @@ -0,0 +1,4 @@ +{ + "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", + "http://127.0.0.1:4545/003_relative_import.ts": "aa9e16de824f81871a1c7164d5bd6857df7db2e18621750bd66b0bde4df07f21" +} diff --git a/cli/tests/testdata/lock_check_ok2.json b/cli/tests/testdata/lock_check_ok2.json new file mode 100644 index 0000000000..162c755e2c --- /dev/null +++ b/cli/tests/testdata/lock_check_ok2.json @@ -0,0 +1,10 @@ +{ + "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" +} diff --git a/cli/tests/testdata/lock_dynamic_imports.json b/cli/tests/testdata/lock_dynamic_imports.json new file mode 100644 index 0000000000..57263bc85b --- /dev/null +++ b/cli/tests/testdata/lock_dynamic_imports.json @@ -0,0 +1,6 @@ +{ + "http://127.0.0.1:4545/013_dynamic_import.ts": "f0d2d108c100e769cda9f26b74326f21e44cab81611aa7f6cd2b731d4cbc1995", + "http://127.0.0.1:4545/subdir/mod1.ts": "bfc1037b02c99abc20367f739bca7455813a5950066abd77965bff33b6eece0f", + "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", + "http://127.0.0.1:4545/subdir/subdir2/mod2.ts": "bad" +} diff --git a/cli/tests/lock_dynamic_imports.out b/cli/tests/testdata/lock_dynamic_imports.out similarity index 66% rename from cli/tests/lock_dynamic_imports.out rename to cli/tests/testdata/lock_dynamic_imports.out index 3bf6342c8b..e5c76c8f06 100644 --- a/cli/tests/lock_dynamic_imports.out +++ b/cli/tests/testdata/lock_dynamic_imports.out @@ -1,4 +1,4 @@ [WILDCARD] The source code is invalid, as it does not match the expected hash in the lock file. - Specifier: http://127.0.0.1:4545/cli/tests/subdir/subdir2/mod2.ts + Specifier: http://127.0.0.1:4545/subdir/subdir2/mod2.ts Lock file: lock_dynamic_imports.json diff --git a/cli/tests/lock_write_fetch.ts b/cli/tests/testdata/lock_write_fetch.ts similarity index 100% rename from cli/tests/lock_write_fetch.ts rename to cli/tests/testdata/lock_write_fetch.ts diff --git a/cli/tests/lock_write_fetch.ts.out b/cli/tests/testdata/lock_write_fetch.ts.out similarity index 100% rename from cli/tests/lock_write_fetch.ts.out rename to cli/tests/testdata/lock_write_fetch.ts.out diff --git a/cli/tests/lock_write_requires_lock.out b/cli/tests/testdata/lock_write_requires_lock.out similarity index 100% rename from cli/tests/lock_write_requires_lock.out rename to cli/tests/testdata/lock_write_requires_lock.out diff --git a/cli/tests/lsp/a.d.ts b/cli/tests/testdata/lsp/a.d.ts similarity index 100% rename from cli/tests/lsp/a.d.ts rename to cli/tests/testdata/lsp/a.d.ts diff --git a/cli/tests/lsp/b.d.ts b/cli/tests/testdata/lsp/b.d.ts similarity index 100% rename from cli/tests/lsp/b.d.ts rename to cli/tests/testdata/lsp/b.d.ts diff --git a/cli/tests/lsp/code_action_ignore_lint_params.json b/cli/tests/testdata/lsp/code_action_ignore_lint_params.json similarity index 100% rename from cli/tests/lsp/code_action_ignore_lint_params.json rename to cli/tests/testdata/lsp/code_action_ignore_lint_params.json diff --git a/cli/tests/lsp/code_action_ignore_lint_response.json b/cli/tests/testdata/lsp/code_action_ignore_lint_response.json similarity index 100% rename from cli/tests/lsp/code_action_ignore_lint_response.json rename to cli/tests/testdata/lsp/code_action_ignore_lint_response.json diff --git a/cli/tests/lsp/code_action_params.json b/cli/tests/testdata/lsp/code_action_params.json similarity index 100% rename from cli/tests/lsp/code_action_params.json rename to cli/tests/testdata/lsp/code_action_params.json diff --git a/cli/tests/lsp/code_action_params_cache.json b/cli/tests/testdata/lsp/code_action_params_cache.json similarity index 100% rename from cli/tests/lsp/code_action_params_cache.json rename to cli/tests/testdata/lsp/code_action_params_cache.json diff --git a/cli/tests/lsp/code_action_params_deadlock.json b/cli/tests/testdata/lsp/code_action_params_deadlock.json similarity index 100% rename from cli/tests/lsp/code_action_params_deadlock.json rename to cli/tests/testdata/lsp/code_action_params_deadlock.json diff --git a/cli/tests/lsp/code_action_params_imports.json b/cli/tests/testdata/lsp/code_action_params_imports.json similarity index 100% rename from cli/tests/lsp/code_action_params_imports.json rename to cli/tests/testdata/lsp/code_action_params_imports.json diff --git a/cli/tests/lsp/code_action_params_refactor.json b/cli/tests/testdata/lsp/code_action_params_refactor.json similarity index 100% rename from cli/tests/lsp/code_action_params_refactor.json rename to cli/tests/testdata/lsp/code_action_params_refactor.json diff --git a/cli/tests/lsp/code_action_resolve_params.json b/cli/tests/testdata/lsp/code_action_resolve_params.json similarity index 100% rename from cli/tests/lsp/code_action_resolve_params.json rename to cli/tests/testdata/lsp/code_action_resolve_params.json diff --git a/cli/tests/lsp/code_action_resolve_params_imports.json b/cli/tests/testdata/lsp/code_action_resolve_params_imports.json similarity index 100% rename from cli/tests/lsp/code_action_resolve_params_imports.json rename to cli/tests/testdata/lsp/code_action_resolve_params_imports.json diff --git a/cli/tests/lsp/code_action_resolve_params_refactor.json b/cli/tests/testdata/lsp/code_action_resolve_params_refactor.json similarity index 100% rename from cli/tests/lsp/code_action_resolve_params_refactor.json rename to cli/tests/testdata/lsp/code_action_resolve_params_refactor.json diff --git a/cli/tests/lsp/code_action_resolve_response.json b/cli/tests/testdata/lsp/code_action_resolve_response.json similarity index 100% rename from cli/tests/lsp/code_action_resolve_response.json rename to cli/tests/testdata/lsp/code_action_resolve_response.json diff --git a/cli/tests/lsp/code_action_resolve_response_imports.json b/cli/tests/testdata/lsp/code_action_resolve_response_imports.json similarity index 100% rename from cli/tests/lsp/code_action_resolve_response_imports.json rename to cli/tests/testdata/lsp/code_action_resolve_response_imports.json diff --git a/cli/tests/lsp/code_action_resolve_response_refactor.json b/cli/tests/testdata/lsp/code_action_resolve_response_refactor.json similarity index 100% rename from cli/tests/lsp/code_action_resolve_response_refactor.json rename to cli/tests/testdata/lsp/code_action_resolve_response_refactor.json diff --git a/cli/tests/lsp/code_action_response.json b/cli/tests/testdata/lsp/code_action_response.json similarity index 100% rename from cli/tests/lsp/code_action_response.json rename to cli/tests/testdata/lsp/code_action_response.json diff --git a/cli/tests/lsp/code_action_response_cache.json b/cli/tests/testdata/lsp/code_action_response_cache.json similarity index 100% rename from cli/tests/lsp/code_action_response_cache.json rename to cli/tests/testdata/lsp/code_action_response_cache.json diff --git a/cli/tests/lsp/code_action_response_imports.json b/cli/tests/testdata/lsp/code_action_response_imports.json similarity index 100% rename from cli/tests/lsp/code_action_response_imports.json rename to cli/tests/testdata/lsp/code_action_response_imports.json diff --git a/cli/tests/lsp/code_action_response_no_disabled.json b/cli/tests/testdata/lsp/code_action_response_no_disabled.json similarity index 100% rename from cli/tests/lsp/code_action_response_no_disabled.json rename to cli/tests/testdata/lsp/code_action_response_no_disabled.json diff --git a/cli/tests/lsp/code_action_response_refactor.json b/cli/tests/testdata/lsp/code_action_response_refactor.json similarity index 100% rename from cli/tests/lsp/code_action_response_refactor.json rename to cli/tests/testdata/lsp/code_action_response_refactor.json diff --git a/cli/tests/lsp/code_lens_resolve_response.json b/cli/tests/testdata/lsp/code_lens_resolve_response.json similarity index 100% rename from cli/tests/lsp/code_lens_resolve_response.json rename to cli/tests/testdata/lsp/code_lens_resolve_response.json diff --git a/cli/tests/lsp/code_lens_resolve_response_impl.json b/cli/tests/testdata/lsp/code_lens_resolve_response_impl.json similarity index 100% rename from cli/tests/lsp/code_lens_resolve_response_impl.json rename to cli/tests/testdata/lsp/code_lens_resolve_response_impl.json diff --git a/cli/tests/lsp/code_lens_response.json b/cli/tests/testdata/lsp/code_lens_response.json similarity index 100% rename from cli/tests/lsp/code_lens_response.json rename to cli/tests/testdata/lsp/code_lens_response.json diff --git a/cli/tests/lsp/code_lens_response_changed.json b/cli/tests/testdata/lsp/code_lens_response_changed.json similarity index 100% rename from cli/tests/lsp/code_lens_response_changed.json rename to cli/tests/testdata/lsp/code_lens_response_changed.json diff --git a/cli/tests/lsp/code_lens_response_impl.json b/cli/tests/testdata/lsp/code_lens_response_impl.json similarity index 100% rename from cli/tests/lsp/code_lens_response_impl.json rename to cli/tests/testdata/lsp/code_lens_response_impl.json diff --git a/cli/tests/lsp/code_lens_response_test.json b/cli/tests/testdata/lsp/code_lens_response_test.json similarity index 100% rename from cli/tests/lsp/code_lens_response_test.json rename to cli/tests/testdata/lsp/code_lens_response_test.json diff --git a/cli/tests/lsp/completion_request_params_optional.json b/cli/tests/testdata/lsp/completion_request_params_optional.json similarity index 100% rename from cli/tests/lsp/completion_request_params_optional.json rename to cli/tests/testdata/lsp/completion_request_params_optional.json diff --git a/cli/tests/lsp/completion_request_response_empty.json b/cli/tests/testdata/lsp/completion_request_response_empty.json similarity index 100% rename from cli/tests/lsp/completion_request_response_empty.json rename to cli/tests/testdata/lsp/completion_request_response_empty.json diff --git a/cli/tests/lsp/completion_resolve_params.json b/cli/tests/testdata/lsp/completion_resolve_params.json similarity index 100% rename from cli/tests/lsp/completion_resolve_params.json rename to cli/tests/testdata/lsp/completion_resolve_params.json diff --git a/cli/tests/lsp/completion_resolve_params_optional.json b/cli/tests/testdata/lsp/completion_resolve_params_optional.json similarity index 100% rename from cli/tests/lsp/completion_resolve_params_optional.json rename to cli/tests/testdata/lsp/completion_resolve_params_optional.json diff --git a/cli/tests/lsp/completion_resolve_params_registry.json b/cli/tests/testdata/lsp/completion_resolve_params_registry.json similarity index 100% rename from cli/tests/lsp/completion_resolve_params_registry.json rename to cli/tests/testdata/lsp/completion_resolve_params_registry.json diff --git a/cli/tests/lsp/completion_resolve_response.json b/cli/tests/testdata/lsp/completion_resolve_response.json similarity index 100% rename from cli/tests/lsp/completion_resolve_response.json rename to cli/tests/testdata/lsp/completion_resolve_response.json diff --git a/cli/tests/lsp/completion_resolve_response_registry.json b/cli/tests/testdata/lsp/completion_resolve_response_registry.json similarity index 100% rename from cli/tests/lsp/completion_resolve_response_registry.json rename to cli/tests/testdata/lsp/completion_resolve_response_registry.json diff --git a/cli/tests/lsp/diagnostics_deno_deps.json b/cli/tests/testdata/lsp/diagnostics_deno_deps.json similarity index 100% rename from cli/tests/lsp/diagnostics_deno_deps.json rename to cli/tests/testdata/lsp/diagnostics_deno_deps.json diff --git a/cli/tests/lsp/diagnostics_deno_types.json b/cli/tests/testdata/lsp/diagnostics_deno_types.json similarity index 100% rename from cli/tests/lsp/diagnostics_deno_types.json rename to cli/tests/testdata/lsp/diagnostics_deno_types.json diff --git a/cli/tests/lsp/did_open_params_deno_types.json b/cli/tests/testdata/lsp/did_open_params_deno_types.json similarity index 100% rename from cli/tests/lsp/did_open_params_deno_types.json rename to cli/tests/testdata/lsp/did_open_params_deno_types.json diff --git a/cli/tests/lsp/did_open_params_doc_symbol.json b/cli/tests/testdata/lsp/did_open_params_doc_symbol.json similarity index 100% rename from cli/tests/lsp/did_open_params_doc_symbol.json rename to cli/tests/testdata/lsp/did_open_params_doc_symbol.json diff --git a/cli/tests/testdata/lsp/did_open_params_import_hover.json b/cli/tests/testdata/lsp/did_open_params_import_hover.json new file mode 100644 index 0000000000..e054eef3e8 --- /dev/null +++ b/cli/tests/testdata/lsp/did_open_params_import_hover.json @@ -0,0 +1,8 @@ +{ + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "typescript", + "version": 1, + "text": "import * as a from \"http://127.0.0.1:4545/xTypeScriptTypes.js\";\n// @deno-types=\"http://127.0.0.1:4545/type_definitions/foo.d.ts\"\nimport * as b from \"http://127.0.0.1:4545/type_definitions/foo.js\";\nimport * as c from \"http://127.0.0.1:4545/subdir/type_reference.js\";\nimport * as d from \"http://127.0.0.1:4545/subdir/mod1.ts\";\nimport * as e from \"data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo=\";\nimport * as f from \"./file_01.ts\";\n\nconsole.log(a, b, c, d, e, f);\n" + } +} diff --git a/cli/tests/testdata/lsp/did_open_params_large.json b/cli/tests/testdata/lsp/did_open_params_large.json new file mode 100644 index 0000000000..996434c0c0 --- /dev/null +++ b/cli/tests/testdata/lsp/did_open_params_large.json @@ -0,0 +1,8 @@ +{ + "textDocument": { + "uri": "file:///a/file.ts", + "languageId": "javascript", + "version": 1, + "text": "// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.\n\n// @ts-check\n/// \n// deno-lint-ignore-file no-undef\n\n// This module is the entry point for \"compiler\" isolate, ie. the one\n// that is created when Deno needs to type check TypeScript, and in some\n// instances convert TypeScript to JavaScript.\n\n// Removes the `__proto__` for security reasons. This intentionally makes\n// Deno non compliant with ECMA-262 Annex B.2.2.1\ndelete Object.prototype.__proto__;\n\n((window) => {\n /** @type {DenoCore} */\n const core = window.Deno.core;\n\n let logDebug = false;\n let logSource = \"JS\";\n\n function setLogDebug(debug, source) {\n logDebug = debug;\n if (source) {\n logSource = source;\n }\n }\n\n function debug(...args) {\n if (logDebug) {\n const stringifiedArgs = args.map((arg) =>\n typeof arg === \"string\" ? arg : JSON.stringify(arg)\n ).join(\" \");\n // adding a non-zero integer value to the end of the debug string causes\n // the message to be printed to stderr instead of stdout, which is better\n // aligned to the behaviour of debug messages\n core.print(`DEBUG ${logSource} - ${stringifiedArgs}\\n`, 1);\n }\n }\n\n function error(...args) {\n const stringifiedArgs = args.map((arg) =>\n typeof arg === \"string\" || arg instanceof Error\n ? String(arg)\n : JSON.stringify(arg)\n ).join(\" \");\n core.print(`ERROR ${logSource} = ${stringifiedArgs}\\n`, 1);\n }\n\n class AssertionError extends Error {\n constructor(msg) {\n super(msg);\n this.name = \"AssertionError\";\n }\n }\n\n function assert(cond, msg = \"Assertion failed.\") {\n if (!cond) {\n throw new AssertionError(msg);\n }\n }\n\n /** @type {Map} */\n const sourceFileCache = new Map();\n\n /** @param {ts.DiagnosticRelatedInformation} diagnostic */\n function fromRelatedInformation({\n start,\n length,\n file,\n messageText: msgText,\n ...ri\n }) {\n let messageText;\n let messageChain;\n if (typeof msgText === \"object\") {\n messageChain = msgText;\n } else {\n messageText = msgText;\n }\n if (start !== undefined && length !== undefined && file) {\n const startPos = file.getLineAndCharacterOfPosition(start);\n const sourceLine = file.getFullText().split(\"\\n\")[startPos.line];\n const fileName = file.fileName;\n return {\n start: startPos,\n end: file.getLineAndCharacterOfPosition(start + length),\n fileName,\n messageChain,\n messageText,\n sourceLine,\n ...ri,\n };\n } else {\n return {\n messageChain,\n messageText,\n ...ri,\n };\n }\n }\n\n /** @param {ts.Diagnostic[]} diagnostics */\n function fromTypeScriptDiagnostic(diagnostics) {\n return diagnostics.map(({ relatedInformation: ri, source, ...diag }) => {\n /** @type {any} */\n const value = fromRelatedInformation(diag);\n value.relatedInformation = ri\n ? ri.map(fromRelatedInformation)\n : undefined;\n value.source = source;\n return value;\n });\n }\n\n // Using incremental compile APIs requires that all\n // paths must be either relative or absolute. Since\n // analysis in Rust operates on fully resolved URLs,\n // it makes sense to use the same scheme here.\n const ASSETS = \"asset:///\";\n const CACHE = \"cache:///\";\n\n /** Diagnostics that are intentionally ignored when compiling TypeScript in\n * Deno, as they provide misleading or incorrect information. */\n const IGNORED_DIAGNOSTICS = [\n // TS1208: All files must be modules when the '--isolatedModules' flag is\n // provided. We can ignore because we guarantee that all files are\n // modules.\n 1208,\n // TS1375: 'await' expressions are only allowed at the top level of a file\n // when that file is a module, but this file has no imports or exports.\n // Consider adding an empty 'export {}' to make this file a module.\n 1375,\n // TS1103: 'for-await-of' statement is only allowed within an async function\n // or async generator.\n 1103,\n // TS2306: File 'file:///Users/rld/src/deno/subdir/amd_like.js' is\n // not a module.\n 2306,\n // TS2691: An import path cannot end with a '.ts' extension. Consider\n // importing 'bad-module' instead.\n 2691,\n // TS2792: Cannot find module. Did you mean to set the 'moduleResolution'\n // option to 'node', or to add aliases to the 'paths' option?\n 2792,\n // TS5009: Cannot find the common subdirectory path for the input files.\n 5009,\n // TS5055: Cannot write file\n // 'http://localhost:4545/subdir/mt_application_x_javascript.j4.js'\n // because it would overwrite input file.\n 5055,\n // TypeScript is overly opinionated that only CommonJS modules kinds can\n // support JSON imports. Allegedly this was fixed in\n // Microsoft/TypeScript#26825 but that doesn't seem to be working here,\n // so we will ignore complaints about this compiler setting.\n 5070,\n // TS7016: Could not find a declaration file for module '...'. '...'\n // implicitly has an 'any' type. This is due to `allowJs` being off by\n // default but importing of a JavaScript module.\n 7016,\n ];\n\n const SNAPSHOT_COMPILE_OPTIONS = {\n esModuleInterop: true,\n jsx: ts.JsxEmit.React,\n module: ts.ModuleKind.ESNext,\n noEmit: true,\n strict: true,\n target: ts.ScriptTarget.ESNext,\n };\n\n class ScriptSnapshot {\n /** @type {string} */\n specifier;\n /** @type {string} */\n version;\n /**\n * @param {string} specifier\n * @param {string} version \n */\n constructor(specifier, version) {\n this.specifier = specifier;\n this.version = version;\n }\n /**\n * @param {number} start \n * @param {number} end \n * @returns {string}\n */\n getText(start, end) {\n const { specifier, version } = this;\n debug(\n `snapshot.getText(${start}, ${end}) specifier: ${specifier} version: ${version}`,\n );\n return core.jsonOpSync(\"op_get_text\", { specifier, version, start, end });\n }\n /**\n * @returns {number}\n */\n getLength() {\n const { specifier, version } = this;\n debug(`snapshot.getLength() specifier: ${specifier} version: ${version}`);\n return core.jsonOpSync(\"op_get_length\", { specifier, version });\n }\n /**\n * @param {ScriptSnapshot} oldSnapshot\n * @returns {ts.TextChangeRange | undefined}\n */\n getChangeRange(oldSnapshot) {\n const { specifier, version } = this;\n const { version: oldVersion } = oldSnapshot;\n const oldLength = oldSnapshot.getLength();\n debug(\n `snapshot.getLength() specifier: ${specifier} oldVersion: ${oldVersion} version: ${version}`,\n );\n return core.jsonOpSync(\n \"op_get_change_range\",\n { specifier, oldLength, oldVersion, version },\n );\n }\n dispose() {\n const { specifier, version } = this;\n debug(`snapshot.dispose() specifier: ${specifier} version: ${version}`);\n core.jsonOpSync(\"op_dispose\", { specifier, version });\n }\n }\n\n /** @type {ts.CompilerOptions} */\n let compilationSettings = {};\n\n /** @type {ts.LanguageService} */\n let languageService;\n\n /** An object literal of the incremental compiler host, which provides the\n * specific \"bindings\" to the Deno environment that tsc needs to work.\n *\n * @type {ts.CompilerHost & ts.LanguageServiceHost} */\n const host = {\n fileExists(fileName) {\n debug(`host.fileExists(\"${fileName}\")`);\n return false;\n },\n readFile(specifier) {\n debug(`host.readFile(\"${specifier}\")`);\n return core.jsonOpSync(\"op_load\", { specifier }).data;\n },\n getSourceFile(\n specifier,\n languageVersion,\n _onError,\n _shouldCreateNewSourceFile,\n ) {\n debug(\n `host.getSourceFile(\"${specifier}\", ${\n ts.ScriptTarget[languageVersion]\n })`,\n );\n let sourceFile = sourceFileCache.get(specifier);\n if (sourceFile) {\n return sourceFile;\n }\n\n /** @type {{ data: string; hash?: string; scriptKind: ts.ScriptKind }} */\n const { data, hash, scriptKind } = core.jsonOpSync(\n \"op_load\",\n { specifier },\n );\n assert(\n data != null,\n `\"data\" is unexpectedly null for \"${specifier}\".`,\n );\n sourceFile = ts.createSourceFile(\n specifier,\n data,\n languageVersion,\n false,\n scriptKind,\n );\n sourceFile.moduleName = specifier;\n sourceFile.version = hash;\n sourceFileCache.set(specifier, sourceFile);\n return sourceFile;\n },\n getDefaultLibFileName() {\n return `${ASSETS}/lib.esnext.d.ts`;\n },\n getDefaultLibLocation() {\n return ASSETS;\n },\n writeFile(fileName, data, _writeByteOrderMark, _onError, sourceFiles) {\n debug(`host.writeFile(\"${fileName}\")`);\n let maybeSpecifiers;\n if (sourceFiles) {\n maybeSpecifiers = sourceFiles.map((sf) => sf.moduleName);\n }\n return core.jsonOpSync(\n \"op_emit\",\n { maybeSpecifiers, fileName, data },\n );\n },\n getCurrentDirectory() {\n return CACHE;\n },\n getCanonicalFileName(fileName) {\n return fileName;\n },\n useCaseSensitiveFileNames() {\n return true;\n },\n getNewLine() {\n return \"\\n\";\n },\n resolveModuleNames(specifiers, base) {\n debug(`host.resolveModuleNames()`);\n debug(` base: ${base}`);\n debug(` specifiers: ${specifiers.join(\", \")}`);\n /** @type {Array<[string, ts.Extension] | undefined>} */\n const resolved = core.jsonOpSync(\"op_resolve\", {\n specifiers,\n base,\n });\n if (resolved) {\n const result = resolved.map((item) => {\n if (item) {\n const [resolvedFileName, extension] = item;\n return {\n resolvedFileName,\n extension,\n isExternalLibraryImport: false,\n };\n }\n return undefined;\n });\n result.length = specifiers.length;\n return result;\n } else {\n return new Array(specifiers.length);\n }\n },\n createHash(data) {\n return core.jsonOpSync(\"op_create_hash\", { data }).hash;\n },\n\n // LanguageServiceHost\n getCompilationSettings() {\n debug(\"host.getCompilationSettings()\");\n return compilationSettings;\n },\n getScriptFileNames() {\n debug(\"host.getScriptFileNames()\");\n return core.jsonOpSync(\"op_script_names\", undefined);\n },\n getScriptVersion(specifier) {\n debug(`host.getScriptVersion(\"${specifier}\")`);\n const sourceFile = sourceFileCache.get(specifier);\n if (sourceFile) {\n return sourceFile.version ?? \"1\";\n }\n return core.jsonOpSync(\"op_script_version\", { specifier });\n },\n getScriptSnapshot(specifier) {\n debug(`host.getScriptSnapshot(\"${specifier}\")`);\n const sourceFile = sourceFileCache.get(specifier);\n if (sourceFile) {\n return {\n getText(start, end) {\n return sourceFile.text.substring(start, end);\n },\n getLength() {\n return sourceFile.text.length;\n },\n getChangeRange() {\n return undefined;\n },\n };\n }\n /** @type {string | undefined} */\n const version = core.jsonOpSync(\"op_script_version\", { specifier });\n if (version != null) {\n return new ScriptSnapshot(specifier, version);\n }\n return undefined;\n },\n };\n\n /** @type {Array<[string, number]>} */\n const stats = [];\n let statsStart = 0;\n\n function performanceStart() {\n stats.length = 0;\n statsStart = Date.now();\n ts.performance.enable();\n }\n\n /**\n * @param {{ program: ts.Program | ts.EmitAndSemanticDiagnosticsBuilderProgram, fileCount?: number }} options \n */\n function performanceProgram({ program, fileCount }) {\n if (program) {\n if (\"getProgram\" in program) {\n program = program.getProgram();\n }\n stats.push([\"Files\", program.getSourceFiles().length]);\n stats.push([\"Nodes\", program.getNodeCount()]);\n stats.push([\"Identifiers\", program.getIdentifierCount()]);\n stats.push([\"Symbols\", program.getSymbolCount()]);\n stats.push([\"Types\", program.getTypeCount()]);\n stats.push([\"Instantiations\", program.getInstantiationCount()]);\n } else if (fileCount != null) {\n stats.push([\"Files\", fileCount]);\n }\n const programTime = ts.performance.getDuration(\"Program\");\n const bindTime = ts.performance.getDuration(\"Bind\");\n const checkTime = ts.performance.getDuration(\"Check\");\n const emitTime = ts.performance.getDuration(\"Emit\");\n stats.push([\"Parse time\", programTime]);\n stats.push([\"Bind time\", bindTime]);\n stats.push([\"Check time\", checkTime]);\n stats.push([\"Emit time\", emitTime]);\n stats.push(\n [\"Total TS time\", programTime + bindTime + checkTime + emitTime],\n );\n }\n\n function performanceEnd() {\n const duration = Date.now() - statsStart;\n stats.push([\"Compile time\", duration]);\n return stats;\n }\n\n /**\n * @typedef {object} Request\n * @property {Record} config\n * @property {boolean} debug\n * @property {string[]} rootNames\n */\n\n /** The API that is called by Rust when executing a request.\n * @param {Request} request\n */\n function exec({ config, debug: debugFlag, rootNames }) {\n setLogDebug(debugFlag, \"TS\");\n performanceStart();\n debug(\">>> exec start\", { rootNames });\n debug(config);\n\n const { options, errors: configFileParsingDiagnostics } = ts\n .convertCompilerOptionsFromJson(config, \"\");\n // The `allowNonTsExtensions` is a \"hidden\" compiler option used in VSCode\n // which is not allowed to be passed in JSON, we need it to allow special\n // URLs which Deno supports. So we need to either ignore the diagnostic, or\n // inject it ourselves.\n Object.assign(options, { allowNonTsExtensions: true });\n const program = ts.createIncrementalProgram({\n rootNames,\n options,\n host,\n configFileParsingDiagnostics,\n });\n\n const { diagnostics: emitDiagnostics } = program.emit();\n\n const diagnostics = [\n ...program.getConfigFileParsingDiagnostics(),\n ...program.getSyntacticDiagnostics(),\n ...program.getOptionsDiagnostics(),\n ...program.getGlobalDiagnostics(),\n ...program.getSemanticDiagnostics(),\n ...emitDiagnostics,\n ].filter(({ code }) => !IGNORED_DIAGNOSTICS.includes(code));\n performanceProgram({ program });\n\n core.jsonOpSync(\"op_respond\", {\n diagnostics: fromTypeScriptDiagnostic(diagnostics),\n stats: performanceEnd(),\n });\n debug(\"<<< exec stop\");\n }\n\n /**\n * @param {number} id \n * @param {any} data \n */\n function respond(id, data = null) {\n core.jsonOpSync(\"op_respond\", { id, data });\n }\n\n /**\n * @param {LanguageServerRequest} request \n */\n function serverRequest({ id, ...request }) {\n debug(`serverRequest()`, { id, ...request });\n switch (request.method) {\n case \"configure\": {\n const { options, errors } = ts\n .convertCompilerOptionsFromJson(request.compilerOptions, \"\");\n Object.assign(options, { allowNonTsExtensions: true });\n if (errors.length) {\n debug(ts.formatDiagnostics(errors, host));\n }\n compilationSettings = options;\n return respond(id, true);\n }\n case \"getAsset\": {\n const sourceFile = host.getSourceFile(\n request.specifier,\n ts.ScriptTarget.ESNext,\n );\n return respond(id, sourceFile && sourceFile.text);\n }\n case \"getDiagnostics\": {\n try {\n /** @type {Record} */\n const diagnosticMap = {};\n for (const specifier of request.specifiers) {\n diagnosticMap[specifier] = fromTypeScriptDiagnostic([\n ...languageService.getSemanticDiagnostics(specifier),\n ...languageService.getSuggestionDiagnostics(specifier),\n ...languageService.getSyntacticDiagnostics(specifier),\n ].filter(({ code }) => !IGNORED_DIAGNOSTICS.includes(code)));\n }\n return respond(id, diagnosticMap);\n } catch (e) {\n if (\"stack\" in e) {\n error(e.stack);\n } else {\n error(e);\n }\n return respond(id, {});\n }\n }\n case \"getQuickInfo\": {\n return respond(\n id,\n languageService.getQuickInfoAtPosition(\n request.specifier,\n request.position,\n ),\n );\n }\n case \"getCompletions\": {\n return respond(\n id,\n languageService.getCompletionsAtPosition(\n request.specifier,\n request.position,\n request.preferences,\n ),\n );\n }\n case \"getDocumentHighlights\": {\n return respond(\n id,\n languageService.getDocumentHighlights(\n request.specifier,\n request.position,\n request.filesToSearch,\n ),\n );\n }\n case \"getReferences\": {\n return respond(\n id,\n languageService.getReferencesAtPosition(\n request.specifier,\n request.position,\n ),\n );\n }\n case \"getDefinition\": {\n return respond(\n id,\n languageService.getDefinitionAndBoundSpan(\n request.specifier,\n request.position,\n ),\n );\n }\n case \"getImplementation\": {\n return respond(\n id,\n languageService.getImplementationAtPosition(\n request.specifier,\n request.position,\n ),\n );\n }\n case \"findRenameLocations\": {\n return respond(\n id,\n languageService.findRenameLocations(\n request.specifier,\n request.position,\n request.findInStrings,\n request.findInComments,\n request.providePrefixAndSuffixTextForRename,\n ),\n );\n }\n default:\n throw new TypeError(\n // @ts-ignore exhausted case statement sets type to never\n `Invalid request method for request: \"${request.method}\" (${id})`,\n );\n }\n }\n\n /** @param {{ debug: boolean; }} init */\n function serverInit({ debug: debugFlag }) {\n if (hasStarted) {\n throw new Error(\"The language server has already been initialized.\");\n }\n hasStarted = true;\n languageService = ts.createLanguageService(host);\n core.ops();\n setLogDebug(debugFlag, \"TSLS\");\n debug(\"serverInit()\");\n }\n\n let hasStarted = false;\n\n /** Startup the runtime environment, setting various flags.\n * @param {{ debugFlag?: boolean; legacyFlag?: boolean; }} msg\n */\n function startup({ debugFlag = false }) {\n if (hasStarted) {\n throw new Error(\"The compiler runtime already started.\");\n }\n hasStarted = true;\n core.ops();\n setLogDebug(!!debugFlag, \"TS\");\n }\n\n // Setup the compiler runtime during the build process.\n core.ops();\n core.registerErrorClass(\"Error\", Error);\n\n // A build time only op that provides some setup information that is used to\n // ensure the snapshot is setup properly.\n /** @type {{ buildSpecifier: string; libs: string[] }} */\n const { buildSpecifier, libs } = core.jsonOpSync(\"op_build_info\", {});\n for (const lib of libs) {\n const specifier = `lib.${lib}.d.ts`;\n // we are using internal APIs here to \"inject\" our custom libraries into\n // tsc, so things like `\"lib\": [ \"deno.ns\" ]` are supported.\n if (!ts.libs.includes(lib)) {\n ts.libs.push(lib);\n ts.libMap.set(lib, `lib.${lib}.d.ts`);\n }\n // we are caching in memory common type libraries that will be re-used by\n // tsc on when the snapshot is restored\n assert(\n host.getSourceFile(`${ASSETS}${specifier}`, ts.ScriptTarget.ESNext),\n );\n }\n // this helps ensure as much as possible is in memory that is re-usable\n // before the snapshotting is done, which helps unsure fast \"startup\" for\n // subsequent uses of tsc in Deno.\n const TS_SNAPSHOT_PROGRAM = ts.createProgram({\n rootNames: [buildSpecifier],\n options: SNAPSHOT_COMPILE_OPTIONS,\n host,\n });\n ts.getPreEmitDiagnostics(TS_SNAPSHOT_PROGRAM);\n\n // exposes the two functions that are called by `tsc::exec()` when type\n // checking TypeScript.\n globalThis.startup = startup;\n globalThis.exec = exec;\n\n // exposes the functions that are called when the compiler is used as a\n // language service.\n globalThis.serverInit = serverInit;\n globalThis.serverRequest = serverRequest;\n})(this);\n" + } +} diff --git a/cli/tests/lsp/did_open_params_semantic_tokens.json b/cli/tests/testdata/lsp/did_open_params_semantic_tokens.json similarity index 100% rename from cli/tests/lsp/did_open_params_semantic_tokens.json rename to cli/tests/testdata/lsp/did_open_params_semantic_tokens.json diff --git a/cli/tests/lsp/did_open_params_test_code_lens.json b/cli/tests/testdata/lsp/did_open_params_test_code_lens.json similarity index 100% rename from cli/tests/lsp/did_open_params_test_code_lens.json rename to cli/tests/testdata/lsp/did_open_params_test_code_lens.json diff --git a/cli/tests/lsp/document_symbol_response.json b/cli/tests/testdata/lsp/document_symbol_response.json similarity index 100% rename from cli/tests/lsp/document_symbol_response.json rename to cli/tests/testdata/lsp/document_symbol_response.json diff --git a/cli/tests/lsp/formatting_mbc_response.json b/cli/tests/testdata/lsp/formatting_mbc_response.json similarity index 100% rename from cli/tests/lsp/formatting_mbc_response.json rename to cli/tests/testdata/lsp/formatting_mbc_response.json diff --git a/cli/tests/lsp/import-map.json b/cli/tests/testdata/lsp/import-map.json similarity index 100% rename from cli/tests/lsp/import-map.json rename to cli/tests/testdata/lsp/import-map.json diff --git a/cli/tests/lsp/incoming_calls_params.json b/cli/tests/testdata/lsp/incoming_calls_params.json similarity index 100% rename from cli/tests/lsp/incoming_calls_params.json rename to cli/tests/testdata/lsp/incoming_calls_params.json diff --git a/cli/tests/lsp/incoming_calls_response.json b/cli/tests/testdata/lsp/incoming_calls_response.json similarity index 100% rename from cli/tests/lsp/incoming_calls_response.json rename to cli/tests/testdata/lsp/incoming_calls_response.json diff --git a/cli/tests/lsp/initialize_params.json b/cli/tests/testdata/lsp/initialize_params.json similarity index 100% rename from cli/tests/lsp/initialize_params.json rename to cli/tests/testdata/lsp/initialize_params.json diff --git a/cli/tests/lsp/initialize_params_bad_config_option.json b/cli/tests/testdata/lsp/initialize_params_bad_config_option.json similarity index 100% rename from cli/tests/lsp/initialize_params_bad_config_option.json rename to cli/tests/testdata/lsp/initialize_params_bad_config_option.json diff --git a/cli/tests/lsp/initialize_params_ca_no_disabled.json b/cli/tests/testdata/lsp/initialize_params_ca_no_disabled.json similarity index 100% rename from cli/tests/lsp/initialize_params_ca_no_disabled.json rename to cli/tests/testdata/lsp/initialize_params_ca_no_disabled.json diff --git a/cli/tests/lsp/initialize_params_code_lens_test.json b/cli/tests/testdata/lsp/initialize_params_code_lens_test.json similarity index 100% rename from cli/tests/lsp/initialize_params_code_lens_test.json rename to cli/tests/testdata/lsp/initialize_params_code_lens_test.json diff --git a/cli/tests/lsp/initialize_params_code_lens_test_disabled.json b/cli/tests/testdata/lsp/initialize_params_code_lens_test_disabled.json similarity index 100% rename from cli/tests/lsp/initialize_params_code_lens_test_disabled.json rename to cli/tests/testdata/lsp/initialize_params_code_lens_test_disabled.json diff --git a/cli/tests/lsp/initialize_params_did_config_change.json b/cli/tests/testdata/lsp/initialize_params_did_config_change.json similarity index 100% rename from cli/tests/lsp/initialize_params_did_config_change.json rename to cli/tests/testdata/lsp/initialize_params_did_config_change.json diff --git a/cli/tests/lsp/initialize_params_disabled.json b/cli/tests/testdata/lsp/initialize_params_disabled.json similarity index 100% rename from cli/tests/lsp/initialize_params_disabled.json rename to cli/tests/testdata/lsp/initialize_params_disabled.json diff --git a/cli/tests/lsp/initialize_params_registry.json b/cli/tests/testdata/lsp/initialize_params_registry.json similarity index 100% rename from cli/tests/lsp/initialize_params_registry.json rename to cli/tests/testdata/lsp/initialize_params_registry.json diff --git a/cli/tests/lsp/initialize_params_unstable.json b/cli/tests/testdata/lsp/initialize_params_unstable.json similarity index 100% rename from cli/tests/lsp/initialize_params_unstable.json rename to cli/tests/testdata/lsp/initialize_params_unstable.json diff --git a/cli/tests/lsp/lib.tsconfig.json b/cli/tests/testdata/lsp/lib.tsconfig.json similarity index 100% rename from cli/tests/lsp/lib.tsconfig.json rename to cli/tests/testdata/lsp/lib.tsconfig.json diff --git a/cli/tests/lsp/outgoing_calls_params.json b/cli/tests/testdata/lsp/outgoing_calls_params.json similarity index 100% rename from cli/tests/lsp/outgoing_calls_params.json rename to cli/tests/testdata/lsp/outgoing_calls_params.json diff --git a/cli/tests/lsp/outgoing_calls_response.json b/cli/tests/testdata/lsp/outgoing_calls_response.json similarity index 100% rename from cli/tests/lsp/outgoing_calls_response.json rename to cli/tests/testdata/lsp/outgoing_calls_response.json diff --git a/cli/tests/lsp/prepare_call_hierarchy_response.json b/cli/tests/testdata/lsp/prepare_call_hierarchy_response.json similarity index 100% rename from cli/tests/lsp/prepare_call_hierarchy_response.json rename to cli/tests/testdata/lsp/prepare_call_hierarchy_response.json diff --git a/cli/tests/lsp/registries/a_latest.json b/cli/tests/testdata/lsp/registries/a_latest.json similarity index 100% rename from cli/tests/lsp/registries/a_latest.json rename to cli/tests/testdata/lsp/registries/a_latest.json diff --git a/cli/tests/lsp/registries/a_v1.0.0.json b/cli/tests/testdata/lsp/registries/a_v1.0.0.json similarity index 100% rename from cli/tests/lsp/registries/a_v1.0.0.json rename to cli/tests/testdata/lsp/registries/a_v1.0.0.json diff --git a/cli/tests/lsp/registries/a_v1.0.1.json b/cli/tests/testdata/lsp/registries/a_v1.0.1.json similarity index 100% rename from cli/tests/lsp/registries/a_v1.0.1.json rename to cli/tests/testdata/lsp/registries/a_v1.0.1.json diff --git a/cli/tests/lsp/registries/a_v2.0.0.json b/cli/tests/testdata/lsp/registries/a_v2.0.0.json similarity index 100% rename from cli/tests/lsp/registries/a_v2.0.0.json rename to cli/tests/testdata/lsp/registries/a_v2.0.0.json diff --git a/cli/tests/lsp/registries/a_versions.json b/cli/tests/testdata/lsp/registries/a_versions.json similarity index 100% rename from cli/tests/lsp/registries/a_versions.json rename to cli/tests/testdata/lsp/registries/a_versions.json diff --git a/cli/tests/lsp/registries/b_latest.json b/cli/tests/testdata/lsp/registries/b_latest.json similarity index 100% rename from cli/tests/lsp/registries/b_latest.json rename to cli/tests/testdata/lsp/registries/b_latest.json diff --git a/cli/tests/lsp/registries/b_v0.0.1.json b/cli/tests/testdata/lsp/registries/b_v0.0.1.json similarity index 100% rename from cli/tests/lsp/registries/b_v0.0.1.json rename to cli/tests/testdata/lsp/registries/b_v0.0.1.json diff --git a/cli/tests/lsp/registries/b_v0.0.2.json b/cli/tests/testdata/lsp/registries/b_v0.0.2.json similarity index 100% rename from cli/tests/lsp/registries/b_v0.0.2.json rename to cli/tests/testdata/lsp/registries/b_v0.0.2.json diff --git a/cli/tests/lsp/registries/b_v0.0.3.json b/cli/tests/testdata/lsp/registries/b_v0.0.3.json similarity index 100% rename from cli/tests/lsp/registries/b_v0.0.3.json rename to cli/tests/testdata/lsp/registries/b_v0.0.3.json diff --git a/cli/tests/lsp/registries/b_versions.json b/cli/tests/testdata/lsp/registries/b_versions.json similarity index 100% rename from cli/tests/lsp/registries/b_versions.json rename to cli/tests/testdata/lsp/registries/b_versions.json diff --git a/cli/tests/lsp/registries/deno-import-intellisense.json b/cli/tests/testdata/lsp/registries/deno-import-intellisense.json similarity index 52% rename from cli/tests/lsp/registries/deno-import-intellisense.json rename to cli/tests/testdata/lsp/registries/deno-import-intellisense.json index ff28fac07f..8aa4a4ecac 100644 --- a/cli/tests/lsp/registries/deno-import-intellisense.json +++ b/cli/tests/testdata/lsp/registries/deno-import-intellisense.json @@ -6,15 +6,15 @@ "variables": [ { "key": "module", - "url": "http://localhost:4545/cli/tests/lsp/registries/modules.json" + "url": "http://localhost:4545/lsp/registries/modules.json" }, { "key": "version", - "url": "http://localhost:4545/cli/tests/lsp/registries/${module}_versions.json" + "url": "http://localhost:4545/lsp/registries/${module}_versions.json" }, { "key": "path", - "url": "http://localhost:4545/cli/tests/lsp/registries/${module}_${{version}}.json" + "url": "http://localhost:4545/lsp/registries/${module}_${{version}}.json" } ] }, @@ -23,11 +23,11 @@ "variables": [ { "key": "module", - "url": "http://localhost:4545/cli/tests/lsp/registries/modules.json" + "url": "http://localhost:4545/lsp/registries/modules.json" }, { "key": "path", - "url": "http://localhost:4545/cli/tests/lsp/registries/${module}_latest.json" + "url": "http://localhost:4545/lsp/registries/${module}_latest.json" } ] } diff --git a/cli/tests/lsp/registries/modules.json b/cli/tests/testdata/lsp/registries/modules.json similarity index 100% rename from cli/tests/lsp/registries/modules.json rename to cli/tests/testdata/lsp/registries/modules.json diff --git a/cli/tests/lsp/rename_response.json b/cli/tests/testdata/lsp/rename_response.json similarity index 100% rename from cli/tests/lsp/rename_response.json rename to cli/tests/testdata/lsp/rename_response.json diff --git a/cli/tests/lsp/selection_range_response.json b/cli/tests/testdata/lsp/selection_range_response.json similarity index 100% rename from cli/tests/lsp/selection_range_response.json rename to cli/tests/testdata/lsp/selection_range_response.json diff --git a/cli/tests/lsp/types.tsconfig.json b/cli/tests/testdata/lsp/types.tsconfig.json similarity index 100% rename from cli/tests/lsp/types.tsconfig.json rename to cli/tests/testdata/lsp/types.tsconfig.json diff --git a/cli/tests/main_module.ts b/cli/tests/testdata/main_module.ts similarity index 100% rename from cli/tests/main_module.ts rename to cli/tests/testdata/main_module.ts diff --git a/cli/tests/testdata/main_module.ts.out b/cli/tests/testdata/main_module.ts.out new file mode 100644 index 0000000000..817bb6b8cf --- /dev/null +++ b/cli/tests/testdata/main_module.ts.out @@ -0,0 +1,2 @@ +main_module2 [WILDCARD]/main_module.ts +main_module [WILDCARD]/main_module.ts diff --git a/cli/tests/main_module2.ts b/cli/tests/testdata/main_module2.ts similarity index 100% rename from cli/tests/main_module2.ts rename to cli/tests/testdata/main_module2.ts diff --git a/cli/tests/module_graph/file_tests-a.mjs b/cli/tests/testdata/module_graph/file_tests-a.mjs similarity index 100% rename from cli/tests/module_graph/file_tests-a.mjs rename to cli/tests/testdata/module_graph/file_tests-a.mjs diff --git a/cli/tests/module_graph/file_tests-b-mod.js b/cli/tests/testdata/module_graph/file_tests-b-mod.js similarity index 100% rename from cli/tests/module_graph/file_tests-b-mod.js rename to cli/tests/testdata/module_graph/file_tests-b-mod.js diff --git a/cli/tests/module_graph/file_tests-b.ts b/cli/tests/testdata/module_graph/file_tests-b.ts similarity index 100% rename from cli/tests/module_graph/file_tests-b.ts rename to cli/tests/testdata/module_graph/file_tests-b.ts diff --git a/cli/tests/module_graph/file_tests-c-mod.ts b/cli/tests/testdata/module_graph/file_tests-c-mod.ts similarity index 100% rename from cli/tests/module_graph/file_tests-c-mod.ts rename to cli/tests/testdata/module_graph/file_tests-c-mod.ts diff --git a/cli/tests/module_graph/file_tests-checkwithconfig.ts b/cli/tests/testdata/module_graph/file_tests-checkwithconfig.ts similarity index 100% rename from cli/tests/module_graph/file_tests-checkwithconfig.ts rename to cli/tests/testdata/module_graph/file_tests-checkwithconfig.ts diff --git a/cli/tests/module_graph/file_tests-diag.ts b/cli/tests/testdata/module_graph/file_tests-diag.ts similarity index 100% rename from cli/tests/module_graph/file_tests-diag.ts rename to cli/tests/testdata/module_graph/file_tests-diag.ts diff --git a/cli/tests/module_graph/file_tests-dynamicimport.ts b/cli/tests/testdata/module_graph/file_tests-dynamicimport.ts similarity index 100% rename from cli/tests/module_graph/file_tests-dynamicimport.ts rename to cli/tests/testdata/module_graph/file_tests-dynamicimport.ts diff --git a/cli/tests/module_graph/file_tests-importjson.ts b/cli/tests/testdata/module_graph/file_tests-importjson.ts similarity index 100% rename from cli/tests/module_graph/file_tests-importjson.ts rename to cli/tests/testdata/module_graph/file_tests-importjson.ts diff --git a/cli/tests/module_graph/file_tests-importremap.ts b/cli/tests/testdata/module_graph/file_tests-importremap.ts similarity index 100% rename from cli/tests/module_graph/file_tests-importremap.ts rename to cli/tests/testdata/module_graph/file_tests-importremap.ts diff --git a/cli/tests/module_graph/file_tests-main.ts b/cli/tests/testdata/module_graph/file_tests-main.ts similarity index 100% rename from cli/tests/module_graph/file_tests-main.ts rename to cli/tests/testdata/module_graph/file_tests-main.ts diff --git a/cli/tests/module_graph/file_tests-some.json b/cli/tests/testdata/module_graph/file_tests-some.json similarity index 100% rename from cli/tests/module_graph/file_tests-some.json rename to cli/tests/testdata/module_graph/file_tests-some.json diff --git a/cli/tests/module_graph/file_typesref.d.ts b/cli/tests/testdata/module_graph/file_typesref.d.ts similarity index 100% rename from cli/tests/module_graph/file_typesref.d.ts rename to cli/tests/testdata/module_graph/file_typesref.d.ts diff --git a/cli/tests/module_graph/file_typesref.js b/cli/tests/testdata/module_graph/file_typesref.js similarity index 100% rename from cli/tests/module_graph/file_typesref.js rename to cli/tests/testdata/module_graph/file_typesref.js diff --git a/cli/tests/module_graph/https_deno.land-std-http-server.ts b/cli/tests/testdata/module_graph/https_deno.land-std-http-server.ts similarity index 100% rename from cli/tests/module_graph/https_deno.land-std-http-server.ts rename to cli/tests/testdata/module_graph/https_deno.land-std-http-server.ts diff --git a/cli/tests/module_graph/https_deno.land-x-a-mod.ts b/cli/tests/testdata/module_graph/https_deno.land-x-a-mod.ts similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-a-mod.ts rename to cli/tests/testdata/module_graph/https_deno.land-x-a-mod.ts diff --git a/cli/tests/module_graph/https_deno.land-x-a.ts b/cli/tests/testdata/module_graph/https_deno.land-x-a.ts similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-a.ts rename to cli/tests/testdata/module_graph/https_deno.land-x-a.ts diff --git a/cli/tests/module_graph/https_deno.land-x-import_map.ts b/cli/tests/testdata/module_graph/https_deno.land-x-import_map.ts similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-import_map.ts rename to cli/tests/testdata/module_graph/https_deno.land-x-import_map.ts diff --git a/cli/tests/module_graph/https_deno.land-x-jquery.js b/cli/tests/testdata/module_graph/https_deno.land-x-jquery.js similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-jquery.js rename to cli/tests/testdata/module_graph/https_deno.land-x-jquery.js diff --git a/cli/tests/module_graph/https_deno.land-x-lib-a.ts b/cli/tests/testdata/module_graph/https_deno.land-x-lib-a.ts similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-lib-a.ts rename to cli/tests/testdata/module_graph/https_deno.land-x-lib-a.ts diff --git a/cli/tests/module_graph/https_deno.land-x-lib-b.js b/cli/tests/testdata/module_graph/https_deno.land-x-lib-b.js similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-lib-b.js rename to cli/tests/testdata/module_graph/https_deno.land-x-lib-b.js diff --git a/cli/tests/module_graph/https_deno.land-x-lib-c.d.ts b/cli/tests/testdata/module_graph/https_deno.land-x-lib-c.d.ts similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-lib-c.d.ts rename to cli/tests/testdata/module_graph/https_deno.land-x-lib-c.d.ts diff --git a/cli/tests/module_graph/https_deno.land-x-lib-c.js b/cli/tests/testdata/module_graph/https_deno.land-x-lib-c.js similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-lib-c.js rename to cli/tests/testdata/module_graph/https_deno.land-x-lib-c.js diff --git a/cli/tests/module_graph/https_deno.land-x-lib-mod.d.ts b/cli/tests/testdata/module_graph/https_deno.land-x-lib-mod.d.ts similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-lib-mod.d.ts rename to cli/tests/testdata/module_graph/https_deno.land-x-lib-mod.d.ts diff --git a/cli/tests/module_graph/https_deno.land-x-lib-mod.js b/cli/tests/testdata/module_graph/https_deno.land-x-lib-mod.js similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-lib-mod.js rename to cli/tests/testdata/module_graph/https_deno.land-x-lib-mod.js diff --git a/cli/tests/module_graph/https_deno.land-x-mod.ts b/cli/tests/testdata/module_graph/https_deno.land-x-mod.ts similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-mod.ts rename to cli/tests/testdata/module_graph/https_deno.land-x-mod.ts diff --git a/cli/tests/module_graph/https_deno.land-x-transpile.tsx b/cli/tests/testdata/module_graph/https_deno.land-x-transpile.tsx similarity index 100% rename from cli/tests/module_graph/https_deno.land-x-transpile.tsx rename to cli/tests/testdata/module_graph/https_deno.land-x-transpile.tsx diff --git a/cli/tests/module_graph/https_unpkg.com-lodash-index.js b/cli/tests/testdata/module_graph/https_unpkg.com-lodash-index.js similarity index 100% rename from cli/tests/module_graph/https_unpkg.com-lodash-index.js rename to cli/tests/testdata/module_graph/https_unpkg.com-lodash-index.js diff --git a/cli/tests/module_graph/lockfile.json b/cli/tests/testdata/module_graph/lockfile.json similarity index 100% rename from cli/tests/module_graph/lockfile.json rename to cli/tests/testdata/module_graph/lockfile.json diff --git a/cli/tests/module_graph/lockfile_fail.json b/cli/tests/testdata/module_graph/lockfile_fail.json similarity index 100% rename from cli/tests/module_graph/lockfile_fail.json rename to cli/tests/testdata/module_graph/lockfile_fail.json diff --git a/cli/tests/module_graph/tsconfig.json b/cli/tests/testdata/module_graph/tsconfig.json similarity index 100% rename from cli/tests/module_graph/tsconfig.json rename to cli/tests/testdata/module_graph/tsconfig.json diff --git a/cli/tests/module_graph/tsconfig_01.json b/cli/tests/testdata/module_graph/tsconfig_01.json similarity index 100% rename from cli/tests/module_graph/tsconfig_01.json rename to cli/tests/testdata/module_graph/tsconfig_01.json diff --git a/cli/tests/no_check_decorators.ts b/cli/tests/testdata/no_check_decorators.ts similarity index 100% rename from cli/tests/no_check_decorators.ts rename to cli/tests/testdata/no_check_decorators.ts diff --git a/cli/tests/no_check_decorators.ts.out b/cli/tests/testdata/no_check_decorators.ts.out similarity index 100% rename from cli/tests/no_check_decorators.ts.out rename to cli/tests/testdata/no_check_decorators.ts.out diff --git a/cli/tests/no_color.js b/cli/tests/testdata/no_color.js similarity index 100% rename from cli/tests/no_color.js rename to cli/tests/testdata/no_color.js diff --git a/cli/tests/no_mem_cache.js b/cli/tests/testdata/no_mem_cache.js similarity index 100% rename from cli/tests/no_mem_cache.js rename to cli/tests/testdata/no_mem_cache.js diff --git a/cli/tests/no_mem_cache.js.out b/cli/tests/testdata/no_mem_cache.js.out similarity index 100% rename from cli/tests/no_mem_cache.js.out rename to cli/tests/testdata/no_mem_cache.js.out diff --git a/cli/tests/no_validate_asm.js b/cli/tests/testdata/no_validate_asm.js similarity index 100% rename from cli/tests/no_validate_asm.js rename to cli/tests/testdata/no_validate_asm.js diff --git a/cli/tests/performance_stats.out b/cli/tests/testdata/performance_stats.out similarity index 100% rename from cli/tests/performance_stats.out rename to cli/tests/testdata/performance_stats.out diff --git a/cli/tests/permission_test.ts b/cli/tests/testdata/permission_test.ts similarity index 95% rename from cli/tests/permission_test.ts rename to cli/tests/testdata/permission_test.ts index 057e935afd..a3a38f2a05 100644 --- a/cli/tests/permission_test.ts +++ b/cli/tests/testdata/permission_test.ts @@ -3,7 +3,7 @@ const name = Deno.args[0]; // deno-lint-ignore no-explicit-any const test: { [key: string]: (...args: any[]) => void | Promise } = { readRequired() { - Deno.readFileSync("README.md"); + Deno.readFileSync("hello.txt"); return Promise.resolve(); }, writeRequired() { diff --git a/cli/tests/preserve_imports.tsconfig.json b/cli/tests/testdata/preserve_imports.tsconfig.json similarity index 100% rename from cli/tests/preserve_imports.tsconfig.json rename to cli/tests/testdata/preserve_imports.tsconfig.json diff --git a/cli/tests/proto_exploit.js b/cli/tests/testdata/proto_exploit.js similarity index 100% rename from cli/tests/proto_exploit.js rename to cli/tests/testdata/proto_exploit.js diff --git a/cli/tests/proto_exploit.js.out b/cli/tests/testdata/proto_exploit.js.out similarity index 100% rename from cli/tests/proto_exploit.js.out rename to cli/tests/testdata/proto_exploit.js.out diff --git a/cli/tests/raw_mode.ts b/cli/tests/testdata/raw_mode.ts similarity index 100% rename from cli/tests/raw_mode.ts rename to cli/tests/testdata/raw_mode.ts diff --git a/cli/tests/raw_mode_cbreak.ts b/cli/tests/testdata/raw_mode_cbreak.ts similarity index 100% rename from cli/tests/raw_mode_cbreak.ts rename to cli/tests/testdata/raw_mode_cbreak.ts diff --git a/cli/tests/recursive_imports/A.ts b/cli/tests/testdata/recursive_imports/A.ts similarity index 100% rename from cli/tests/recursive_imports/A.ts rename to cli/tests/testdata/recursive_imports/A.ts diff --git a/cli/tests/recursive_imports/B.ts b/cli/tests/testdata/recursive_imports/B.ts similarity index 100% rename from cli/tests/recursive_imports/B.ts rename to cli/tests/testdata/recursive_imports/B.ts diff --git a/cli/tests/recursive_imports/C.ts b/cli/tests/testdata/recursive_imports/C.ts similarity index 100% rename from cli/tests/recursive_imports/C.ts rename to cli/tests/testdata/recursive_imports/C.ts diff --git a/cli/tests/recursive_imports/common.ts b/cli/tests/testdata/recursive_imports/common.ts similarity index 100% rename from cli/tests/recursive_imports/common.ts rename to cli/tests/testdata/recursive_imports/common.ts diff --git a/cli/tests/testdata/redirect_cache.out b/cli/tests/testdata/redirect_cache.out new file mode 100644 index 0000000000..8905c45299 --- /dev/null +++ b/cli/tests/testdata/redirect_cache.out @@ -0,0 +1,5 @@ +Download http://localhost:4548/subdir/redirects/a.ts +Download http://localhost:4546/subdir/redirects/a.ts +Download http://localhost:4545/subdir/redirects/a.ts +Download http://localhost:4545/subdir/redirects/b.ts +Check http://localhost:4548/subdir/redirects/a.ts diff --git a/cli/tests/reference_types.ts b/cli/tests/testdata/reference_types.ts similarity index 100% rename from cli/tests/reference_types.ts rename to cli/tests/testdata/reference_types.ts diff --git a/cli/tests/reference_types.ts.out b/cli/tests/testdata/reference_types.ts.out similarity index 100% rename from cli/tests/reference_types.ts.out rename to cli/tests/testdata/reference_types.ts.out diff --git a/cli/tests/testdata/reference_types_remote.ts b/cli/tests/testdata/reference_types_remote.ts new file mode 100644 index 0000000000..e7fa81b2c1 --- /dev/null +++ b/cli/tests/testdata/reference_types_remote.ts @@ -0,0 +1,3 @@ +/// + +console.log(globalThis.a); diff --git a/cli/tests/reference_types_remote.ts.out b/cli/tests/testdata/reference_types_remote.ts.out similarity index 100% rename from cli/tests/reference_types_remote.ts.out rename to cli/tests/testdata/reference_types_remote.ts.out diff --git a/cli/tests/resolve_dns.ts b/cli/tests/testdata/resolve_dns.ts similarity index 100% rename from cli/tests/resolve_dns.ts rename to cli/tests/testdata/resolve_dns.ts diff --git a/cli/tests/resolve_dns.ts.out b/cli/tests/testdata/resolve_dns.ts.out similarity index 100% rename from cli/tests/resolve_dns.ts.out rename to cli/tests/testdata/resolve_dns.ts.out diff --git a/cli/tests/runtime_decorators.ts b/cli/tests/testdata/runtime_decorators.ts similarity index 100% rename from cli/tests/runtime_decorators.ts rename to cli/tests/testdata/runtime_decorators.ts diff --git a/cli/tests/runtime_decorators.ts.out b/cli/tests/testdata/runtime_decorators.ts.out similarity index 100% rename from cli/tests/runtime_decorators.ts.out rename to cli/tests/testdata/runtime_decorators.ts.out diff --git a/cli/tests/seed_random.js b/cli/tests/testdata/seed_random.js similarity index 100% rename from cli/tests/seed_random.js rename to cli/tests/testdata/seed_random.js diff --git a/cli/tests/seed_random.js.out b/cli/tests/testdata/seed_random.js.out similarity index 100% rename from cli/tests/seed_random.js.out rename to cli/tests/testdata/seed_random.js.out diff --git a/cli/tests/single_compile_with_reload.ts b/cli/tests/testdata/single_compile_with_reload.ts similarity index 100% rename from cli/tests/single_compile_with_reload.ts rename to cli/tests/testdata/single_compile_with_reload.ts diff --git a/cli/tests/single_compile_with_reload.ts.out b/cli/tests/testdata/single_compile_with_reload.ts.out similarity index 100% rename from cli/tests/single_compile_with_reload.ts.out rename to cli/tests/testdata/single_compile_with_reload.ts.out diff --git a/cli/tests/single_compile_with_reload_dyn.ts b/cli/tests/testdata/single_compile_with_reload_dyn.ts similarity index 100% rename from cli/tests/single_compile_with_reload_dyn.ts rename to cli/tests/testdata/single_compile_with_reload_dyn.ts diff --git a/cli/tests/single_compile_with_reload_worker.ts b/cli/tests/testdata/single_compile_with_reload_worker.ts similarity index 100% rename from cli/tests/single_compile_with_reload_worker.ts rename to cli/tests/testdata/single_compile_with_reload_worker.ts diff --git a/cli/tests/standalone_compiler_ops.ts b/cli/tests/testdata/standalone_compiler_ops.ts similarity index 100% rename from cli/tests/standalone_compiler_ops.ts rename to cli/tests/testdata/standalone_compiler_ops.ts diff --git a/cli/tests/standalone_error.ts b/cli/tests/testdata/standalone_error.ts similarity index 100% rename from cli/tests/standalone_error.ts rename to cli/tests/testdata/standalone_error.ts diff --git a/cli/tests/standalone_import.ts b/cli/tests/testdata/standalone_import.ts similarity index 100% rename from cli/tests/standalone_import.ts rename to cli/tests/testdata/standalone_import.ts diff --git a/cli/tests/standalone_import_datauri.ts b/cli/tests/testdata/standalone_import_datauri.ts similarity index 100% rename from cli/tests/standalone_import_datauri.ts rename to cli/tests/testdata/standalone_import_datauri.ts diff --git a/cli/tests/standalone_runtime_flags.ts b/cli/tests/testdata/standalone_runtime_flags.ts similarity index 100% rename from cli/tests/standalone_runtime_flags.ts rename to cli/tests/testdata/standalone_runtime_flags.ts diff --git a/cli/tests/std_lint.out b/cli/tests/testdata/std_lint.out similarity index 100% rename from cli/tests/std_lint.out rename to cli/tests/testdata/std_lint.out diff --git a/cli/tests/stdout_write_all.out b/cli/tests/testdata/stdout_write_all.out similarity index 100% rename from cli/tests/stdout_write_all.out rename to cli/tests/testdata/stdout_write_all.out diff --git a/cli/tests/stdout_write_all.ts b/cli/tests/testdata/stdout_write_all.ts similarity index 100% rename from cli/tests/stdout_write_all.ts rename to cli/tests/testdata/stdout_write_all.ts diff --git a/cli/tests/subdir/amd_like.js b/cli/tests/testdata/subdir/amd_like.js similarity index 100% rename from cli/tests/subdir/amd_like.js rename to cli/tests/testdata/subdir/amd_like.js diff --git a/cli/tests/subdir/auto_print_hello.ts b/cli/tests/testdata/subdir/auto_print_hello.ts similarity index 100% rename from cli/tests/subdir/auto_print_hello.ts rename to cli/tests/testdata/subdir/auto_print_hello.ts diff --git a/cli/tests/subdir/circular1.ts b/cli/tests/testdata/subdir/circular1.ts similarity index 100% rename from cli/tests/subdir/circular1.ts rename to cli/tests/testdata/subdir/circular1.ts diff --git a/cli/tests/subdir/circular2.ts b/cli/tests/testdata/subdir/circular2.ts similarity index 100% rename from cli/tests/subdir/circular2.ts rename to cli/tests/testdata/subdir/circular2.ts diff --git a/cli/tests/subdir/comment.ts b/cli/tests/testdata/subdir/comment.ts similarity index 100% rename from cli/tests/subdir/comment.ts rename to cli/tests/testdata/subdir/comment.ts diff --git a/cli/tests/subdir/config.json b/cli/tests/testdata/subdir/config.json similarity index 100% rename from cli/tests/subdir/config.json rename to cli/tests/testdata/subdir/config.json diff --git a/cli/tests/subdir/emittable.d.ts b/cli/tests/testdata/subdir/emittable.d.ts similarity index 100% rename from cli/tests/subdir/emittable.d.ts rename to cli/tests/testdata/subdir/emittable.d.ts diff --git a/cli/tests/subdir/empty.ts b/cli/tests/testdata/subdir/empty.ts similarity index 100% rename from cli/tests/subdir/empty.ts rename to cli/tests/testdata/subdir/empty.ts diff --git a/cli/tests/subdir/evil_remote_import.js b/cli/tests/testdata/subdir/evil_remote_import.js similarity index 100% rename from cli/tests/subdir/evil_remote_import.js rename to cli/tests/testdata/subdir/evil_remote_import.js diff --git a/cli/tests/subdir/foo_types.d.ts b/cli/tests/testdata/subdir/foo_types.d.ts similarity index 100% rename from cli/tests/subdir/foo_types.d.ts rename to cli/tests/testdata/subdir/foo_types.d.ts diff --git a/cli/tests/subdir/form_urlencoded.txt b/cli/tests/testdata/subdir/form_urlencoded.txt similarity index 100% rename from cli/tests/subdir/form_urlencoded.txt rename to cli/tests/testdata/subdir/form_urlencoded.txt diff --git a/cli/tests/subdir/indirect_import_error.js b/cli/tests/testdata/subdir/indirect_import_error.js similarity index 100% rename from cli/tests/subdir/indirect_import_error.js rename to cli/tests/testdata/subdir/indirect_import_error.js diff --git a/cli/tests/subdir/indirect_throws.js b/cli/tests/testdata/subdir/indirect_throws.js similarity index 100% rename from cli/tests/subdir/indirect_throws.js rename to cli/tests/testdata/subdir/indirect_throws.js diff --git a/cli/tests/subdir/json_1.json b/cli/tests/testdata/subdir/json_1.json similarity index 100% rename from cli/tests/subdir/json_1.json rename to cli/tests/testdata/subdir/json_1.json diff --git a/cli/tests/subdir/json_2.json b/cli/tests/testdata/subdir/json_2.json similarity index 100% rename from cli/tests/subdir/json_2.json rename to cli/tests/testdata/subdir/json_2.json diff --git a/cli/tests/subdir/main.ts b/cli/tests/testdata/subdir/main.ts similarity index 100% rename from cli/tests/subdir/main.ts rename to cli/tests/testdata/subdir/main.ts diff --git a/cli/tests/subdir/mismatch_ext.ts b/cli/tests/testdata/subdir/mismatch_ext.ts similarity index 100% rename from cli/tests/subdir/mismatch_ext.ts rename to cli/tests/testdata/subdir/mismatch_ext.ts diff --git a/cli/tests/subdir/mod1.ts b/cli/tests/testdata/subdir/mod1.ts similarity index 100% rename from cli/tests/subdir/mod1.ts rename to cli/tests/testdata/subdir/mod1.ts diff --git a/cli/tests/subdir/mod2.ts b/cli/tests/testdata/subdir/mod2.ts similarity index 100% rename from cli/tests/subdir/mod2.ts rename to cli/tests/testdata/subdir/mod2.ts diff --git a/cli/tests/subdir/mod3.js b/cli/tests/testdata/subdir/mod3.js similarity index 100% rename from cli/tests/subdir/mod3.js rename to cli/tests/testdata/subdir/mod3.js diff --git a/cli/tests/subdir/mod4.js b/cli/tests/testdata/subdir/mod4.js similarity index 100% rename from cli/tests/subdir/mod4.js rename to cli/tests/testdata/subdir/mod4.js diff --git a/cli/tests/subdir/mod5.mjs b/cli/tests/testdata/subdir/mod5.mjs similarity index 100% rename from cli/tests/subdir/mod5.mjs rename to cli/tests/testdata/subdir/mod5.mjs diff --git a/cli/tests/subdir/mod6.js b/cli/tests/testdata/subdir/mod6.js similarity index 100% rename from cli/tests/subdir/mod6.js rename to cli/tests/testdata/subdir/mod6.js diff --git a/cli/tests/subdir/more_decorators.ts b/cli/tests/testdata/subdir/more_decorators.ts similarity index 100% rename from cli/tests/subdir/more_decorators.ts rename to cli/tests/testdata/subdir/more_decorators.ts diff --git a/cli/tests/subdir/mt_application_ecmascript.j2.js b/cli/tests/testdata/subdir/mt_application_ecmascript.j2.js similarity index 100% rename from cli/tests/subdir/mt_application_ecmascript.j2.js rename to cli/tests/testdata/subdir/mt_application_ecmascript.j2.js diff --git a/cli/tests/subdir/mt_application_ecmascript_jsx.j2.jsx b/cli/tests/testdata/subdir/mt_application_ecmascript_jsx.j2.jsx similarity index 100% rename from cli/tests/subdir/mt_application_ecmascript_jsx.j2.jsx rename to cli/tests/testdata/subdir/mt_application_ecmascript_jsx.j2.jsx diff --git a/cli/tests/subdir/mt_application_x_javascript.j4.js b/cli/tests/testdata/subdir/mt_application_x_javascript.j4.js similarity index 100% rename from cli/tests/subdir/mt_application_x_javascript.j4.js rename to cli/tests/testdata/subdir/mt_application_x_javascript.j4.js diff --git a/cli/tests/subdir/mt_application_x_javascript_jsx.j4.jsx b/cli/tests/testdata/subdir/mt_application_x_javascript_jsx.j4.jsx similarity index 100% rename from cli/tests/subdir/mt_application_x_javascript_jsx.j4.jsx rename to cli/tests/testdata/subdir/mt_application_x_javascript_jsx.j4.jsx diff --git a/cli/tests/subdir/mt_application_x_typescript.t4.ts b/cli/tests/testdata/subdir/mt_application_x_typescript.t4.ts similarity index 100% rename from cli/tests/subdir/mt_application_x_typescript.t4.ts rename to cli/tests/testdata/subdir/mt_application_x_typescript.t4.ts diff --git a/cli/tests/subdir/mt_application_x_typescript_tsx.t4.tsx b/cli/tests/testdata/subdir/mt_application_x_typescript_tsx.t4.tsx similarity index 100% rename from cli/tests/subdir/mt_application_x_typescript_tsx.t4.tsx rename to cli/tests/testdata/subdir/mt_application_x_typescript_tsx.t4.tsx diff --git a/cli/tests/subdir/mt_javascript.js b/cli/tests/testdata/subdir/mt_javascript.js similarity index 100% rename from cli/tests/subdir/mt_javascript.js rename to cli/tests/testdata/subdir/mt_javascript.js diff --git a/cli/tests/subdir/mt_javascript_jsx.jsx b/cli/tests/testdata/subdir/mt_javascript_jsx.jsx similarity index 100% rename from cli/tests/subdir/mt_javascript_jsx.jsx rename to cli/tests/testdata/subdir/mt_javascript_jsx.jsx diff --git a/cli/tests/subdir/mt_text_ecmascript.j3.js b/cli/tests/testdata/subdir/mt_text_ecmascript.j3.js similarity index 100% rename from cli/tests/subdir/mt_text_ecmascript.j3.js rename to cli/tests/testdata/subdir/mt_text_ecmascript.j3.js diff --git a/cli/tests/subdir/mt_text_ecmascript_jsx.j3.jsx b/cli/tests/testdata/subdir/mt_text_ecmascript_jsx.j3.jsx similarity index 100% rename from cli/tests/subdir/mt_text_ecmascript_jsx.j3.jsx rename to cli/tests/testdata/subdir/mt_text_ecmascript_jsx.j3.jsx diff --git a/cli/tests/subdir/mt_text_javascript.j1.js b/cli/tests/testdata/subdir/mt_text_javascript.j1.js similarity index 100% rename from cli/tests/subdir/mt_text_javascript.j1.js rename to cli/tests/testdata/subdir/mt_text_javascript.j1.js diff --git a/cli/tests/subdir/mt_text_javascript_jsx.j1.jsx b/cli/tests/testdata/subdir/mt_text_javascript_jsx.j1.jsx similarity index 100% rename from cli/tests/subdir/mt_text_javascript_jsx.j1.jsx rename to cli/tests/testdata/subdir/mt_text_javascript_jsx.j1.jsx diff --git a/cli/tests/subdir/mt_text_typescript.t1.ts b/cli/tests/testdata/subdir/mt_text_typescript.t1.ts similarity index 100% rename from cli/tests/subdir/mt_text_typescript.t1.ts rename to cli/tests/testdata/subdir/mt_text_typescript.t1.ts diff --git a/cli/tests/subdir/mt_text_typescript_tsx.t1.tsx b/cli/tests/testdata/subdir/mt_text_typescript_tsx.t1.tsx similarity index 100% rename from cli/tests/subdir/mt_text_typescript_tsx.t1.tsx rename to cli/tests/testdata/subdir/mt_text_typescript_tsx.t1.tsx diff --git a/cli/tests/subdir/mt_video_mp2t.t3.ts b/cli/tests/testdata/subdir/mt_video_mp2t.t3.ts similarity index 100% rename from cli/tests/subdir/mt_video_mp2t.t3.ts rename to cli/tests/testdata/subdir/mt_video_mp2t.t3.ts diff --git a/cli/tests/subdir/mt_video_mp2t_tsx.t3.tsx b/cli/tests/testdata/subdir/mt_video_mp2t_tsx.t3.tsx similarity index 100% rename from cli/tests/subdir/mt_video_mp2t_tsx.t3.tsx rename to cli/tests/testdata/subdir/mt_video_mp2t_tsx.t3.tsx diff --git a/cli/tests/subdir/mt_video_vdn.t2.ts b/cli/tests/testdata/subdir/mt_video_vdn.t2.ts similarity index 100% rename from cli/tests/subdir/mt_video_vdn.t2.ts rename to cli/tests/testdata/subdir/mt_video_vdn.t2.ts diff --git a/cli/tests/subdir/mt_video_vdn_tsx.t2.tsx b/cli/tests/testdata/subdir/mt_video_vdn_tsx.t2.tsx similarity index 100% rename from cli/tests/subdir/mt_video_vdn_tsx.t2.tsx rename to cli/tests/testdata/subdir/mt_video_vdn_tsx.t2.tsx diff --git a/cli/tests/subdir/no_ext b/cli/tests/testdata/subdir/no_ext similarity index 100% rename from cli/tests/subdir/no_ext rename to cli/tests/testdata/subdir/no_ext diff --git a/cli/tests/subdir/no_js_ext b/cli/tests/testdata/subdir/no_js_ext similarity index 100% rename from cli/tests/subdir/no_js_ext rename to cli/tests/testdata/subdir/no_js_ext diff --git a/cli/tests/subdir/polyfill.ts b/cli/tests/testdata/subdir/polyfill.ts similarity index 100% rename from cli/tests/subdir/polyfill.ts rename to cli/tests/testdata/subdir/polyfill.ts diff --git a/cli/tests/subdir/print_hello.ts b/cli/tests/testdata/subdir/print_hello.ts similarity index 100% rename from cli/tests/subdir/print_hello.ts rename to cli/tests/testdata/subdir/print_hello.ts diff --git a/cli/tests/subdir/redirects/a.ts b/cli/tests/testdata/subdir/redirects/a.ts similarity index 100% rename from cli/tests/subdir/redirects/a.ts rename to cli/tests/testdata/subdir/redirects/a.ts diff --git a/cli/tests/subdir/redirects/b.ts b/cli/tests/testdata/subdir/redirects/b.ts similarity index 100% rename from cli/tests/subdir/redirects/b.ts rename to cli/tests/testdata/subdir/redirects/b.ts diff --git a/cli/tests/subdir/redirects/redirect1.js b/cli/tests/testdata/subdir/redirects/redirect1.js similarity index 100% rename from cli/tests/subdir/redirects/redirect1.js rename to cli/tests/testdata/subdir/redirects/redirect1.js diff --git a/cli/tests/subdir/redirects/redirect1.ts b/cli/tests/testdata/subdir/redirects/redirect1.ts similarity index 100% rename from cli/tests/subdir/redirects/redirect1.ts rename to cli/tests/testdata/subdir/redirects/redirect1.ts diff --git a/cli/tests/subdir/redirects/redirect2.js b/cli/tests/testdata/subdir/redirects/redirect2.js similarity index 100% rename from cli/tests/subdir/redirects/redirect2.js rename to cli/tests/testdata/subdir/redirects/redirect2.js diff --git a/cli/tests/subdir/redirects/redirect3.js b/cli/tests/testdata/subdir/redirects/redirect3.js similarity index 100% rename from cli/tests/subdir/redirects/redirect3.js rename to cli/tests/testdata/subdir/redirects/redirect3.js diff --git a/cli/tests/subdir/redirects/redirect4.ts b/cli/tests/testdata/subdir/redirects/redirect4.ts similarity index 100% rename from cli/tests/subdir/redirects/redirect4.ts rename to cli/tests/testdata/subdir/redirects/redirect4.ts diff --git a/cli/tests/subdir/single_module.ts b/cli/tests/testdata/subdir/single_module.ts similarity index 100% rename from cli/tests/subdir/single_module.ts rename to cli/tests/testdata/subdir/single_module.ts diff --git a/cli/tests/subdir/subdir2/dynamic_import.ts b/cli/tests/testdata/subdir/subdir2/dynamic_import.ts similarity index 100% rename from cli/tests/subdir/subdir2/dynamic_import.ts rename to cli/tests/testdata/subdir/subdir2/dynamic_import.ts diff --git a/cli/tests/subdir/subdir2/mod2.ts b/cli/tests/testdata/subdir/subdir2/mod2.ts similarity index 100% rename from cli/tests/subdir/subdir2/mod2.ts rename to cli/tests/testdata/subdir/subdir2/mod2.ts diff --git a/cli/tests/subdir/test_worker_basic.js b/cli/tests/testdata/subdir/test_worker_basic.js similarity index 100% rename from cli/tests/subdir/test_worker_basic.js rename to cli/tests/testdata/subdir/test_worker_basic.js diff --git a/cli/tests/subdir/throws.js b/cli/tests/testdata/subdir/throws.js similarity index 100% rename from cli/tests/subdir/throws.js rename to cli/tests/testdata/subdir/throws.js diff --git a/cli/tests/subdir/tla.ts b/cli/tests/testdata/subdir/tla.ts similarity index 100% rename from cli/tests/subdir/tla.ts rename to cli/tests/testdata/subdir/tla.ts diff --git a/cli/tests/subdir/type_and_code.ts b/cli/tests/testdata/subdir/type_and_code.ts similarity index 100% rename from cli/tests/subdir/type_and_code.ts rename to cli/tests/testdata/subdir/type_and_code.ts diff --git a/cli/tests/subdir/type_reference.d.ts b/cli/tests/testdata/subdir/type_reference.d.ts similarity index 100% rename from cli/tests/subdir/type_reference.d.ts rename to cli/tests/testdata/subdir/type_reference.d.ts diff --git a/cli/tests/subdir/type_reference.js b/cli/tests/testdata/subdir/type_reference.js similarity index 100% rename from cli/tests/subdir/type_reference.js rename to cli/tests/testdata/subdir/type_reference.js diff --git a/cli/tests/subdir/types.d.ts b/cli/tests/testdata/subdir/types.d.ts similarity index 100% rename from cli/tests/subdir/types.d.ts rename to cli/tests/testdata/subdir/types.d.ts diff --git a/cli/tests/subdir/unknown_ext.deno b/cli/tests/testdata/subdir/unknown_ext.deno similarity index 100% rename from cli/tests/subdir/unknown_ext.deno rename to cli/tests/testdata/subdir/unknown_ext.deno diff --git a/cli/tests/swc_syntax_error.ts b/cli/tests/testdata/swc_syntax_error.ts similarity index 100% rename from cli/tests/swc_syntax_error.ts rename to cli/tests/testdata/swc_syntax_error.ts diff --git a/cli/tests/swc_syntax_error.ts.out b/cli/tests/testdata/swc_syntax_error.ts.out similarity index 100% rename from cli/tests/swc_syntax_error.ts.out rename to cli/tests/testdata/swc_syntax_error.ts.out diff --git a/cli/tests/symlink_to_subdir b/cli/tests/testdata/symlink_to_subdir similarity index 100% rename from cli/tests/symlink_to_subdir rename to cli/tests/testdata/symlink_to_subdir diff --git a/cli/tests/test/allow_all.out b/cli/tests/testdata/test/allow_all.out similarity index 100% rename from cli/tests/test/allow_all.out rename to cli/tests/testdata/test/allow_all.out diff --git a/cli/tests/test/allow_all.ts b/cli/tests/testdata/test/allow_all.ts similarity index 88% rename from cli/tests/test/allow_all.ts rename to cli/tests/testdata/test/allow_all.ts index b8f8c647d5..abe55a8d53 100644 --- a/cli/tests/test/allow_all.ts +++ b/cli/tests/testdata/test/allow_all.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "../../../test_util/std/testing/asserts.ts"; +import { assertEquals } from "../../../../test_util/std/testing/asserts.ts"; const permissions: Deno.PermissionName[] = [ "read", diff --git a/cli/tests/test/allow_none.out b/cli/tests/testdata/test/allow_none.out similarity index 100% rename from cli/tests/test/allow_none.out rename to cli/tests/testdata/test/allow_none.out diff --git a/cli/tests/test/allow_none.ts b/cli/tests/testdata/test/allow_none.ts similarity index 78% rename from cli/tests/test/allow_none.ts rename to cli/tests/testdata/test/allow_none.ts index 7872c774e5..3153b97553 100644 --- a/cli/tests/test/allow_none.ts +++ b/cli/tests/testdata/test/allow_none.ts @@ -1,4 +1,4 @@ -import { unreachable } from "../../../test_util/std/testing/asserts.ts"; +import { unreachable } from "../../../../test_util/std/testing/asserts.ts"; const permissions: Deno.PermissionName[] = [ "read", diff --git a/cli/tests/test/clear_timeout.out b/cli/tests/testdata/test/clear_timeout.out similarity index 100% rename from cli/tests/test/clear_timeout.out rename to cli/tests/testdata/test/clear_timeout.out diff --git a/cli/tests/test/clear_timeout.ts b/cli/tests/testdata/test/clear_timeout.ts similarity index 100% rename from cli/tests/test/clear_timeout.ts rename to cli/tests/testdata/test/clear_timeout.ts diff --git a/cli/tests/test/doc.out b/cli/tests/testdata/test/doc.out similarity index 100% rename from cli/tests/test/doc.out rename to cli/tests/testdata/test/doc.out diff --git a/cli/tests/test/doc.ts b/cli/tests/testdata/test/doc.ts similarity index 100% rename from cli/tests/test/doc.ts rename to cli/tests/testdata/test/doc.ts diff --git a/cli/tests/test/doc_markdown.out b/cli/tests/testdata/test/doc_markdown.out similarity index 100% rename from cli/tests/test/doc_markdown.out rename to cli/tests/testdata/test/doc_markdown.out diff --git a/cli/tests/test/doc_markdown/doc.md b/cli/tests/testdata/test/doc_markdown/doc.md similarity index 100% rename from cli/tests/test/doc_markdown/doc.md rename to cli/tests/testdata/test/doc_markdown/doc.md diff --git a/cli/tests/test/exit_sanitizer.out b/cli/tests/testdata/test/exit_sanitizer.out similarity index 100% rename from cli/tests/test/exit_sanitizer.out rename to cli/tests/testdata/test/exit_sanitizer.out diff --git a/cli/tests/test/exit_sanitizer.ts b/cli/tests/testdata/test/exit_sanitizer.ts similarity index 100% rename from cli/tests/test/exit_sanitizer.ts rename to cli/tests/testdata/test/exit_sanitizer.ts diff --git a/cli/tests/test/fail.out b/cli/tests/testdata/test/fail.out similarity index 100% rename from cli/tests/test/fail.out rename to cli/tests/testdata/test/fail.out diff --git a/cli/tests/test/fail.ts b/cli/tests/testdata/test/fail.ts similarity index 100% rename from cli/tests/test/fail.ts rename to cli/tests/testdata/test/fail.ts diff --git a/cli/tests/test/fail_fast.out b/cli/tests/testdata/test/fail_fast.out similarity index 100% rename from cli/tests/test/fail_fast.out rename to cli/tests/testdata/test/fail_fast.out diff --git a/cli/tests/test/fail_fast.ts b/cli/tests/testdata/test/fail_fast.ts similarity index 100% rename from cli/tests/test/fail_fast.ts rename to cli/tests/testdata/test/fail_fast.ts diff --git a/cli/tests/test/fail_fast_with_val.out b/cli/tests/testdata/test/fail_fast_with_val.out similarity index 100% rename from cli/tests/test/fail_fast_with_val.out rename to cli/tests/testdata/test/fail_fast_with_val.out diff --git a/cli/tests/test/fail_fast_with_val.ts b/cli/tests/testdata/test/fail_fast_with_val.ts similarity index 100% rename from cli/tests/test/fail_fast_with_val.ts rename to cli/tests/testdata/test/fail_fast_with_val.ts diff --git a/cli/tests/test/finally_timeout.out b/cli/tests/testdata/test/finally_timeout.out similarity index 100% rename from cli/tests/test/finally_timeout.out rename to cli/tests/testdata/test/finally_timeout.out diff --git a/cli/tests/test/finally_timeout.ts b/cli/tests/testdata/test/finally_timeout.ts similarity index 100% rename from cli/tests/test/finally_timeout.ts rename to cli/tests/testdata/test/finally_timeout.ts diff --git a/cli/tests/test/ignore.out b/cli/tests/testdata/test/ignore.out similarity index 100% rename from cli/tests/test/ignore.out rename to cli/tests/testdata/test/ignore.out diff --git a/cli/tests/test/ignore.ts b/cli/tests/testdata/test/ignore.ts similarity index 100% rename from cli/tests/test/ignore.ts rename to cli/tests/testdata/test/ignore.ts diff --git a/cli/tests/test/ignore_permissions.out b/cli/tests/testdata/test/ignore_permissions.out similarity index 100% rename from cli/tests/test/ignore_permissions.out rename to cli/tests/testdata/test/ignore_permissions.out diff --git a/cli/tests/test/ignore_permissions.ts b/cli/tests/testdata/test/ignore_permissions.ts similarity index 100% rename from cli/tests/test/ignore_permissions.ts rename to cli/tests/testdata/test/ignore_permissions.ts diff --git a/cli/tests/test/meta.out b/cli/tests/testdata/test/meta.out similarity index 100% rename from cli/tests/test/meta.out rename to cli/tests/testdata/test/meta.out diff --git a/cli/tests/test/meta.ts b/cli/tests/testdata/test/meta.ts similarity index 100% rename from cli/tests/test/meta.ts rename to cli/tests/testdata/test/meta.ts diff --git a/cli/tests/test/no_check.out b/cli/tests/testdata/test/no_check.out similarity index 100% rename from cli/tests/test/no_check.out rename to cli/tests/testdata/test/no_check.out diff --git a/cli/tests/test/no_check.ts b/cli/tests/testdata/test/no_check.ts similarity index 100% rename from cli/tests/test/no_check.ts rename to cli/tests/testdata/test/no_check.ts diff --git a/cli/tests/test/no_color.ts b/cli/tests/testdata/test/no_color.ts similarity index 100% rename from cli/tests/test/no_color.ts rename to cli/tests/testdata/test/no_color.ts diff --git a/cli/tests/test/no_run.out b/cli/tests/testdata/test/no_run.out similarity index 100% rename from cli/tests/test/no_run.out rename to cli/tests/testdata/test/no_run.out diff --git a/cli/tests/test/no_run.ts b/cli/tests/testdata/test/no_run.ts similarity index 100% rename from cli/tests/test/no_run.ts rename to cli/tests/testdata/test/no_run.ts diff --git a/cli/tests/test/only.out b/cli/tests/testdata/test/only.out similarity index 100% rename from cli/tests/test/only.out rename to cli/tests/testdata/test/only.out diff --git a/cli/tests/test/only.ts b/cli/tests/testdata/test/only.ts similarity index 100% rename from cli/tests/test/only.ts rename to cli/tests/testdata/test/only.ts diff --git a/cli/tests/test/pass.out b/cli/tests/testdata/test/pass.out similarity index 100% rename from cli/tests/test/pass.out rename to cli/tests/testdata/test/pass.out diff --git a/cli/tests/test/pass.ts b/cli/tests/testdata/test/pass.ts similarity index 100% rename from cli/tests/test/pass.ts rename to cli/tests/testdata/test/pass.ts diff --git a/cli/tests/test/quiet.out b/cli/tests/testdata/test/quiet.out similarity index 100% rename from cli/tests/test/quiet.out rename to cli/tests/testdata/test/quiet.out diff --git a/cli/tests/test/quiet.ts b/cli/tests/testdata/test/quiet.ts similarity index 100% rename from cli/tests/test/quiet.ts rename to cli/tests/testdata/test/quiet.ts diff --git a/cli/tests/test/shuffle.out b/cli/tests/testdata/test/shuffle.out similarity index 100% rename from cli/tests/test/shuffle.out rename to cli/tests/testdata/test/shuffle.out diff --git a/cli/tests/test/shuffle/bar_test.ts b/cli/tests/testdata/test/shuffle/bar_test.ts similarity index 100% rename from cli/tests/test/shuffle/bar_test.ts rename to cli/tests/testdata/test/shuffle/bar_test.ts diff --git a/cli/tests/test/shuffle/baz_test.ts b/cli/tests/testdata/test/shuffle/baz_test.ts similarity index 100% rename from cli/tests/test/shuffle/baz_test.ts rename to cli/tests/testdata/test/shuffle/baz_test.ts diff --git a/cli/tests/test/shuffle/foo_test.ts b/cli/tests/testdata/test/shuffle/foo_test.ts similarity index 100% rename from cli/tests/test/shuffle/foo_test.ts rename to cli/tests/testdata/test/shuffle/foo_test.ts diff --git a/cli/tests/test/unhandled_rejection.out b/cli/tests/testdata/test/unhandled_rejection.out similarity index 100% rename from cli/tests/test/unhandled_rejection.out rename to cli/tests/testdata/test/unhandled_rejection.out diff --git a/cli/tests/test/unhandled_rejection.ts b/cli/tests/testdata/test/unhandled_rejection.ts similarity index 100% rename from cli/tests/test/unhandled_rejection.ts rename to cli/tests/testdata/test/unhandled_rejection.ts diff --git a/cli/tests/test/unresolved_promise.out b/cli/tests/testdata/test/unresolved_promise.out similarity index 100% rename from cli/tests/test/unresolved_promise.out rename to cli/tests/testdata/test/unresolved_promise.out diff --git a/cli/tests/test/unresolved_promise.ts b/cli/tests/testdata/test/unresolved_promise.ts similarity index 100% rename from cli/tests/test/unresolved_promise.ts rename to cli/tests/testdata/test/unresolved_promise.ts diff --git a/cli/tests/text_decoder_perf.js b/cli/tests/testdata/text_decoder_perf.js similarity index 100% rename from cli/tests/text_decoder_perf.js rename to cli/tests/testdata/text_decoder_perf.js diff --git a/cli/tests/text_encoder_into_perf.js b/cli/tests/testdata/text_encoder_into_perf.js similarity index 100% rename from cli/tests/text_encoder_into_perf.js rename to cli/tests/testdata/text_encoder_into_perf.js diff --git a/cli/tests/text_encoder_perf.js b/cli/tests/testdata/text_encoder_perf.js similarity index 100% rename from cli/tests/text_encoder_perf.js rename to cli/tests/testdata/text_encoder_perf.js diff --git a/cli/tests/tla/a.js b/cli/tests/testdata/tla/a.js similarity index 100% rename from cli/tests/tla/a.js rename to cli/tests/testdata/tla/a.js diff --git a/cli/tests/tla/b.js b/cli/tests/testdata/tla/b.js similarity index 100% rename from cli/tests/tla/b.js rename to cli/tests/testdata/tla/b.js diff --git a/cli/tests/tla/c.js b/cli/tests/testdata/tla/c.js similarity index 100% rename from cli/tests/tla/c.js rename to cli/tests/testdata/tla/c.js diff --git a/cli/tests/tla/d.js b/cli/tests/testdata/tla/d.js similarity index 100% rename from cli/tests/tla/d.js rename to cli/tests/testdata/tla/d.js diff --git a/cli/tests/tla/order.js b/cli/tests/testdata/tla/order.js similarity index 100% rename from cli/tests/tla/order.js rename to cli/tests/testdata/tla/order.js diff --git a/cli/tests/tla/parent.js b/cli/tests/testdata/tla/parent.js similarity index 100% rename from cli/tests/tla/parent.js rename to cli/tests/testdata/tla/parent.js diff --git a/cli/tests/tla2/a.js b/cli/tests/testdata/tla2/a.js similarity index 100% rename from cli/tests/tla2/a.js rename to cli/tests/testdata/tla2/a.js diff --git a/cli/tests/tla2/b.js b/cli/tests/testdata/tla2/b.js similarity index 100% rename from cli/tests/tla2/b.js rename to cli/tests/testdata/tla2/b.js diff --git a/cli/tests/tla3/b.js b/cli/tests/testdata/tla3/b.js similarity index 100% rename from cli/tests/tla3/b.js rename to cli/tests/testdata/tla3/b.js diff --git a/cli/tests/tla3/timeout_loop.js b/cli/tests/testdata/tla3/timeout_loop.js similarity index 100% rename from cli/tests/tla3/timeout_loop.js rename to cli/tests/testdata/tla3/timeout_loop.js diff --git a/cli/tests/tls.out b/cli/tests/testdata/tls.out similarity index 100% rename from cli/tests/tls.out rename to cli/tests/testdata/tls.out diff --git a/cli/tests/tls/README.md b/cli/tests/testdata/tls/README.md similarity index 100% rename from cli/tests/tls/README.md rename to cli/tests/testdata/tls/README.md diff --git a/cli/tests/tls/RootCA.crt b/cli/tests/testdata/tls/RootCA.crt similarity index 100% rename from cli/tests/tls/RootCA.crt rename to cli/tests/testdata/tls/RootCA.crt diff --git a/cli/tests/tls/RootCA.key b/cli/tests/testdata/tls/RootCA.key similarity index 100% rename from cli/tests/tls/RootCA.key rename to cli/tests/testdata/tls/RootCA.key diff --git a/cli/tests/tls/RootCA.pem b/cli/tests/testdata/tls/RootCA.pem similarity index 100% rename from cli/tests/tls/RootCA.pem rename to cli/tests/testdata/tls/RootCA.pem diff --git a/cli/tests/tls/domains.txt b/cli/tests/testdata/tls/domains.txt similarity index 100% rename from cli/tests/tls/domains.txt rename to cli/tests/testdata/tls/domains.txt diff --git a/cli/tests/tls/localhost.crt b/cli/tests/testdata/tls/localhost.crt similarity index 100% rename from cli/tests/tls/localhost.crt rename to cli/tests/testdata/tls/localhost.crt diff --git a/cli/tests/tls/localhost.key b/cli/tests/testdata/tls/localhost.key similarity index 100% rename from cli/tests/tls/localhost.key rename to cli/tests/testdata/tls/localhost.key diff --git a/cli/tests/tls_connecttls.js b/cli/tests/testdata/tls_connecttls.js similarity index 84% rename from cli/tests/tls_connecttls.js rename to cli/tests/testdata/tls_connecttls.js index 1ef6b99ee8..1e8cf320cf 100644 --- a/cli/tests/tls_connecttls.js +++ b/cli/tests/testdata/tls_connecttls.js @@ -1,7 +1,10 @@ -import { deferred } from "../../test_util/std/async/deferred.ts"; -import { assert, assertEquals } from "../../test_util/std/testing/asserts.ts"; -import { BufReader, BufWriter } from "../../test_util/std/io/bufio.ts"; -import { TextProtoReader } from "../../test_util/std/textproto/mod.ts"; +import { deferred } from "../../../test_util/std/async/deferred.ts"; +import { + assert, + assertEquals, +} from "../../../test_util/std/testing/asserts.ts"; +import { BufReader, BufWriter } from "../../../test_util/std/io/bufio.ts"; +import { TextProtoReader } from "../../../test_util/std/textproto/mod.ts"; const encoder = new TextEncoder(); const decoder = new TextDecoder(); diff --git a/cli/tests/tls_starttls.js b/cli/tests/testdata/tls_starttls.js similarity index 84% rename from cli/tests/tls_starttls.js rename to cli/tests/testdata/tls_starttls.js index 652ba869fb..9b8767eaac 100644 --- a/cli/tests/tls_starttls.js +++ b/cli/tests/testdata/tls_starttls.js @@ -1,7 +1,10 @@ -import { deferred } from "../../test_util/std/async/deferred.ts"; -import { assert, assertEquals } from "../../test_util/std/testing/asserts.ts"; -import { BufReader, BufWriter } from "../../test_util/std/io/bufio.ts"; -import { TextProtoReader } from "../../test_util/std/textproto/mod.ts"; +import { deferred } from "../../../test_util/std/async/deferred.ts"; +import { + assert, + assertEquals, +} from "../../../test_util/std/testing/asserts.ts"; +import { BufReader, BufWriter } from "../../../test_util/std/io/bufio.ts"; +import { TextProtoReader } from "../../../test_util/std/textproto/mod.ts"; const encoder = new TextEncoder(); const decoder = new TextDecoder(); diff --git a/cli/tests/top_level_await.js b/cli/tests/testdata/top_level_await.js similarity index 100% rename from cli/tests/top_level_await.js rename to cli/tests/testdata/top_level_await.js diff --git a/cli/tests/top_level_await.out b/cli/tests/testdata/top_level_await.out similarity index 100% rename from cli/tests/top_level_await.out rename to cli/tests/testdata/top_level_await.out diff --git a/cli/tests/top_level_await.ts b/cli/tests/testdata/top_level_await.ts similarity index 100% rename from cli/tests/top_level_await.ts rename to cli/tests/testdata/top_level_await.ts diff --git a/cli/tests/top_level_await_circular.js b/cli/tests/testdata/top_level_await_circular.js similarity index 100% rename from cli/tests/top_level_await_circular.js rename to cli/tests/testdata/top_level_await_circular.js diff --git a/cli/tests/top_level_await_circular.out b/cli/tests/testdata/top_level_await_circular.out similarity index 90% rename from cli/tests/top_level_await_circular.out rename to cli/tests/testdata/top_level_await_circular.out index 3b453122e1..fcbc001c3f 100644 --- a/cli/tests/top_level_await_circular.out +++ b/cli/tests/testdata/top_level_await_circular.out @@ -6,4 +6,4 @@ timeout loop 4 timeout loop 5 error: Dynamically imported module evaluation is still pending but there are no pending ops. This situation is often caused by unresolved promise. Pending dynamic modules: -- [WILDCARD]tests/tla3/b.js +- [WILDCARD]/tla3/b.js diff --git a/cli/tests/top_level_await_loop.js b/cli/tests/testdata/top_level_await_loop.js similarity index 100% rename from cli/tests/top_level_await_loop.js rename to cli/tests/testdata/top_level_await_loop.js diff --git a/cli/tests/top_level_await_loop.out b/cli/tests/testdata/top_level_await_loop.out similarity index 100% rename from cli/tests/top_level_await_loop.out rename to cli/tests/testdata/top_level_await_loop.out diff --git a/cli/tests/top_level_await_nested.out b/cli/tests/testdata/top_level_await_nested.out similarity index 100% rename from cli/tests/top_level_await_nested.out rename to cli/tests/testdata/top_level_await_nested.out diff --git a/cli/tests/top_level_await_nested/a.js b/cli/tests/testdata/top_level_await_nested/a.js similarity index 100% rename from cli/tests/top_level_await_nested/a.js rename to cli/tests/testdata/top_level_await_nested/a.js diff --git a/cli/tests/top_level_await_nested/b.js b/cli/tests/testdata/top_level_await_nested/b.js similarity index 100% rename from cli/tests/top_level_await_nested/b.js rename to cli/tests/testdata/top_level_await_nested/b.js diff --git a/cli/tests/top_level_await_nested/main.js b/cli/tests/testdata/top_level_await_nested/main.js similarity index 100% rename from cli/tests/top_level_await_nested/main.js rename to cli/tests/testdata/top_level_await_nested/main.js diff --git a/cli/tests/top_level_await_order.js b/cli/tests/testdata/top_level_await_order.js similarity index 100% rename from cli/tests/top_level_await_order.js rename to cli/tests/testdata/top_level_await_order.js diff --git a/cli/tests/top_level_await_order.out b/cli/tests/testdata/top_level_await_order.out similarity index 100% rename from cli/tests/top_level_await_order.out rename to cli/tests/testdata/top_level_await_order.out diff --git a/cli/tests/top_level_await_unresolved.js b/cli/tests/testdata/top_level_await_unresolved.js similarity index 100% rename from cli/tests/top_level_await_unresolved.js rename to cli/tests/testdata/top_level_await_unresolved.js diff --git a/cli/tests/top_level_await_unresolved.out b/cli/tests/testdata/top_level_await_unresolved.out similarity index 100% rename from cli/tests/top_level_await_unresolved.out rename to cli/tests/testdata/top_level_await_unresolved.out diff --git a/cli/tests/top_level_for_await.js b/cli/tests/testdata/top_level_for_await.js similarity index 100% rename from cli/tests/top_level_for_await.js rename to cli/tests/testdata/top_level_for_await.js diff --git a/cli/tests/top_level_for_await.out b/cli/tests/testdata/top_level_for_await.out similarity index 100% rename from cli/tests/top_level_for_await.out rename to cli/tests/testdata/top_level_for_await.out diff --git a/cli/tests/top_level_for_await.ts b/cli/tests/testdata/top_level_for_await.ts similarity index 100% rename from cli/tests/top_level_for_await.ts rename to cli/tests/testdata/top_level_for_await.ts diff --git a/cli/tests/ts_decorators.ts b/cli/tests/testdata/ts_decorators.ts similarity index 100% rename from cli/tests/ts_decorators.ts rename to cli/tests/testdata/ts_decorators.ts diff --git a/cli/tests/ts_decorators.ts.out b/cli/tests/testdata/ts_decorators.ts.out similarity index 100% rename from cli/tests/ts_decorators.ts.out rename to cli/tests/testdata/ts_decorators.ts.out diff --git a/cli/tests/ts_decorators_bundle.out b/cli/tests/testdata/ts_decorators_bundle.out similarity index 100% rename from cli/tests/ts_decorators_bundle.out rename to cli/tests/testdata/ts_decorators_bundle.out diff --git a/cli/tests/ts_decorators_bundle.ts b/cli/tests/testdata/ts_decorators_bundle.ts similarity index 100% rename from cli/tests/ts_decorators_bundle.ts rename to cli/tests/testdata/ts_decorators_bundle.ts diff --git a/cli/tests/testdata/ts_import_from_js.deps.js b/cli/tests/testdata/ts_import_from_js.deps.js new file mode 100644 index 0000000000..ef326c444b --- /dev/null +++ b/cli/tests/testdata/ts_import_from_js.deps.js @@ -0,0 +1,2 @@ +import "./005_more_imports.ts"; +export { printHello } from "http://localhost:4545/subdir/mod2.ts"; diff --git a/cli/tests/ts_import_from_js.js b/cli/tests/testdata/ts_import_from_js.js similarity index 100% rename from cli/tests/ts_import_from_js.js rename to cli/tests/testdata/ts_import_from_js.js diff --git a/cli/tests/ts_import_from_js.js.out b/cli/tests/testdata/ts_import_from_js.js.out similarity index 100% rename from cli/tests/ts_import_from_js.js.out rename to cli/tests/testdata/ts_import_from_js.js.out diff --git a/cli/tests/ts_type_imports.ts b/cli/tests/testdata/ts_type_imports.ts similarity index 100% rename from cli/tests/ts_type_imports.ts rename to cli/tests/testdata/ts_type_imports.ts diff --git a/cli/tests/ts_type_imports.ts.out b/cli/tests/testdata/ts_type_imports.ts.out similarity index 100% rename from cli/tests/ts_type_imports.ts.out rename to cli/tests/testdata/ts_type_imports.ts.out diff --git a/cli/tests/ts_type_imports_foo.ts b/cli/tests/testdata/ts_type_imports_foo.ts similarity index 100% rename from cli/tests/ts_type_imports_foo.ts rename to cli/tests/testdata/ts_type_imports_foo.ts diff --git a/cli/tests/ts_type_only_import.d.ts b/cli/tests/testdata/ts_type_only_import.d.ts similarity index 100% rename from cli/tests/ts_type_only_import.d.ts rename to cli/tests/testdata/ts_type_only_import.d.ts diff --git a/cli/tests/ts_type_only_import.ts b/cli/tests/testdata/ts_type_only_import.ts similarity index 100% rename from cli/tests/ts_type_only_import.ts rename to cli/tests/testdata/ts_type_only_import.ts diff --git a/cli/tests/ts_type_only_import.ts.out b/cli/tests/testdata/ts_type_only_import.ts.out similarity index 100% rename from cli/tests/ts_type_only_import.ts.out rename to cli/tests/testdata/ts_type_only_import.ts.out diff --git a/cli/tests/ts_with_generic.ts b/cli/tests/testdata/ts_with_generic.ts similarity index 100% rename from cli/tests/ts_with_generic.ts rename to cli/tests/testdata/ts_with_generic.ts diff --git a/cli/tests/tsc/a.js b/cli/tests/testdata/tsc/a.js similarity index 100% rename from cli/tests/tsc/a.js rename to cli/tests/testdata/tsc/a.js diff --git a/cli/tests/tsc/d.ts b/cli/tests/testdata/tsc/d.ts similarity index 100% rename from cli/tests/tsc/d.ts rename to cli/tests/testdata/tsc/d.ts diff --git a/cli/tests/tsc/node_modules/b.js b/cli/tests/testdata/tsc/node_modules/b.js similarity index 100% rename from cli/tests/tsc/node_modules/b.js rename to cli/tests/testdata/tsc/node_modules/b.js diff --git a/cli/tests/tsc/node_modules/c.js b/cli/tests/testdata/tsc/node_modules/c.js similarity index 100% rename from cli/tests/tsc/node_modules/c.js rename to cli/tests/testdata/tsc/node_modules/c.js diff --git a/cli/tests/tsc/test.js b/cli/tests/testdata/tsc/test.js similarity index 100% rename from cli/tests/tsc/test.js rename to cli/tests/testdata/tsc/test.js diff --git a/cli/tests/tsc2/file_exportc.ts b/cli/tests/testdata/tsc2/file_exportc.ts similarity index 100% rename from cli/tests/tsc2/file_exportc.ts rename to cli/tests/testdata/tsc2/file_exportc.ts diff --git a/cli/tests/tsc2/file_libref.ts b/cli/tests/testdata/tsc2/file_libref.ts similarity index 100% rename from cli/tests/tsc2/file_libref.ts rename to cli/tests/testdata/tsc2/file_libref.ts diff --git a/cli/tests/tsc2/file_main.ts b/cli/tests/testdata/tsc2/file_main.ts similarity index 100% rename from cli/tests/tsc2/file_main.ts rename to cli/tests/testdata/tsc2/file_main.ts diff --git a/cli/tests/tsc2/file_reexports.ts b/cli/tests/testdata/tsc2/file_reexports.ts similarity index 100% rename from cli/tests/tsc2/file_reexports.ts rename to cli/tests/testdata/tsc2/file_reexports.ts diff --git a/cli/tests/tsc2/https_deno.land-x-a.ts b/cli/tests/testdata/tsc2/https_deno.land-x-a.ts similarity index 100% rename from cli/tests/tsc2/https_deno.land-x-a.ts rename to cli/tests/testdata/tsc2/https_deno.land-x-a.ts diff --git a/cli/tests/tsc2/https_deno.land-x-b.ts b/cli/tests/testdata/tsc2/https_deno.land-x-b.ts similarity index 100% rename from cli/tests/tsc2/https_deno.land-x-b.ts rename to cli/tests/testdata/tsc2/https_deno.land-x-b.ts diff --git a/cli/tests/tsc2/https_deno.land-x-c.d.ts b/cli/tests/testdata/tsc2/https_deno.land-x-c.d.ts similarity index 100% rename from cli/tests/tsc2/https_deno.land-x-c.d.ts rename to cli/tests/testdata/tsc2/https_deno.land-x-c.d.ts diff --git a/cli/tests/tsc2/https_deno.land-x-c.js b/cli/tests/testdata/tsc2/https_deno.land-x-c.js similarity index 100% rename from cli/tests/tsc2/https_deno.land-x-c.js rename to cli/tests/testdata/tsc2/https_deno.land-x-c.js diff --git a/cli/tests/tsc2/https_deno.land-x-mod.ts b/cli/tests/testdata/tsc2/https_deno.land-x-mod.ts similarity index 100% rename from cli/tests/tsc2/https_deno.land-x-mod.ts rename to cli/tests/testdata/tsc2/https_deno.land-x-mod.ts diff --git a/cli/tests/tsconfig.decorators.json b/cli/tests/testdata/tsconfig.decorators.json similarity index 100% rename from cli/tests/tsconfig.decorators.json rename to cli/tests/testdata/tsconfig.decorators.json diff --git a/cli/tests/tsx_imports.ts b/cli/tests/testdata/tsx_imports.ts similarity index 100% rename from cli/tests/tsx_imports.ts rename to cli/tests/testdata/tsx_imports.ts diff --git a/cli/tests/tsx_imports.ts.out b/cli/tests/testdata/tsx_imports.ts.out similarity index 100% rename from cli/tests/tsx_imports.ts.out rename to cli/tests/testdata/tsx_imports.ts.out diff --git a/cli/tests/type_definitions.ts b/cli/tests/testdata/type_definitions.ts similarity index 100% rename from cli/tests/type_definitions.ts rename to cli/tests/testdata/type_definitions.ts diff --git a/cli/tests/type_definitions.ts.out b/cli/tests/testdata/type_definitions.ts.out similarity index 100% rename from cli/tests/type_definitions.ts.out rename to cli/tests/testdata/type_definitions.ts.out diff --git a/cli/tests/type_definitions/bar.d.ts b/cli/tests/testdata/type_definitions/bar.d.ts similarity index 100% rename from cli/tests/type_definitions/bar.d.ts rename to cli/tests/testdata/type_definitions/bar.d.ts diff --git a/cli/tests/type_definitions/bar.js b/cli/tests/testdata/type_definitions/bar.js similarity index 100% rename from cli/tests/type_definitions/bar.js rename to cli/tests/testdata/type_definitions/bar.js diff --git a/cli/tests/type_definitions/fizz.d.ts b/cli/tests/testdata/type_definitions/fizz.d.ts similarity index 100% rename from cli/tests/type_definitions/fizz.d.ts rename to cli/tests/testdata/type_definitions/fizz.d.ts diff --git a/cli/tests/type_definitions/fizz.js b/cli/tests/testdata/type_definitions/fizz.js similarity index 100% rename from cli/tests/type_definitions/fizz.js rename to cli/tests/testdata/type_definitions/fizz.js diff --git a/cli/tests/type_definitions/foo.d.ts b/cli/tests/testdata/type_definitions/foo.d.ts similarity index 100% rename from cli/tests/type_definitions/foo.d.ts rename to cli/tests/testdata/type_definitions/foo.d.ts diff --git a/cli/tests/type_definitions/foo.js b/cli/tests/testdata/type_definitions/foo.js similarity index 100% rename from cli/tests/type_definitions/foo.js rename to cli/tests/testdata/type_definitions/foo.js diff --git a/cli/tests/type_definitions/qat.ts b/cli/tests/testdata/type_definitions/qat.ts similarity index 100% rename from cli/tests/type_definitions/qat.ts rename to cli/tests/testdata/type_definitions/qat.ts diff --git a/cli/tests/type_definitions_for_export.ts b/cli/tests/testdata/type_definitions_for_export.ts similarity index 100% rename from cli/tests/type_definitions_for_export.ts rename to cli/tests/testdata/type_definitions_for_export.ts diff --git a/cli/tests/type_definitions_for_export.ts.out b/cli/tests/testdata/type_definitions_for_export.ts.out similarity index 100% rename from cli/tests/type_definitions_for_export.ts.out rename to cli/tests/testdata/type_definitions_for_export.ts.out diff --git a/cli/tests/type_directives_01.ts b/cli/tests/testdata/type_directives_01.ts similarity index 100% rename from cli/tests/type_directives_01.ts rename to cli/tests/testdata/type_directives_01.ts diff --git a/cli/tests/type_directives_01.ts.out b/cli/tests/testdata/type_directives_01.ts.out similarity index 100% rename from cli/tests/type_directives_01.ts.out rename to cli/tests/testdata/type_directives_01.ts.out diff --git a/cli/tests/type_directives_02.ts b/cli/tests/testdata/type_directives_02.ts similarity index 100% rename from cli/tests/type_directives_02.ts rename to cli/tests/testdata/type_directives_02.ts diff --git a/cli/tests/testdata/type_directives_02.ts.out b/cli/tests/testdata/type_directives_02.ts.out new file mode 100644 index 0000000000..b064483b41 --- /dev/null +++ b/cli/tests/testdata/type_directives_02.ts.out @@ -0,0 +1,3 @@ +[WILDCARD] +DEBUG TS - host.getSourceFile("file:///[WILDCARD]/subdir/type_reference.d.ts", Latest) +[WILDCARD] \ No newline at end of file diff --git a/cli/tests/type_directives_js_main.js b/cli/tests/testdata/type_directives_js_main.js similarity index 100% rename from cli/tests/type_directives_js_main.js rename to cli/tests/testdata/type_directives_js_main.js diff --git a/cli/tests/type_directives_js_main.js.out b/cli/tests/testdata/type_directives_js_main.js.out similarity index 63% rename from cli/tests/type_directives_js_main.js.out rename to cli/tests/testdata/type_directives_js_main.js.out index 13decaa78f..7bca837f02 100644 --- a/cli/tests/type_directives_js_main.js.out +++ b/cli/tests/testdata/type_directives_js_main.js.out @@ -1,3 +1,3 @@ [WILDCARD] -DEBUG RS - [WILDCARD] - FileFetcher::fetch() - specifier: file:///[WILDCARD]cli/tests/subdir/type_reference.d.ts +DEBUG RS - [WILDCARD] - FileFetcher::fetch() - specifier: file:///[WILDCARD]/subdir/type_reference.d.ts [WILDCARD] diff --git a/cli/tests/type_directives_redirect.ts b/cli/tests/testdata/type_directives_redirect.ts similarity index 100% rename from cli/tests/type_directives_redirect.ts rename to cli/tests/testdata/type_directives_redirect.ts diff --git a/cli/tests/type_directives_redirect.ts.out b/cli/tests/testdata/type_directives_redirect.ts.out similarity index 100% rename from cli/tests/type_directives_redirect.ts.out rename to cli/tests/testdata/type_directives_redirect.ts.out diff --git a/cli/tests/type_headers_deno_types.ts b/cli/tests/testdata/type_headers_deno_types.ts similarity index 100% rename from cli/tests/type_headers_deno_types.ts rename to cli/tests/testdata/type_headers_deno_types.ts diff --git a/cli/tests/type_headers_deno_types.ts.out b/cli/tests/testdata/type_headers_deno_types.ts.out similarity index 100% rename from cli/tests/type_headers_deno_types.ts.out rename to cli/tests/testdata/type_headers_deno_types.ts.out diff --git a/cli/tests/types.out b/cli/tests/testdata/types.out similarity index 100% rename from cli/tests/types.out rename to cli/tests/testdata/types.out diff --git a/cli/tests/unbuffered_stderr.ts b/cli/tests/testdata/unbuffered_stderr.ts similarity index 100% rename from cli/tests/unbuffered_stderr.ts rename to cli/tests/testdata/unbuffered_stderr.ts diff --git a/cli/tests/unbuffered_stderr.ts.out b/cli/tests/testdata/unbuffered_stderr.ts.out similarity index 100% rename from cli/tests/unbuffered_stderr.ts.out rename to cli/tests/testdata/unbuffered_stderr.ts.out diff --git a/cli/tests/unbuffered_stdout.ts b/cli/tests/testdata/unbuffered_stdout.ts similarity index 100% rename from cli/tests/unbuffered_stdout.ts rename to cli/tests/testdata/unbuffered_stdout.ts diff --git a/cli/tests/unbuffered_stdout.ts.out b/cli/tests/testdata/unbuffered_stdout.ts.out similarity index 100% rename from cli/tests/unbuffered_stdout.ts.out rename to cli/tests/testdata/unbuffered_stdout.ts.out diff --git a/cli/tests/unstable.js b/cli/tests/testdata/unstable.js similarity index 100% rename from cli/tests/unstable.js rename to cli/tests/testdata/unstable.js diff --git a/cli/tests/unstable.ts b/cli/tests/testdata/unstable.ts similarity index 100% rename from cli/tests/unstable.ts rename to cli/tests/testdata/unstable.ts diff --git a/cli/tests/unstable_disabled.out b/cli/tests/testdata/unstable_disabled.out similarity index 83% rename from cli/tests/unstable_disabled.out rename to cli/tests/testdata/unstable_disabled.out index e951c5d0ab..28659645dc 100644 --- a/cli/tests/unstable_disabled.out +++ b/cli/tests/testdata/unstable_disabled.out @@ -2,4 +2,4 @@ error: TS2339 [ERROR]: Property 'loadavg' does not exist on type 'typeof Deno'. 'Deno.loadavg' is an unstable API. Did you forget to run with the '--unstable' flag? console.log(Deno.loadavg); ~~~~~~~ - at [WILDCARD]/cli/tests/unstable.ts:1:18 + at [WILDCARD]/unstable.ts:1:18 diff --git a/cli/tests/unstable_disabled_js.out b/cli/tests/testdata/unstable_disabled_js.out similarity index 100% rename from cli/tests/unstable_disabled_js.out rename to cli/tests/testdata/unstable_disabled_js.out diff --git a/cli/tests/unstable_enabled.out b/cli/tests/testdata/unstable_enabled.out similarity index 100% rename from cli/tests/unstable_enabled.out rename to cli/tests/testdata/unstable_enabled.out diff --git a/cli/tests/unstable_enabled_js.out b/cli/tests/testdata/unstable_enabled_js.out similarity index 100% rename from cli/tests/unstable_enabled_js.out rename to cli/tests/testdata/unstable_enabled_js.out diff --git a/cli/tests/unstable_worker.ts b/cli/tests/testdata/unstable_worker.ts similarity index 100% rename from cli/tests/unstable_worker.ts rename to cli/tests/testdata/unstable_worker.ts diff --git a/cli/tests/unstable_worker.ts.out b/cli/tests/testdata/unstable_worker.ts.out similarity index 100% rename from cli/tests/unstable_worker.ts.out rename to cli/tests/testdata/unstable_worker.ts.out diff --git a/cli/tests/unsupported_dynamic_import_scheme.out b/cli/tests/testdata/unsupported_dynamic_import_scheme.out similarity index 100% rename from cli/tests/unsupported_dynamic_import_scheme.out rename to cli/tests/testdata/unsupported_dynamic_import_scheme.out diff --git a/cli/tests/v8_flags.js b/cli/tests/testdata/v8_flags.js similarity index 100% rename from cli/tests/v8_flags.js rename to cli/tests/testdata/v8_flags.js diff --git a/cli/tests/v8_flags.js.out b/cli/tests/testdata/v8_flags.js.out similarity index 100% rename from cli/tests/v8_flags.js.out rename to cli/tests/testdata/v8_flags.js.out diff --git a/cli/tests/v8_flags_unrecognized.out b/cli/tests/testdata/v8_flags_unrecognized.out similarity index 100% rename from cli/tests/v8_flags_unrecognized.out rename to cli/tests/testdata/v8_flags_unrecognized.out diff --git a/cli/tests/v8_help.out b/cli/tests/testdata/v8_help.out similarity index 100% rename from cli/tests/v8_help.out rename to cli/tests/testdata/v8_help.out diff --git a/cli/tests/wasm.ts b/cli/tests/testdata/wasm.ts similarity index 100% rename from cli/tests/wasm.ts rename to cli/tests/testdata/wasm.ts diff --git a/cli/tests/wasm.ts.out b/cli/tests/testdata/wasm.ts.out similarity index 100% rename from cli/tests/wasm.ts.out rename to cli/tests/testdata/wasm.ts.out diff --git a/cli/tests/wasm_async.js b/cli/tests/testdata/wasm_async.js similarity index 100% rename from cli/tests/wasm_async.js rename to cli/tests/testdata/wasm_async.js diff --git a/cli/tests/wasm_async.out b/cli/tests/testdata/wasm_async.out similarity index 100% rename from cli/tests/wasm_async.out rename to cli/tests/testdata/wasm_async.out diff --git a/cli/tests/wasm_shared.out b/cli/tests/testdata/wasm_shared.out similarity index 100% rename from cli/tests/wasm_shared.out rename to cli/tests/testdata/wasm_shared.out diff --git a/cli/tests/wasm_shared.ts b/cli/tests/testdata/wasm_shared.ts similarity index 100% rename from cli/tests/wasm_shared.ts rename to cli/tests/testdata/wasm_shared.ts diff --git a/cli/tests/wasm_unreachable.js b/cli/tests/testdata/wasm_unreachable.js similarity index 100% rename from cli/tests/wasm_unreachable.js rename to cli/tests/testdata/wasm_unreachable.js diff --git a/cli/tests/wasm_unreachable.out b/cli/tests/testdata/wasm_unreachable.out similarity index 59% rename from cli/tests/wasm_unreachable.out rename to cli/tests/testdata/wasm_unreachable.out index 743e7f6cd6..28fe00de6c 100644 --- a/cli/tests/wasm_unreachable.out +++ b/cli/tests/testdata/wasm_unreachable.out @@ -1,3 +1,3 @@ error: Uncaught RuntimeError: unreachable at (wasm://wasm/[WILDCARD]) - at [WILDCARD]/cli/tests/wasm_unreachable.js:[WILDCARD] + at [WILDCARD]/wasm_unreachable.js:[WILDCARD] diff --git a/cli/tests/weakref.ts b/cli/tests/testdata/weakref.ts similarity index 100% rename from cli/tests/weakref.ts rename to cli/tests/testdata/weakref.ts diff --git a/cli/tests/weakref.ts.out b/cli/tests/testdata/weakref.ts.out similarity index 100% rename from cli/tests/weakref.ts.out rename to cli/tests/testdata/weakref.ts.out diff --git a/cli/tests/webgpu_computepass_shader.wgsl b/cli/tests/testdata/webgpu_computepass_shader.wgsl similarity index 100% rename from cli/tests/webgpu_computepass_shader.wgsl rename to cli/tests/testdata/webgpu_computepass_shader.wgsl diff --git a/cli/tests/webgpu_hellotriangle.out b/cli/tests/testdata/webgpu_hellotriangle.out similarity index 100% rename from cli/tests/webgpu_hellotriangle.out rename to cli/tests/testdata/webgpu_hellotriangle.out diff --git a/cli/tests/webgpu_hellotriangle_shader.wgsl b/cli/tests/testdata/webgpu_hellotriangle_shader.wgsl similarity index 100% rename from cli/tests/webgpu_hellotriangle_shader.wgsl rename to cli/tests/testdata/webgpu_hellotriangle_shader.wgsl diff --git a/cli/tests/websocket_test.ts b/cli/tests/testdata/websocket_test.ts similarity index 98% rename from cli/tests/websocket_test.ts rename to cli/tests/testdata/websocket_test.ts index 7d62679fea..5229ad8757 100644 --- a/cli/tests/websocket_test.ts +++ b/cli/tests/testdata/websocket_test.ts @@ -4,8 +4,8 @@ import { assertEquals, assertThrows, fail, -} from "../../test_util/std/testing/asserts.ts"; -import { deferred } from "../../test_util/std/async/deferred.ts"; +} from "../../../test_util/std/testing/asserts.ts"; +import { deferred } from "../../../test_util/std/async/deferred.ts"; Deno.test("invalid scheme", () => { assertThrows(() => new WebSocket("foo://localhost:4242")); diff --git a/cli/tests/websocketstream_test.ts b/cli/tests/testdata/websocketstream_test.ts similarity index 97% rename from cli/tests/websocketstream_test.ts rename to cli/tests/testdata/websocketstream_test.ts index 5b4d19f6e8..aa809ba16d 100644 --- a/cli/tests/websocketstream_test.ts +++ b/cli/tests/testdata/websocketstream_test.ts @@ -4,7 +4,7 @@ import { assertEquals, assertThrows, assertThrowsAsync, -} from "../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/testing/asserts.ts"; Deno.test("fragment", () => { assertThrows(() => new WebSocketStream("ws://localhost:4242/#")); diff --git a/cli/tests/worker_close_race.js b/cli/tests/testdata/worker_close_race.js similarity index 100% rename from cli/tests/worker_close_race.js rename to cli/tests/testdata/worker_close_race.js diff --git a/cli/tests/worker_close_race.js.out b/cli/tests/testdata/worker_close_race.js.out similarity index 100% rename from cli/tests/worker_close_race.js.out rename to cli/tests/testdata/worker_close_race.js.out diff --git a/cli/tests/worker_event_handler_test.js b/cli/tests/testdata/worker_event_handler_test.js similarity index 100% rename from cli/tests/worker_event_handler_test.js rename to cli/tests/testdata/worker_event_handler_test.js diff --git a/cli/tests/worker_event_handler_test.js.out b/cli/tests/testdata/worker_event_handler_test.js.out similarity index 100% rename from cli/tests/worker_event_handler_test.js.out rename to cli/tests/testdata/worker_event_handler_test.js.out diff --git a/cli/tests/workers/bench_large_message.ts b/cli/tests/testdata/workers/bench_large_message.ts similarity index 100% rename from cli/tests/workers/bench_large_message.ts rename to cli/tests/testdata/workers/bench_large_message.ts diff --git a/cli/tests/workers/bench_round_robin.ts b/cli/tests/testdata/workers/bench_round_robin.ts similarity index 95% rename from cli/tests/workers/bench_round_robin.ts rename to cli/tests/testdata/workers/bench_round_robin.ts index a39f7ec6f2..13afe286ba 100644 --- a/cli/tests/workers/bench_round_robin.ts +++ b/cli/tests/testdata/workers/bench_round_robin.ts @@ -5,7 +5,10 @@ const data = "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello World\n"; const workerCount = 4; const cmdsPerWorker = 400; -import { Deferred, deferred } from "../../../test_util/std/async/deferred.ts"; +import { + Deferred, + deferred, +} from "../../../../test_util/std/async/deferred.ts"; function handleAsyncMsgFromWorker( promiseTable: Map>, diff --git a/cli/tests/workers/bench_startup.ts b/cli/tests/testdata/workers/bench_startup.ts similarity index 100% rename from cli/tests/workers/bench_startup.ts rename to cli/tests/testdata/workers/bench_startup.ts diff --git a/cli/tests/workers/bench_worker.ts b/cli/tests/testdata/workers/bench_worker.ts similarity index 100% rename from cli/tests/workers/bench_worker.ts rename to cli/tests/testdata/workers/bench_worker.ts diff --git a/cli/tests/workers/broadcast_channel.ts b/cli/tests/testdata/workers/broadcast_channel.ts similarity index 100% rename from cli/tests/workers/broadcast_channel.ts rename to cli/tests/testdata/workers/broadcast_channel.ts diff --git a/cli/tests/workers/busy_worker.js b/cli/tests/testdata/workers/busy_worker.js similarity index 100% rename from cli/tests/workers/busy_worker.js rename to cli/tests/testdata/workers/busy_worker.js diff --git a/cli/tests/workers/close_race_worker.js b/cli/tests/testdata/workers/close_race_worker.js similarity index 100% rename from cli/tests/workers/close_race_worker.js rename to cli/tests/testdata/workers/close_race_worker.js diff --git a/cli/tests/workers/deno_worker.ts b/cli/tests/testdata/workers/deno_worker.ts similarity index 100% rename from cli/tests/workers/deno_worker.ts rename to cli/tests/testdata/workers/deno_worker.ts diff --git a/cli/tests/workers/dynamic_remote.ts b/cli/tests/testdata/workers/dynamic_remote.ts similarity index 100% rename from cli/tests/workers/dynamic_remote.ts rename to cli/tests/testdata/workers/dynamic_remote.ts diff --git a/cli/tests/workers/error.ts b/cli/tests/testdata/workers/error.ts similarity index 100% rename from cli/tests/workers/error.ts rename to cli/tests/testdata/workers/error.ts diff --git a/cli/tests/workers/event_worker.js b/cli/tests/testdata/workers/event_worker.js similarity index 100% rename from cli/tests/workers/event_worker.js rename to cli/tests/testdata/workers/event_worker.js diff --git a/cli/tests/workers/event_worker_scope.js b/cli/tests/testdata/workers/event_worker_scope.js similarity index 100% rename from cli/tests/workers/event_worker_scope.js rename to cli/tests/testdata/workers/event_worker_scope.js diff --git a/cli/tests/workers/fetching_worker.js b/cli/tests/testdata/workers/fetching_worker.js similarity index 53% rename from cli/tests/workers/fetching_worker.js rename to cli/tests/testdata/workers/fetching_worker.js index e1bcdf9113..77ff471d72 100644 --- a/cli/tests/workers/fetching_worker.js +++ b/cli/tests/testdata/workers/fetching_worker.js @@ -1,5 +1,5 @@ const r = await fetch( - "http://localhost:4545/cli/tests/workers/fetching_worker.js", + "http://localhost:4545/workers/fetching_worker.js", ); await r.text(); postMessage("Done!"); diff --git a/cli/tests/workers/http_worker.js b/cli/tests/testdata/workers/http_worker.js similarity index 100% rename from cli/tests/workers/http_worker.js rename to cli/tests/testdata/workers/http_worker.js diff --git a/cli/tests/workers/immediately_close_worker.js b/cli/tests/testdata/workers/immediately_close_worker.js similarity index 100% rename from cli/tests/workers/immediately_close_worker.js rename to cli/tests/testdata/workers/immediately_close_worker.js diff --git a/cli/tests/workers/message_port.ts b/cli/tests/testdata/workers/message_port.ts similarity index 100% rename from cli/tests/workers/message_port.ts rename to cli/tests/testdata/workers/message_port.ts diff --git a/cli/tests/workers/nested_worker.js b/cli/tests/testdata/workers/nested_worker.js similarity index 100% rename from cli/tests/workers/nested_worker.js rename to cli/tests/testdata/workers/nested_worker.js diff --git a/cli/tests/workers/no_permissions_worker.js b/cli/tests/testdata/workers/no_permissions_worker.js similarity index 100% rename from cli/tests/workers/no_permissions_worker.js rename to cli/tests/testdata/workers/no_permissions_worker.js diff --git a/cli/tests/workers/non_deno_worker.js b/cli/tests/testdata/workers/non_deno_worker.js similarity index 100% rename from cli/tests/workers/non_deno_worker.js rename to cli/tests/testdata/workers/non_deno_worker.js diff --git a/cli/tests/workers/nonexistent_worker.out b/cli/tests/testdata/workers/nonexistent_worker.out similarity index 77% rename from cli/tests/workers/nonexistent_worker.out rename to cli/tests/testdata/workers/nonexistent_worker.out index 04b9f801da..1651321bcf 100644 --- a/cli/tests/workers/nonexistent_worker.out +++ b/cli/tests/testdata/workers/nonexistent_worker.out @@ -1,3 +1,3 @@ -[WILDCARD]error: Uncaught (in worker "") Cannot resolve module "file:///[WILDCARD]cli/tests/workers/doesnt_exist.js". +[WILDCARD]error: Uncaught (in worker "") Cannot resolve module "file:///[WILDCARD]/workers/doesnt_exist.js". error: Uncaught (in promise) Error: Unhandled error event reached main worker. at Worker.#pollControl ([WILDCARD]) diff --git a/cli/tests/workers/nonexistent_worker.ts b/cli/tests/testdata/workers/nonexistent_worker.ts similarity index 100% rename from cli/tests/workers/nonexistent_worker.ts rename to cli/tests/testdata/workers/nonexistent_worker.ts diff --git a/cli/tests/workers/parent_read_check_granular_worker.js b/cli/tests/testdata/workers/parent_read_check_granular_worker.js similarity index 100% rename from cli/tests/workers/parent_read_check_granular_worker.js rename to cli/tests/testdata/workers/parent_read_check_granular_worker.js diff --git a/cli/tests/workers/parent_read_check_worker.js b/cli/tests/testdata/workers/parent_read_check_worker.js similarity index 100% rename from cli/tests/workers/parent_read_check_worker.js rename to cli/tests/testdata/workers/parent_read_check_worker.js diff --git a/cli/tests/workers/permissions_blob_local.ts b/cli/tests/testdata/workers/permissions_blob_local.ts similarity index 100% rename from cli/tests/workers/permissions_blob_local.ts rename to cli/tests/testdata/workers/permissions_blob_local.ts diff --git a/cli/tests/workers/permissions_blob_local.ts.out b/cli/tests/testdata/workers/permissions_blob_local.ts.out similarity index 100% rename from cli/tests/workers/permissions_blob_local.ts.out rename to cli/tests/testdata/workers/permissions_blob_local.ts.out diff --git a/cli/tests/workers/permissions_blob_remote.ts b/cli/tests/testdata/workers/permissions_blob_remote.ts similarity index 100% rename from cli/tests/workers/permissions_blob_remote.ts rename to cli/tests/testdata/workers/permissions_blob_remote.ts diff --git a/cli/tests/workers/permissions_blob_remote.ts.out b/cli/tests/testdata/workers/permissions_blob_remote.ts.out similarity index 100% rename from cli/tests/workers/permissions_blob_remote.ts.out rename to cli/tests/testdata/workers/permissions_blob_remote.ts.out diff --git a/cli/tests/workers/permissions_data_local.ts b/cli/tests/testdata/workers/permissions_data_local.ts similarity index 100% rename from cli/tests/workers/permissions_data_local.ts rename to cli/tests/testdata/workers/permissions_data_local.ts diff --git a/cli/tests/workers/permissions_data_local.ts.out b/cli/tests/testdata/workers/permissions_data_local.ts.out similarity index 100% rename from cli/tests/workers/permissions_data_local.ts.out rename to cli/tests/testdata/workers/permissions_data_local.ts.out diff --git a/cli/tests/workers/permissions_data_remote.ts b/cli/tests/testdata/workers/permissions_data_remote.ts similarity index 100% rename from cli/tests/workers/permissions_data_remote.ts rename to cli/tests/testdata/workers/permissions_data_remote.ts diff --git a/cli/tests/workers/permissions_data_remote.ts.out b/cli/tests/testdata/workers/permissions_data_remote.ts.out similarity index 100% rename from cli/tests/workers/permissions_data_remote.ts.out rename to cli/tests/testdata/workers/permissions_data_remote.ts.out diff --git a/cli/tests/workers/permissions_dynamic_remote.ts b/cli/tests/testdata/workers/permissions_dynamic_remote.ts similarity index 64% rename from cli/tests/workers/permissions_dynamic_remote.ts rename to cli/tests/testdata/workers/permissions_dynamic_remote.ts index a5d293e168..54a361bc00 100644 --- a/cli/tests/workers/permissions_dynamic_remote.ts +++ b/cli/tests/testdata/workers/permissions_dynamic_remote.ts @@ -1,5 +1,5 @@ new Worker( - "http://localhost:4545/cli/tests/workers/dynamic_remote.ts", + "http://localhost:4545/workers/dynamic_remote.ts", { type: "module", deno: { diff --git a/cli/tests/workers/permissions_dynamic_remote.ts.out b/cli/tests/testdata/workers/permissions_dynamic_remote.ts.out similarity index 80% rename from cli/tests/workers/permissions_dynamic_remote.ts.out rename to cli/tests/testdata/workers/permissions_dynamic_remote.ts.out index e68c96df1a..3c4523ce0a 100644 --- a/cli/tests/workers/permissions_dynamic_remote.ts.out +++ b/cli/tests/testdata/workers/permissions_dynamic_remote.ts.out @@ -1,6 +1,6 @@ error: Uncaught (in worker "") (in promise) TypeError: Requires net access to "example.com", run again with the --allow-net flag await import("https://example.com/some/file.ts"); ^ - at async http://localhost:4545/cli/tests/workers/dynamic_remote.ts:2:1 + at async http://localhost:4545/workers/dynamic_remote.ts:2:1 [WILDCARD]error: Uncaught (in promise) Error: Unhandled error event reached main worker. at Worker.#pollControl ([WILDCARD]) diff --git a/cli/tests/testdata/workers/permissions_remote_remote.ts b/cli/tests/testdata/workers/permissions_remote_remote.ts new file mode 100644 index 0000000000..4df2a8a5d7 --- /dev/null +++ b/cli/tests/testdata/workers/permissions_remote_remote.ts @@ -0,0 +1,3 @@ +new Worker("http://localhost:4545/workers/static_remote.ts", { + type: "module", +}); diff --git a/cli/tests/workers/permissions_remote_remote.ts.out b/cli/tests/testdata/workers/permissions_remote_remote.ts.out similarity index 76% rename from cli/tests/workers/permissions_remote_remote.ts.out rename to cli/tests/testdata/workers/permissions_remote_remote.ts.out index 5656b75a1c..94a92c72d6 100644 --- a/cli/tests/workers/permissions_remote_remote.ts.out +++ b/cli/tests/testdata/workers/permissions_remote_remote.ts.out @@ -1,4 +1,4 @@ error: Uncaught (in worker "") Requires net access to "example.com", run again with the --allow-net flag - at http://localhost:4545/cli/tests/workers/static_remote.ts:2:0 + at http://localhost:4545/workers/static_remote.ts:2:0 error: Uncaught (in promise) Error: Unhandled error event reached main worker. at Worker.#pollControl ([WILDCARD]) diff --git a/cli/tests/workers/post_undefined.ts b/cli/tests/testdata/workers/post_undefined.ts similarity index 100% rename from cli/tests/workers/post_undefined.ts rename to cli/tests/testdata/workers/post_undefined.ts diff --git a/cli/tests/workers/racy_worker.js b/cli/tests/testdata/workers/racy_worker.js similarity index 100% rename from cli/tests/workers/racy_worker.js rename to cli/tests/testdata/workers/racy_worker.js diff --git a/cli/tests/workers/read_check_granular_worker.js b/cli/tests/testdata/workers/read_check_granular_worker.js similarity index 100% rename from cli/tests/workers/read_check_granular_worker.js rename to cli/tests/testdata/workers/read_check_granular_worker.js diff --git a/cli/tests/workers/read_check_worker.js b/cli/tests/testdata/workers/read_check_worker.js similarity index 100% rename from cli/tests/workers/read_check_worker.js rename to cli/tests/testdata/workers/read_check_worker.js diff --git a/cli/tests/workers/shared_array_buffer.ts b/cli/tests/testdata/workers/shared_array_buffer.ts similarity index 100% rename from cli/tests/workers/shared_array_buffer.ts rename to cli/tests/testdata/workers/shared_array_buffer.ts diff --git a/cli/tests/workers/sibling_worker.js b/cli/tests/testdata/workers/sibling_worker.js similarity index 100% rename from cli/tests/workers/sibling_worker.js rename to cli/tests/testdata/workers/sibling_worker.js diff --git a/cli/tests/workers/static_remote.ts b/cli/tests/testdata/workers/static_remote.ts similarity index 100% rename from cli/tests/workers/static_remote.ts rename to cli/tests/testdata/workers/static_remote.ts diff --git a/cli/tests/workers/test.ts b/cli/tests/testdata/workers/test.ts similarity index 98% rename from cli/tests/workers/test.ts rename to cli/tests/testdata/workers/test.ts index 44cbca0fec..9d3855fe11 100644 --- a/cli/tests/workers/test.ts +++ b/cli/tests/testdata/workers/test.ts @@ -6,9 +6,9 @@ import { assert, assertEquals, assertThrows, -} from "../../../test_util/std/testing/asserts.ts"; -import { deferred } from "../../../test_util/std/async/deferred.ts"; -import { fromFileUrl } from "../../../test_util/std/path/mod.ts"; +} from "../../../../test_util/std/testing/asserts.ts"; +import { deferred } from "../../../../test_util/std/async/deferred.ts"; +import { fromFileUrl } from "../../../../test_util/std/path/mod.ts"; Deno.test({ name: "worker terminate", @@ -668,7 +668,7 @@ Deno.test({ Deno.test({ name: "worker with relative specifier", fn: async function () { - assertEquals(location.href, "http://127.0.0.1:4545/cli/tests/"); + assertEquals(location.href, "http://127.0.0.1:4545/"); const promise = deferred(); const w = new Worker( "./workers/test_worker.ts", @@ -773,7 +773,7 @@ Deno.test({ Deno.test({ name: "worker with relative specifier", fn: async function () { - assertEquals(location.href, "http://127.0.0.1:4545/cli/tests/"); + assertEquals(location.href, "http://127.0.0.1:4545/"); const promise = deferred(); const w = new Worker( "./workers/test_worker.ts", diff --git a/cli/tests/workers/test.ts.out b/cli/tests/testdata/workers/test.ts.out similarity index 100% rename from cli/tests/workers/test.ts.out rename to cli/tests/testdata/workers/test.ts.out diff --git a/cli/tests/workers/test_worker.js b/cli/tests/testdata/workers/test_worker.js similarity index 100% rename from cli/tests/workers/test_worker.js rename to cli/tests/testdata/workers/test_worker.js diff --git a/cli/tests/workers/test_worker.ts b/cli/tests/testdata/workers/test_worker.ts similarity index 100% rename from cli/tests/workers/test_worker.ts rename to cli/tests/testdata/workers/test_worker.ts diff --git a/cli/tests/workers/throwing_worker.js b/cli/tests/testdata/workers/throwing_worker.js similarity index 100% rename from cli/tests/workers/throwing_worker.js rename to cli/tests/testdata/workers/throwing_worker.js diff --git a/cli/tests/workers/worker_crypto.js b/cli/tests/testdata/workers/worker_crypto.js similarity index 100% rename from cli/tests/workers/worker_crypto.js rename to cli/tests/testdata/workers/worker_crypto.js diff --git a/cli/tests/workers/worker_error.ts b/cli/tests/testdata/workers/worker_error.ts similarity index 100% rename from cli/tests/workers/worker_error.ts rename to cli/tests/testdata/workers/worker_error.ts diff --git a/cli/tests/workers/worker_error.ts.out b/cli/tests/testdata/workers/worker_error.ts.out similarity index 100% rename from cli/tests/workers/worker_error.ts.out rename to cli/tests/testdata/workers/worker_error.ts.out diff --git a/cli/tests/workers/worker_event_handlers.js b/cli/tests/testdata/workers/worker_event_handlers.js similarity index 100% rename from cli/tests/workers/worker_event_handlers.js rename to cli/tests/testdata/workers/worker_event_handlers.js diff --git a/cli/tests/workers/worker_globals.ts b/cli/tests/testdata/workers/worker_globals.ts similarity index 100% rename from cli/tests/workers/worker_globals.ts rename to cli/tests/testdata/workers/worker_globals.ts diff --git a/cli/tests/workers/worker_large_message.js b/cli/tests/testdata/workers/worker_large_message.js similarity index 100% rename from cli/tests/workers/worker_large_message.js rename to cli/tests/testdata/workers/worker_large_message.js diff --git a/cli/tests/workers/worker_location.ts b/cli/tests/testdata/workers/worker_location.ts similarity index 100% rename from cli/tests/workers/worker_location.ts rename to cli/tests/testdata/workers/worker_location.ts diff --git a/cli/tests/workers/worker_nested_error.ts b/cli/tests/testdata/workers/worker_nested_error.ts similarity index 100% rename from cli/tests/workers/worker_nested_error.ts rename to cli/tests/testdata/workers/worker_nested_error.ts diff --git a/cli/tests/workers/worker_nested_error.ts.out b/cli/tests/testdata/workers/worker_nested_error.ts.out similarity index 100% rename from cli/tests/workers/worker_nested_error.ts.out rename to cli/tests/testdata/workers/worker_nested_error.ts.out diff --git a/cli/tests/workers/worker_structured_cloning.ts b/cli/tests/testdata/workers/worker_structured_cloning.ts similarity index 100% rename from cli/tests/workers/worker_structured_cloning.ts rename to cli/tests/testdata/workers/worker_structured_cloning.ts diff --git a/cli/tests/workers/worker_types.ts b/cli/tests/testdata/workers/worker_types.ts similarity index 100% rename from cli/tests/workers/worker_types.ts rename to cli/tests/testdata/workers/worker_types.ts diff --git a/cli/tests/workers/worker_unstable.ts b/cli/tests/testdata/workers/worker_unstable.ts similarity index 100% rename from cli/tests/workers/worker_unstable.ts rename to cli/tests/testdata/workers/worker_unstable.ts diff --git a/cli/tests/workers/worker_with_top_level_await.ts b/cli/tests/testdata/workers/worker_with_top_level_await.ts similarity index 100% rename from cli/tests/workers/worker_with_top_level_await.ts rename to cli/tests/testdata/workers/worker_with_top_level_await.ts diff --git a/cli/tests/x_deno_warning.js b/cli/tests/testdata/x_deno_warning.js similarity index 100% rename from cli/tests/x_deno_warning.js rename to cli/tests/testdata/x_deno_warning.js diff --git a/cli/tests/ts_import_from_js.deps.js b/cli/tests/ts_import_from_js.deps.js deleted file mode 100644 index bfea5ac79b..0000000000 --- a/cli/tests/ts_import_from_js.deps.js +++ /dev/null @@ -1,2 +0,0 @@ -import "./005_more_imports.ts"; -export { printHello } from "http://localhost:4545/cli/tests/subdir/mod2.ts"; diff --git a/cli/tests/type_directives_02.ts.out b/cli/tests/type_directives_02.ts.out deleted file mode 100644 index 7949dfab54..0000000000 --- a/cli/tests/type_directives_02.ts.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD] -DEBUG TS - host.getSourceFile("file:///[WILDCARD]cli/tests/subdir/type_reference.d.ts", Latest) -[WILDCARD] \ No newline at end of file diff --git a/cli/tests/unit/README.md b/cli/tests/unit/README.md index 114bbc0433..e1197fe9b2 100644 --- a/cli/tests/unit/README.md +++ b/cli/tests/unit/README.md @@ -26,7 +26,7 @@ unitTest( ## Running tests -There are three ways to run `unit_test_runner.ts`: +There are two ways to run `unit_test_runner.ts`: ```sh # Run all tests. diff --git a/cli/tests/unit/body_test.ts b/cli/tests/unit/body_test.ts index 78da2a9d40..fe0bbe25c0 100644 --- a/cli/tests/unit/body_test.ts +++ b/cli/tests/unit/body_test.ts @@ -57,7 +57,7 @@ unitTest( { perms: { net: true } }, async function bodyURLEncodedFormData() { const response = await fetch( - "http://localhost:4545/cli/tests/subdir/form_urlencoded.txt", + "http://localhost:4545/subdir/form_urlencoded.txt", ); assert(response.body instanceof ReadableStream); diff --git a/cli/tests/unit/broadcast_channel_test.ts b/cli/tests/unit/broadcast_channel_test.ts index cfa62c8561..33a8aaba04 100644 --- a/cli/tests/unit/broadcast_channel_test.ts +++ b/cli/tests/unit/broadcast_channel_test.ts @@ -6,7 +6,10 @@ Deno.test("broadcastchannel worker", async () => { const intercom = new BroadcastChannel("intercom"); let count = 0; - const url = new URL("../workers/broadcast_channel.ts", import.meta.url); + const url = new URL( + "../testdata/workers/broadcast_channel.ts", + import.meta.url, + ); const worker = new Worker(url.href, { type: "module", name: "worker" }); worker.onmessage = () => intercom.postMessage(++count); diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts index 24825c6537..6e2b1a5d6b 100644 --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -94,40 +94,40 @@ unitTest( ); unitTest({ perms: { net: true } }, async function fetchJsonSuccess() { - const response = await fetch("http://localhost:4545/cli/tests/fixture.json"); + const response = await fetch("http://localhost:4545/fixture.json"); const json = await response.json(); assertEquals(json.name, "deno"); }); unitTest(async function fetchPerm() { await assertThrowsAsync(async () => { - await fetch("http://localhost:4545/cli/tests/fixture.json"); + await fetch("http://localhost:4545/fixture.json"); }, Deno.errors.PermissionDenied); }); unitTest({ perms: { net: true } }, async function fetchUrl() { - const response = await fetch("http://localhost:4545/cli/tests/fixture.json"); - assertEquals(response.url, "http://localhost:4545/cli/tests/fixture.json"); + const response = await fetch("http://localhost:4545/fixture.json"); + assertEquals(response.url, "http://localhost:4545/fixture.json"); const _json = await response.json(); }); unitTest({ perms: { net: true } }, async function fetchURL() { const response = await fetch( - new URL("http://localhost:4545/cli/tests/fixture.json"), + new URL("http://localhost:4545/fixture.json"), ); - assertEquals(response.url, "http://localhost:4545/cli/tests/fixture.json"); + assertEquals(response.url, "http://localhost:4545/fixture.json"); const _json = await response.json(); }); unitTest({ perms: { net: true } }, async function fetchHeaders() { - const response = await fetch("http://localhost:4545/cli/tests/fixture.json"); + const response = await fetch("http://localhost:4545/fixture.json"); const headers = response.headers; assertEquals(headers.get("Content-Type"), "application/json"); const _json = await response.json(); }); unitTest({ perms: { net: true } }, async function fetchBlob() { - const response = await fetch("http://localhost:4545/cli/tests/fixture.json"); + const response = await fetch("http://localhost:4545/fixture.json"); const headers = response.headers; const blob = await response.blob(); assertEquals(blob.type, headers.get("Content-Type")); @@ -138,7 +138,7 @@ unitTest( { perms: { net: true } }, async function fetchBodyUsedReader() { const response = await fetch( - "http://localhost:4545/cli/tests/fixture.json", + "http://localhost:4545/fixture.json", ); assert(response.body !== null); @@ -156,7 +156,7 @@ unitTest( { perms: { net: true } }, async function fetchBodyUsedCancelStream() { const response = await fetch( - "http://localhost:4545/cli/tests/fixture.json", + "http://localhost:4545/fixture.json", ); assert(response.body !== null); @@ -168,7 +168,7 @@ unitTest( ); unitTest({ perms: { net: true } }, async function fetchAsyncIterator() { - const response = await fetch("http://localhost:4545/cli/tests/fixture.json"); + const response = await fetch("http://localhost:4545/fixture.json"); const headers = response.headers; assert(response.body !== null); @@ -182,7 +182,7 @@ unitTest({ perms: { net: true } }, async function fetchAsyncIterator() { }); unitTest({ perms: { net: true } }, async function fetchBodyReader() { - const response = await fetch("http://localhost:4545/cli/tests/fixture.json"); + const response = await fetch("http://localhost:4545/fixture.json"); const headers = response.headers; assert(response.body !== null); const reader = response.body.getReader(); @@ -221,7 +221,7 @@ unitTest( ); unitTest({ perms: { net: true } }, async function responseClone() { - const response = await fetch("http://localhost:4545/cli/tests/fixture.json"); + const response = await fetch("http://localhost:4545/fixture.json"); const response1 = response.clone(); assert(response !== response1); assertEquals(response.status, response1.status); @@ -272,7 +272,7 @@ unitTest( { perms: { net: true } }, async function fetchURLEncodedFormDataSuccess() { const response = await fetch( - "http://localhost:4545/cli/tests/subdir/form_urlencoded.txt", + "http://localhost:4545/subdir/form_urlencoded.txt", ); const formData = await response.formData(); assert(formData.has("field_1")); @@ -360,12 +360,12 @@ unitTest( perms: { net: true }, }, async function fetchWithRedirection() { - const response = await fetch("http://localhost:4546/README.md"); + const response = await fetch("http://localhost:4546/hello.txt"); assertEquals(response.status, 200); assertEquals(response.statusText, "OK"); - assertEquals(response.url, "http://localhost:4545/README.md"); + assertEquals(response.url, "http://localhost:4545/hello.txt"); const body = await response.text(); - assert(body.includes("Deno")); + assert(body.includes("Hello world!")); }, ); @@ -375,7 +375,7 @@ unitTest( }, async function fetchWithRelativeRedirection() { const response = await fetch( - "http://localhost:4545/cli/tests/001_hello.js", + "http://localhost:4545/001_hello.js", ); assertEquals(response.status, 200); assertEquals(response.statusText, "OK"); @@ -411,7 +411,7 @@ unitTest( }, async function fetchWithInfRedirection() { await assertThrowsAsync( - () => fetch("http://localhost:4549/cli/tests"), + () => fetch("http://localhost:4549"), TypeError, "redirect", ); @@ -450,7 +450,7 @@ unitTest( { perms: { net: true } }, async function fetchSeparateInit() { // related to: https://github.com/denoland/deno/issues/10396 - const req = new Request("http://localhost:4545/cli/tests/001_hello.js"); + const req = new Request("http://localhost:4545/001_hello.js"); const init = { method: "GET", }; @@ -815,7 +815,7 @@ unitTest(async function responseWithoutBody() { }); unitTest({ perms: { net: true } }, async function fetchBodyReadTwice() { - const response = await fetch("http://localhost:4545/cli/tests/fixture.json"); + const response = await fetch("http://localhost:4545/fixture.json"); // Read body const _json = await response.json(); @@ -839,7 +839,7 @@ unitTest( { perms: { net: true } }, async function fetchBodyReaderAfterRead() { const response = await fetch( - "http://localhost:4545/cli/tests/fixture.json", + "http://localhost:4545/fixture.json", ); assert(response.body !== null); const reader = await response.body.getReader(); @@ -919,7 +919,7 @@ unitTest( unitTest( { perms: { net: true } }, async function fetchResourceCloseAfterStreamCancel() { - const res = await fetch("http://localhost:4545/cli/tests/fixture.json"); + const res = await fetch("http://localhost:4545/fixture.json"); assert(res.body !== null); // After ReadableStream.cancel is called, resource handle must be closed @@ -1047,7 +1047,7 @@ MNf4EgWfK+tZMnuqfpfO9740KzfcVoMNo4QJD4yn5YxroUOO/Azi }, ); const response = await fetch( - "https://localhost:5545/cli/tests/fixture.json", + "https://localhost:5545/fixture.json", { client }, ); const json = await response.json(); diff --git a/cli/tests/unit/files_test.ts b/cli/tests/unit/files_test.ts index a409434c1d..fed7c3252a 100644 --- a/cli/tests/unit/files_test.ts +++ b/cli/tests/unit/files_test.ts @@ -17,7 +17,7 @@ unitTest(function filesStdioFileDescriptors() { }); unitTest({ perms: { read: true } }, async function filesCopyToStdout() { - const filename = "cli/tests/fixture.json"; + const filename = "cli/tests/testdata/fixture.json"; const file = await Deno.open(filename); assert(file.rid > 2); const bytesWritten = await copy(file, Deno.stdout); @@ -27,7 +27,7 @@ unitTest({ perms: { read: true } }, async function filesCopyToStdout() { }); unitTest({ perms: { read: true } }, async function filesIter() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = await Deno.open(filename); let totalSize = 0; @@ -42,7 +42,7 @@ unitTest({ perms: { read: true } }, async function filesIter() { unitTest( { perms: { read: true } }, async function filesIterCustomBufSize() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = await Deno.open(filename); let totalSize = 0; @@ -59,7 +59,7 @@ unitTest( ); unitTest({ perms: { read: true } }, function filesIterSync() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = Deno.openSync(filename); let totalSize = 0; @@ -74,7 +74,7 @@ unitTest({ perms: { read: true } }, function filesIterSync() { unitTest( { perms: { read: true } }, function filesIterSyncCustomBufSize() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = Deno.openSync(filename); let totalSize = 0; @@ -264,7 +264,7 @@ unitTest( ); unitTest(async function openOptions() { - const filename = "cli/tests/fixture.json"; + const filename = "cli/tests/testdata/fixture.json"; await assertThrowsAsync( async () => { await Deno.open(filename, { write: false }); @@ -532,7 +532,7 @@ unitTest( ); unitTest({ perms: { read: true } }, async function seekStart() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = await Deno.open(filename); const seekPosition = 6; // Deliberately move 1 step forward @@ -549,7 +549,7 @@ unitTest({ perms: { read: true } }, async function seekStart() { }); unitTest({ perms: { read: true } }, function seekSyncStart() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = Deno.openSync(filename); const seekPosition = 6; // Deliberately move 1 step forward @@ -566,7 +566,7 @@ unitTest({ perms: { read: true } }, function seekSyncStart() { }); unitTest({ perms: { read: true } }, async function seekCurrent() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = await Deno.open(filename); // Deliberately move 1 step forward await file.read(new Uint8Array(1)); // "H" @@ -583,7 +583,7 @@ unitTest({ perms: { read: true } }, async function seekCurrent() { }); unitTest({ perms: { read: true } }, function seekSyncCurrent() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = Deno.openSync(filename); // Deliberately move 1 step forward file.readSync(new Uint8Array(1)); // "H" @@ -600,7 +600,7 @@ unitTest({ perms: { read: true } }, function seekSyncCurrent() { }); unitTest({ perms: { read: true } }, async function seekEnd() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = await Deno.open(filename); const seekPosition = -6; // seek from end of file that has 12 chars, 12 - 6 = 6 @@ -614,7 +614,7 @@ unitTest({ perms: { read: true } }, async function seekEnd() { }); unitTest({ perms: { read: true } }, function seekSyncEnd() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = Deno.openSync(filename); const seekPosition = -6; // seek from end of file that has 12 chars, 12 - 6 = 6 @@ -628,7 +628,7 @@ unitTest({ perms: { read: true } }, function seekSyncEnd() { }); unitTest({ perms: { read: true } }, async function seekMode() { - const filename = "cli/tests/hello.txt"; + const filename = "cli/tests/testdata/hello.txt"; const file = await Deno.open(filename); await assertThrowsAsync( async () => { diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts index 4cdd849026..d762a64976 100644 --- a/cli/tests/unit/http_test.ts +++ b/cli/tests/unit/http_test.ts @@ -208,8 +208,8 @@ unitTest( const listener = Deno.listenTls({ hostname, port, - certFile: "cli/tests/tls/localhost.crt", - keyFile: "cli/tests/tls/localhost.key", + certFile: "cli/tests/testdata/tls/localhost.crt", + keyFile: "cli/tests/testdata/tls/localhost.key", }); const conn = await listener.accept(); const httpConn = Deno.serveHttp(conn); @@ -226,7 +226,7 @@ unitTest( listener.close(); })(); - const caData = Deno.readTextFileSync("cli/tests/tls/RootCA.pem"); + const caData = Deno.readTextFileSync("cli/tests/testdata/tls/RootCA.pem"); const client = Deno.createHttpClient({ caData }); const resp = await fetch(`https://${hostname}:${port}/`, { client, diff --git a/cli/tests/unit/read_dir_test.ts b/cli/tests/unit/read_dir_test.ts index 2e4370153c..4f02fae9b7 100644 --- a/cli/tests/unit/read_dir_test.ts +++ b/cli/tests/unit/read_dir_test.ts @@ -22,12 +22,14 @@ function assertSameContent(files: Deno.DirEntry[]) { } unitTest({ perms: { read: true } }, function readDirSyncSuccess() { - const files = [...Deno.readDirSync("cli/tests/")]; + const files = [...Deno.readDirSync("cli/tests/testdata")]; assertSameContent(files); }); unitTest({ perms: { read: true } }, function readDirSyncWithUrl() { - const files = [...Deno.readDirSync(pathToAbsoluteFileUrl("cli/tests"))]; + const files = [ + ...Deno.readDirSync(pathToAbsoluteFileUrl("cli/tests/testdata")), + ]; assertSameContent(files); }); @@ -39,7 +41,7 @@ unitTest({ perms: { read: false } }, function readDirSyncPerm() { unitTest({ perms: { read: true } }, function readDirSyncNotDir() { assertThrows(() => { - Deno.readDirSync("cli/tests/fixture.json"); + Deno.readDirSync("cli/tests/testdata/fixture.json"); }, Error); }); @@ -51,7 +53,7 @@ unitTest({ perms: { read: true } }, function readDirSyncNotFound() { unitTest({ perms: { read: true } }, async function readDirSuccess() { const files = []; - for await (const dirEntry of Deno.readDir("cli/tests/")) { + for await (const dirEntry of Deno.readDir("cli/tests/testdata")) { files.push(dirEntry); } assertSameContent(files); @@ -60,7 +62,7 @@ unitTest({ perms: { read: true } }, async function readDirSuccess() { unitTest({ perms: { read: true } }, async function readDirWithUrl() { const files = []; for await ( - const dirEntry of Deno.readDir(pathToAbsoluteFileUrl("cli/tests")) + const dirEntry of Deno.readDir(pathToAbsoluteFileUrl("cli/tests/testdata")) ) { files.push(dirEntry); } diff --git a/cli/tests/unit/read_file_test.ts b/cli/tests/unit/read_file_test.ts index f638c7a7ce..7dd2b5621f 100644 --- a/cli/tests/unit/read_file_test.ts +++ b/cli/tests/unit/read_file_test.ts @@ -9,7 +9,7 @@ import { } from "./test_util.ts"; unitTest({ perms: { read: true } }, function readFileSyncSuccess() { - const data = Deno.readFileSync("cli/tests/fixture.json"); + const data = Deno.readFileSync("cli/tests/testdata/fixture.json"); assert(data.byteLength > 0); const decoder = new TextDecoder("utf-8"); const json = decoder.decode(data); @@ -19,7 +19,7 @@ unitTest({ perms: { read: true } }, function readFileSyncSuccess() { unitTest({ perms: { read: true } }, function readFileSyncUrl() { const data = Deno.readFileSync( - pathToAbsoluteFileUrl("cli/tests/fixture.json"), + pathToAbsoluteFileUrl("cli/tests/testdata/fixture.json"), ); assert(data.byteLength > 0); const decoder = new TextDecoder("utf-8"); @@ -30,7 +30,7 @@ unitTest({ perms: { read: true } }, function readFileSyncUrl() { unitTest({ perms: { read: false } }, function readFileSyncPerm() { assertThrows(() => { - Deno.readFileSync("cli/tests/fixture.json"); + Deno.readFileSync("cli/tests/testdata/fixture.json"); }, Deno.errors.PermissionDenied); }); @@ -42,7 +42,7 @@ unitTest({ perms: { read: true } }, function readFileSyncNotFound() { unitTest({ perms: { read: true } }, async function readFileUrl() { const data = await Deno.readFile( - pathToAbsoluteFileUrl("cli/tests/fixture.json"), + pathToAbsoluteFileUrl("cli/tests/testdata/fixture.json"), ); assert(data.byteLength > 0); const decoder = new TextDecoder("utf-8"); @@ -52,7 +52,7 @@ unitTest({ perms: { read: true } }, async function readFileUrl() { }); unitTest({ perms: { read: true } }, async function readFileSuccess() { - const data = await Deno.readFile("cli/tests/fixture.json"); + const data = await Deno.readFile("cli/tests/testdata/fixture.json"); assert(data.byteLength > 0); const decoder = new TextDecoder("utf-8"); const json = decoder.decode(data); @@ -62,13 +62,13 @@ unitTest({ perms: { read: true } }, async function readFileSuccess() { unitTest({ perms: { read: false } }, async function readFilePerm() { await assertThrowsAsync(async () => { - await Deno.readFile("cli/tests/fixture.json"); + await Deno.readFile("cli/tests/testdata/fixture.json"); }, Deno.errors.PermissionDenied); }); unitTest({ perms: { read: true } }, function readFileSyncLoop() { for (let i = 0; i < 256; i++) { - Deno.readFileSync("cli/tests/fixture.json"); + Deno.readFileSync("cli/tests/testdata/fixture.json"); } }); @@ -96,7 +96,9 @@ unitTest( const ac = new AbortController(); queueMicrotask(() => ac.abort()); await assertThrowsAsync(async () => { - await Deno.readFile("cli/tests/fixture.json", { signal: ac.signal }); + await Deno.readFile("cli/tests/testdata/fixture.json", { + signal: ac.signal, + }); }); }, ); @@ -107,7 +109,9 @@ unitTest( const ac = new AbortController(); queueMicrotask(() => ac.abort()); await assertThrowsAsync(async () => { - await Deno.readTextFile("cli/tests/fixture.json", { signal: ac.signal }); + await Deno.readTextFile("cli/tests/testdata/fixture.json", { + signal: ac.signal, + }); }); }, ); diff --git a/cli/tests/unit/read_text_file_test.ts b/cli/tests/unit/read_text_file_test.ts index a7eb1a7303..3d7ccfaa66 100644 --- a/cli/tests/unit/read_text_file_test.ts +++ b/cli/tests/unit/read_text_file_test.ts @@ -8,7 +8,7 @@ import { } from "./test_util.ts"; unitTest({ perms: { read: true } }, function readTextFileSyncSuccess() { - const data = Deno.readTextFileSync("cli/tests/fixture.json"); + const data = Deno.readTextFileSync("cli/tests/testdata/fixture.json"); assert(data.length > 0); const pkg = JSON.parse(data); assertEquals(pkg.name, "deno"); @@ -16,7 +16,7 @@ unitTest({ perms: { read: true } }, function readTextFileSyncSuccess() { unitTest({ perms: { read: true } }, function readTextFileSyncByUrl() { const data = Deno.readTextFileSync( - pathToAbsoluteFileUrl("cli/tests/fixture.json"), + pathToAbsoluteFileUrl("cli/tests/testdata/fixture.json"), ); assert(data.length > 0); const pkg = JSON.parse(data); @@ -25,7 +25,7 @@ unitTest({ perms: { read: true } }, function readTextFileSyncByUrl() { unitTest({ perms: { read: false } }, function readTextFileSyncPerm() { assertThrows(() => { - Deno.readTextFileSync("cli/tests/fixture.json"); + Deno.readTextFileSync("cli/tests/testdata/fixture.json"); }, Deno.errors.PermissionDenied); }); @@ -38,7 +38,7 @@ unitTest({ perms: { read: true } }, function readTextFileSyncNotFound() { unitTest( { perms: { read: true } }, async function readTextFileSuccess() { - const data = await Deno.readTextFile("cli/tests/fixture.json"); + const data = await Deno.readTextFile("cli/tests/testdata/fixture.json"); assert(data.length > 0); const pkg = JSON.parse(data); assertEquals(pkg.name, "deno"); @@ -47,7 +47,7 @@ unitTest( unitTest({ perms: { read: true } }, async function readTextFileByUrl() { const data = await Deno.readTextFile( - pathToAbsoluteFileUrl("cli/tests/fixture.json"), + pathToAbsoluteFileUrl("cli/tests/testdata/fixture.json"), ); assert(data.length > 0); const pkg = JSON.parse(data); @@ -56,13 +56,13 @@ unitTest({ perms: { read: true } }, async function readTextFileByUrl() { unitTest({ perms: { read: false } }, async function readTextFilePerm() { await assertThrowsAsync(async () => { - await Deno.readTextFile("cli/tests/fixture.json"); + await Deno.readTextFile("cli/tests/testdata/fixture.json"); }, Deno.errors.PermissionDenied); }); unitTest({ perms: { read: true } }, function readTextFileSyncLoop() { for (let i = 0; i < 256; i++) { - Deno.readTextFileSync("cli/tests/fixture.json"); + Deno.readTextFileSync("cli/tests/testdata/fixture.json"); } }); diff --git a/cli/tests/unit/real_path_test.ts b/cli/tests/unit/real_path_test.ts index b84b0c0df2..8c0728ca91 100644 --- a/cli/tests/unit/real_path_test.ts +++ b/cli/tests/unit/real_path_test.ts @@ -10,7 +10,7 @@ import { } from "./test_util.ts"; unitTest({ perms: { read: true } }, function realPathSyncSuccess() { - const relative = "cli/tests/fixture.json"; + const relative = "cli/tests/testdata/fixture.json"; const realPath = Deno.realPathSync(relative); if (Deno.build.os !== "windows") { assert(realPath.startsWith("/")); @@ -22,7 +22,7 @@ unitTest({ perms: { read: true } }, function realPathSyncSuccess() { }); unitTest({ perms: { read: true } }, function realPathSyncUrl() { - const relative = "cli/tests/fixture.json"; + const relative = "cli/tests/testdata/fixture.json"; const url = pathToAbsoluteFileUrl(relative); assertEquals(Deno.realPathSync(relative), Deno.realPathSync(url)); }); @@ -61,7 +61,7 @@ unitTest({ perms: { read: true } }, function realPathSyncNotFound() { }); unitTest({ perms: { read: true } }, async function realPathSuccess() { - const relativePath = "cli/tests/fixture.json"; + const relativePath = "cli/tests/testdata/fixture.json"; const realPath = await Deno.realPath(relativePath); if (Deno.build.os !== "windows") { assert(realPath.startsWith("/")); @@ -75,7 +75,7 @@ unitTest({ perms: { read: true } }, async function realPathSuccess() { unitTest( { perms: { read: true } }, async function realPathUrl() { - const relative = "cli/tests/fixture.json"; + const relative = "cli/tests/testdata/fixture.json"; const url = pathToAbsoluteFileUrl(relative); assertEquals(await Deno.realPath(relative), await Deno.realPath(url)); }, diff --git a/cli/tests/unit/resources_test.ts b/cli/tests/unit/resources_test.ts index ea183a0687..e2ca4116d0 100644 --- a/cli/tests/unit/resources_test.ts +++ b/cli/tests/unit/resources_test.ts @@ -37,7 +37,7 @@ unitTest({ perms: { net: true } }, async function resourcesNet() { unitTest({ perms: { read: true } }, async function resourcesFile() { const resourcesBefore = Deno.resources(); - const f = await Deno.open("cli/tests/hello.txt"); + const f = await Deno.open("cli/tests/testdata/hello.txt"); const resourcesAfter = Deno.resources(); f.close(); diff --git a/cli/tests/unit/stat_test.ts b/cli/tests/unit/stat_test.ts index 4b663e5b92..7db9dee718 100644 --- a/cli/tests/unit/stat_test.ts +++ b/cli/tests/unit/stat_test.ts @@ -41,11 +41,11 @@ unitTest({ perms: { read: true } }, async function fstatSuccess() { unitTest( { perms: { read: true, write: true } }, function statSyncSuccess() { - const packageInfo = Deno.statSync("README.md"); - assert(packageInfo.isFile); - assert(!packageInfo.isSymlink); + const readmeInfo = Deno.statSync("README.md"); + assert(readmeInfo.isFile); + assert(!readmeInfo.isSymlink); - const modulesInfo = Deno.statSync("cli/tests/symlink_to_subdir"); + const modulesInfo = Deno.statSync("cli/tests/testdata/symlink_to_subdir"); assert(modulesInfo.isDirectory); assert(!modulesInfo.isSymlink); @@ -62,12 +62,12 @@ unitTest( tempInfo.birthtime === null || now - tempInfo.birthtime.valueOf() < 1000, ); - const packageInfoByUrl = Deno.statSync(pathToAbsoluteFileUrl("README.md")); - assert(packageInfoByUrl.isFile); - assert(!packageInfoByUrl.isSymlink); + const readmeInfoByUrl = Deno.statSync(pathToAbsoluteFileUrl("README.md")); + assert(readmeInfoByUrl.isFile); + assert(!readmeInfoByUrl.isSymlink); const modulesInfoByUrl = Deno.statSync( - pathToAbsoluteFileUrl("cli/tests/symlink_to_subdir"), + pathToAbsoluteFileUrl("cli/tests/testdata/symlink_to_subdir"), ); assert(modulesInfoByUrl.isDirectory); assert(!modulesInfoByUrl.isSymlink); @@ -122,12 +122,12 @@ unitTest({ perms: { read: true } }, function lstatSyncSuccess() { assert(packageInfoByUrl.isFile); assert(!packageInfoByUrl.isSymlink); - const modulesInfo = Deno.lstatSync("cli/tests/symlink_to_subdir"); + const modulesInfo = Deno.lstatSync("cli/tests/testdata/symlink_to_subdir"); assert(!modulesInfo.isDirectory); assert(modulesInfo.isSymlink); const modulesInfoByUrl = Deno.lstatSync( - pathToAbsoluteFileUrl("cli/tests/symlink_to_subdir"), + pathToAbsoluteFileUrl("cli/tests/testdata/symlink_to_subdir"), ); assert(!modulesInfoByUrl.isDirectory); assert(modulesInfoByUrl.isSymlink); @@ -143,7 +143,7 @@ unitTest({ perms: { read: true } }, function lstatSyncSuccess() { unitTest({ perms: { read: false } }, function lstatSyncPerm() { assertThrows(() => { - Deno.lstatSync("README.md"); + Deno.lstatSync("hello.txt"); }, Deno.errors.PermissionDenied); }); @@ -156,22 +156,22 @@ unitTest({ perms: { read: true } }, function lstatSyncNotFound() { unitTest( { perms: { read: true, write: true } }, async function statSuccess() { - const packageInfo = await Deno.stat("README.md"); - assert(packageInfo.isFile); - assert(!packageInfo.isSymlink); + const readmeInfo = await Deno.stat("README.md"); + assert(readmeInfo.isFile); + assert(!readmeInfo.isSymlink); - const packageInfoByUrl = await Deno.stat( + const readmeInfoByUrl = await Deno.stat( pathToAbsoluteFileUrl("README.md"), ); - assert(packageInfoByUrl.isFile); - assert(!packageInfoByUrl.isSymlink); + assert(readmeInfoByUrl.isFile); + assert(!readmeInfoByUrl.isSymlink); - const modulesInfo = await Deno.stat("cli/tests/symlink_to_subdir"); + const modulesInfo = await Deno.stat("cli/tests/testdata/symlink_to_subdir"); assert(modulesInfo.isDirectory); assert(!modulesInfo.isSymlink); const modulesInfoByUrl = await Deno.stat( - pathToAbsoluteFileUrl("cli/tests/symlink_to_subdir"), + pathToAbsoluteFileUrl("cli/tests/testdata/symlink_to_subdir"), ); assert(modulesInfoByUrl.isDirectory); assert(!modulesInfoByUrl.isSymlink); @@ -234,20 +234,20 @@ unitTest({ perms: { read: true } }, async function statNotFound() { }); unitTest({ perms: { read: true } }, async function lstatSuccess() { - const packageInfo = await Deno.lstat("README.md"); - assert(packageInfo.isFile); - assert(!packageInfo.isSymlink); + const readmeInfo = await Deno.lstat("README.md"); + assert(readmeInfo.isFile); + assert(!readmeInfo.isSymlink); - const packageInfoByUrl = await Deno.lstat(pathToAbsoluteFileUrl("README.md")); - assert(packageInfoByUrl.isFile); - assert(!packageInfoByUrl.isSymlink); + const readmeInfoByUrl = await Deno.lstat(pathToAbsoluteFileUrl("README.md")); + assert(readmeInfoByUrl.isFile); + assert(!readmeInfoByUrl.isSymlink); - const modulesInfo = await Deno.lstat("cli/tests/symlink_to_subdir"); + const modulesInfo = await Deno.lstat("cli/tests/testdata/symlink_to_subdir"); assert(!modulesInfo.isDirectory); assert(modulesInfo.isSymlink); const modulesInfoByUrl = await Deno.lstat( - pathToAbsoluteFileUrl("cli/tests/symlink_to_subdir"), + pathToAbsoluteFileUrl("cli/tests/testdata/symlink_to_subdir"), ); assert(!modulesInfoByUrl.isDirectory); assert(modulesInfoByUrl.isSymlink); diff --git a/cli/tests/unit/tls_test.ts b/cli/tests/unit/tls_test.ts index 8472d93e05..12fe9bd503 100644 --- a/cli/tests/unit/tls_test.ts +++ b/cli/tests/unit/tls_test.ts @@ -37,8 +37,8 @@ unitTest( const listener = await Deno.listenTls({ hostname: "localhost", port: 3567, - certFile: "cli/tests/tls/localhost.crt", - keyFile: "cli/tests/tls/localhost.key", + certFile: "cli/tests/testdata/tls/localhost.crt", + keyFile: "cli/tests/testdata/tls/localhost.key", }); await assertThrowsAsync(async () => { @@ -54,7 +54,7 @@ unitTest(async function connectTLSCertFileNoReadPerm() { await Deno.connectTls({ hostname: "deno.land", port: 443, - certFile: "cli/tests/tls/RootCA.crt", + certFile: "cli/tests/testdata/tls/RootCA.crt", }); }, Deno.errors.PermissionDenied); }); @@ -65,8 +65,8 @@ unitTest( const options = { hostname: "localhost", port: 3500, - certFile: "cli/tests/tls/localhost.crt", - keyFile: "cli/tests/tls/localhost.key", + certFile: "cli/tests/testdata/tls/localhost.crt", + keyFile: "cli/tests/testdata/tls/localhost.key", }; assertThrows(() => { @@ -90,8 +90,8 @@ unitTest({ perms: { net: true } }, function listenTLSNoReadPerm() { Deno.listenTls({ hostname: "localhost", port: 3500, - certFile: "cli/tests/tls/localhost.crt", - keyFile: "cli/tests/tls/localhost.key", + certFile: "cli/tests/testdata/tls/localhost.crt", + keyFile: "cli/tests/testdata/tls/localhost.key", }); }, Deno.errors.PermissionDenied); }); @@ -104,8 +104,8 @@ unitTest( const options = { hostname: "localhost", port: 3500, - certFile: "cli/tests/tls/localhost.crt", - keyFile: "cli/tests/tls/localhost.key", + certFile: "cli/tests/testdata/tls/localhost.crt", + keyFile: "cli/tests/testdata/tls/localhost.key", }; const testDir = Deno.makeTempDirSync(); @@ -129,8 +129,8 @@ unitTest( const options = { hostname: "localhost", port: 3500, - certFile: "cli/tests/tls/localhost.crt", - keyFile: "cli/tests/tls/localhost.key", + certFile: "cli/tests/testdata/tls/localhost.crt", + keyFile: "cli/tests/testdata/tls/localhost.key", }; const testDir = Deno.makeTempDirSync(); @@ -158,8 +158,8 @@ unitTest( const listener = Deno.listenTls({ hostname, port, - certFile: "cli/tests/tls/localhost.crt", - keyFile: "cli/tests/tls/localhost.key", + certFile: "cli/tests/testdata/tls/localhost.crt", + keyFile: "cli/tests/testdata/tls/localhost.key", }); const response = encoder.encode( @@ -182,7 +182,7 @@ unitTest( const conn = await Deno.connectTls({ hostname, port, - certFile: "cli/tests/tls/RootCA.pem", + certFile: "cli/tests/testdata/tls/RootCA.pem", }); assert(conn.rid > 0); const w = new BufWriter(conn); @@ -222,15 +222,15 @@ async function tlsPair(): Promise<[Deno.Conn, Deno.Conn]> { const listener = Deno.listenTls({ hostname: "localhost", port, - certFile: "cli/tests/tls/localhost.crt", - keyFile: "cli/tests/tls/localhost.key", + certFile: "cli/tests/testdata/tls/localhost.crt", + keyFile: "cli/tests/testdata/tls/localhost.key", }); const acceptPromise = listener.accept(); const connectPromise = Deno.connectTls({ hostname: "localhost", port, - certFile: "cli/tests/tls/RootCA.pem", + certFile: "cli/tests/testdata/tls/RootCA.pem", }); const endpoints = await Promise.all([acceptPromise, connectPromise]); @@ -553,8 +553,8 @@ async function tlsWithTcpFailureTestImpl( const tlsListener = Deno.listenTls({ hostname: "localhost", port: tlsPort, - certFile: "cli/tests/tls/localhost.crt", - keyFile: "cli/tests/tls/localhost.key", + certFile: "cli/tests/testdata/tls/localhost.crt", + keyFile: "cli/tests/testdata/tls/localhost.key", }); const tcpPort = getPort(); @@ -570,7 +570,7 @@ async function tlsWithTcpFailureTestImpl( Deno.connectTls({ hostname: "localhost", port: tcpPort, - certFile: "cli/tests/tls/RootCA.crt", + certFile: "cli/tests/testdata/tls/RootCA.crt", }), ]); @@ -845,8 +845,8 @@ function createHttpsListener(port: number): Deno.Listener { const listener = Deno.listenTls({ hostname: "localhost", port, - certFile: "./cli/tests/tls/localhost.crt", - keyFile: "./cli/tests/tls/localhost.key", + certFile: "./cli/tests/testdata/tls/localhost.crt", + keyFile: "./cli/tests/testdata/tls/localhost.key", }); serve(listener); @@ -995,7 +995,9 @@ unitTest( hostname: "deno.land", port: 443, certChain: "bad data", - privateKey: await Deno.readTextFile("cli/tests/tls/localhost.key"), + privateKey: await Deno.readTextFile( + "cli/tests/testdata/tls/localhost.key", + ), }); }, Deno.errors.InvalidData); }, @@ -1008,7 +1010,9 @@ unitTest( await Deno.connectTls({ hostname: "deno.land", port: 443, - certChain: await Deno.readTextFile("cli/tests/tls/localhost.crt"), + certChain: await Deno.readTextFile( + "cli/tests/testdata/tls/localhost.crt", + ), privateKey: "bad data", }); }, Deno.errors.InvalidData); @@ -1022,7 +1026,9 @@ unitTest( await Deno.connectTls({ hostname: "deno.land", port: 443, - certChain: await Deno.readTextFile("cli/tests/tls/localhost.crt"), + certChain: await Deno.readTextFile( + "cli/tests/testdata/tls/localhost.crt", + ), privateKey: "", }); }, Deno.errors.InvalidData); @@ -1034,15 +1040,19 @@ unitTest( async function connectWithClientCert() { // The test_server running on port 4552 responds with 'PASS' if client // authentication was successful. Try it by running test_server and - // curl --key cli/tests/tls/localhost.key \ - // --cert cli/tests/tls/localhost.crt \ - // --cacert cli/tests/tls/RootCA.crt https://localhost:4552/ + // curl --key cli/tests/testdata/tls/localhost.key \ + // --cert cli/tests/testdata/tls/localhost.crt \ + // --cacert cli/tests/testdata/tls/RootCA.crt https://localhost:4552/ const conn = await Deno.connectTls({ hostname: "localhost", port: 4552, - certChain: await Deno.readTextFile("cli/tests/tls/localhost.crt"), - privateKey: await Deno.readTextFile("cli/tests/tls/localhost.key"), - certFile: "cli/tests/tls/RootCA.crt", + certChain: await Deno.readTextFile( + "cli/tests/testdata/tls/localhost.crt", + ), + privateKey: await Deno.readTextFile( + "cli/tests/testdata/tls/localhost.key", + ), + certFile: "cli/tests/testdata/tls/RootCA.crt", }); const result = decoder.decode(await readAll(conn)); assertEquals(result, "PASS"); diff --git a/cli/tests/unit/tty_test.ts b/cli/tests/unit/tty_test.ts index a9f1105f64..b45a43f1a7 100644 --- a/cli/tests/unit/tty_test.ts +++ b/cli/tests/unit/tty_test.ts @@ -4,7 +4,7 @@ import { assert, assertThrows, unitTest } from "./test_util.ts"; // Note tests for Deno.setRaw is in integration tests. unitTest({ perms: { read: true } }, function consoleSizeFile() { - const file = Deno.openSync("cli/tests/hello.txt"); + const file = Deno.openSync("cli/tests/testdata/hello.txt"); assertThrows(() => { Deno.consoleSize(file.rid); }, Error); @@ -20,7 +20,7 @@ unitTest(function consoleSizeError() { unitTest({ perms: { read: true } }, function isatty() { // CI not under TTY, so cannot test stdin/stdout/stderr. - const f = Deno.openSync("cli/tests/hello.txt"); + const f = Deno.openSync("cli/tests/testdata/hello.txt"); assert(!Deno.isatty(f.rid)); f.close(); }); diff --git a/cli/tests/unit/wasm_test.ts b/cli/tests/unit/wasm_test.ts index 66fcacade1..c2180db3c9 100644 --- a/cli/tests/unit/wasm_test.ts +++ b/cli/tests/unit/wasm_test.ts @@ -74,7 +74,7 @@ unitTest( // deno-dom's WASM file is a real-world non-trivial case that gave us // trouble when implementing this. await WebAssembly.instantiateStreaming(fetch( - "http://localhost:4545/cli/tests/deno_dom_0.1.3-alpha2.wasm", + "http://localhost:4545/deno_dom_0.1.3-alpha2.wasm", )); }, ); diff --git a/cli/tests/unit/webgpu_test.ts b/cli/tests/unit/webgpu_test.ts index 4fbbd5cde7..cbefa7c077 100644 --- a/cli/tests/unit/webgpu_test.ts +++ b/cli/tests/unit/webgpu_test.ts @@ -22,7 +22,7 @@ unitTest({ assert(device); const shaderCode = await Deno.readTextFile( - "cli/tests/webgpu_computepass_shader.wgsl", + "cli/tests/testdata/webgpu_computepass_shader.wgsl", ); const shaderModule = device.createShaderModule({ @@ -111,7 +111,7 @@ unitTest({ assert(device); const shaderCode = await Deno.readTextFile( - "cli/tests/webgpu_hellotriangle_shader.wgsl", + "cli/tests/testdata/webgpu_hellotriangle_shader.wgsl", ); const shaderModule = device.createShaderModule({ @@ -194,7 +194,10 @@ unitTest({ await outputBuffer.mapAsync(1); const data = new Uint8Array(outputBuffer.getMappedRange()); - assertEquals(data, await Deno.readFile("cli/tests/webgpu_hellotriangle.out")); + assertEquals( + data, + await Deno.readFile("cli/tests/testdata/webgpu_hellotriangle.out"), + ); outputBuffer.unmap(); diff --git a/cli/tests/workers/permissions_remote_remote.ts b/cli/tests/workers/permissions_remote_remote.ts deleted file mode 100644 index b1f954a31e..0000000000 --- a/cli/tests/workers/permissions_remote_remote.ts +++ /dev/null @@ -1,3 +0,0 @@ -new Worker("http://localhost:4545/cli/tests/workers/static_remote.ts", { - type: "module", -}); diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index b6bb8bbb28..4d4709e28f 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -320,7 +320,7 @@ mod tests { use deno_core::parking_lot::Mutex; use std::process::Command; use tempfile::TempDir; - use test_util::tests_path; + use test_util::testdata_path; lazy_static::lazy_static! { pub static ref ENV_LOCK: Mutex<()> = Mutex::new(()); @@ -417,7 +417,7 @@ mod tests { install( Flags::default(), - "http://localhost:4545/cli/tests/echo_server.ts", + "http://localhost:4545/echo_server.ts", vec![], Some("echo_test".to_string()), None, @@ -437,11 +437,11 @@ mod tests { assert_eq!(content.chars().last().unwrap(), '\n'); if cfg!(windows) { - assert!(content - .contains(r#""run" "http://localhost:4545/cli/tests/echo_server.ts""#)); + assert!( + content.contains(r#""run" "http://localhost:4545/echo_server.ts""#) + ); } else { - assert!(content - .contains(r#"run 'http://localhost:4545/cli/tests/echo_server.ts'"#)); + assert!(content.contains(r#"run 'http://localhost:4545/echo_server.ts'"#)); } if let Some(home) = original_home { env::set_var("HOME", home); @@ -465,7 +465,7 @@ mod tests { unstable: true, ..Flags::default() }, - "http://localhost:4545/cli/tests/echo_server.ts", + "http://localhost:4545/echo_server.ts", vec![], Some("echo_test".to_string()), Some(temp_dir.path().to_path_buf()), @@ -484,12 +484,11 @@ mod tests { println!("this is the file path {:?}", content); if cfg!(windows) { assert!(content.contains( - r#""run" "--unstable" "http://localhost:4545/cli/tests/echo_server.ts""# + r#""run" "--unstable" "http://localhost:4545/echo_server.ts""# )); } else { - assert!(content.contains( - r#"run --unstable 'http://localhost:4545/cli/tests/echo_server.ts'"# - )); + assert!(content + .contains(r#"run --unstable 'http://localhost:4545/echo_server.ts'"#)); } } @@ -501,7 +500,7 @@ mod tests { install( Flags::default(), - "http://localhost:4545/cli/tests/echo_server.ts", + "http://localhost:4545/echo_server.ts", vec![], None, Some(temp_dir.path().to_path_buf()), @@ -517,11 +516,11 @@ mod tests { assert!(file_path.exists()); let content = fs::read_to_string(file_path).unwrap(); if cfg!(windows) { - assert!(content - .contains(r#""run" "http://localhost:4545/cli/tests/echo_server.ts""#)); + assert!( + content.contains(r#""run" "http://localhost:4545/echo_server.ts""#) + ); } else { - assert!(content - .contains(r#"run 'http://localhost:4545/cli/tests/echo_server.ts'"#)); + assert!(content.contains(r#"run 'http://localhost:4545/echo_server.ts'"#)); } } @@ -533,7 +532,7 @@ mod tests { install( Flags::default(), - "http://localhost:4545/cli/tests/subdir/main.ts", + "http://localhost:4545/subdir/main.ts", vec![], None, Some(temp_dir.path().to_path_buf()), @@ -549,11 +548,11 @@ mod tests { assert!(file_path.exists()); let content = fs::read_to_string(file_path).unwrap(); if cfg!(windows) { - assert!(content - .contains(r#""run" "http://localhost:4545/cli/tests/subdir/main.ts""#)); + assert!( + content.contains(r#""run" "http://localhost:4545/subdir/main.ts""#) + ); } else { - assert!(content - .contains(r#"run 'http://localhost:4545/cli/tests/subdir/main.ts'"#)); + assert!(content.contains(r#"run 'http://localhost:4545/subdir/main.ts'"#)); } } @@ -565,7 +564,7 @@ mod tests { install( Flags::default(), - "http://localhost:4545/cli/tests/echo_server.ts", + "http://localhost:4545/echo_server.ts", vec![], Some("echo_test".to_string()), Some(temp_dir.path().to_path_buf()), @@ -581,11 +580,11 @@ mod tests { assert!(file_path.exists()); let content = fs::read_to_string(file_path).unwrap(); if cfg!(windows) { - assert!(content - .contains(r#""run" "http://localhost:4545/cli/tests/echo_server.ts""#)); + assert!( + content.contains(r#""run" "http://localhost:4545/echo_server.ts""#) + ); } else { - assert!(content - .contains(r#"run 'http://localhost:4545/cli/tests/echo_server.ts'"#)); + assert!(content.contains(r#"run 'http://localhost:4545/echo_server.ts'"#)); } } @@ -600,7 +599,7 @@ mod tests { install( Flags::default(), - "http://localhost:4545/cli/tests/echo_server.ts", + "http://localhost:4545/echo_server.ts", vec![], Some("echo_test".to_string()), None, @@ -616,11 +615,11 @@ mod tests { assert!(file_path.exists()); let content = fs::read_to_string(file_path).unwrap(); if cfg!(windows) { - assert!(content - .contains(r#""run" "http://localhost:4545/cli/tests/echo_server.ts""#)); + assert!( + content.contains(r#""run" "http://localhost:4545/echo_server.ts""#) + ); } else { - assert!(content - .contains(r#"run 'http://localhost:4545/cli/tests/echo_server.ts'"#)); + assert!(content.contains(r#"run 'http://localhost:4545/echo_server.ts'"#)); } if let Some(install_root) = original_install_root { env::set_var("DENO_INSTALL_ROOT", install_root); @@ -641,7 +640,7 @@ mod tests { log_level: Some(Level::Error), ..Flags::default() }, - "http://localhost:4545/cli/tests/echo_server.ts", + "http://localhost:4545/echo_server.ts", vec!["--foobar".to_string()], Some("echo_test".to_string()), Some(temp_dir.path().to_path_buf()), @@ -657,9 +656,9 @@ mod tests { assert!(file_path.exists()); let content = fs::read_to_string(file_path).unwrap(); if cfg!(windows) { - assert!(content.contains(r#""run" "--allow-read" "--allow-net" "--quiet" "--no-check" "http://localhost:4545/cli/tests/echo_server.ts" "--foobar""#)); + assert!(content.contains(r#""run" "--allow-read" "--allow-net" "--quiet" "--no-check" "http://localhost:4545/echo_server.ts" "--foobar""#)); } else { - assert!(content.contains(r#"run --allow-read --allow-net --quiet --no-check 'http://localhost:4545/cli/tests/echo_server.ts' --foobar"#)); + assert!(content.contains(r#"run --allow-read --allow-net --quiet --no-check 'http://localhost:4545/echo_server.ts' --foobar"#)); } } @@ -700,7 +699,7 @@ mod tests { install( Flags::default(), - "http://localhost:4545/cli/tests/echo_server.ts", + "http://localhost:4545/echo_server.ts", vec![], Some("echo_test".to_string()), Some(temp_dir.path().to_path_buf()), @@ -717,7 +716,7 @@ mod tests { // No force. Install failed. let no_force_result = install( Flags::default(), - "http://localhost:4545/cli/tests/cat.ts", // using a different URL + "http://localhost:4545/cat.ts", // using a different URL vec![], Some("echo_test".to_string()), Some(temp_dir.path().to_path_buf()), @@ -735,7 +734,7 @@ mod tests { // Force. Install success. let force_result = install( Flags::default(), - "http://localhost:4545/cli/tests/cat.ts", // using a different URL + "http://localhost:4545/cat.ts", // using a different URL vec![], Some("echo_test".to_string()), Some(temp_dir.path().to_path_buf()), @@ -762,7 +761,7 @@ mod tests { config_path: Some(config_file_path.to_string_lossy().to_string()), ..Flags::default() }, - "http://localhost:4545/cli/tests/cat.ts", + "http://localhost:4545/cat.ts", vec![], Some("echo_test".to_string()), Some(temp_dir.path().to_path_buf()), @@ -789,7 +788,7 @@ mod tests { install( Flags::default(), - "http://localhost:4545/cli/tests/echo_server.ts", + "http://localhost:4545/echo_server.ts", vec!["\"".to_string()], Some("echo_test".to_string()), Some(temp_dir.path().to_path_buf()), @@ -808,9 +807,9 @@ mod tests { if cfg!(windows) { // TODO: see comment above this test } else { - assert!(content.contains( - r#"run 'http://localhost:4545/cli/tests/echo_server.ts' '"'"# - )); + assert!( + content.contains(r#"run 'http://localhost:4545/echo_server.ts' '"'"#) + ); } } @@ -864,7 +863,7 @@ mod tests { import_map_path: Some(import_map_path.to_string_lossy().to_string()), ..Flags::default() }, - "http://localhost:4545/cli/tests/cat.ts", + "http://localhost:4545/cat.ts", vec![], Some("echo_test".to_string()), Some(temp_dir.path().to_path_buf()), @@ -879,12 +878,12 @@ mod tests { assert!(file_path.exists()); let mut expected_string = format!( - "--import-map '{}' 'http://localhost:4545/cli/tests/cat.ts'", + "--import-map '{}' 'http://localhost:4545/cat.ts'", import_map_url.to_string() ); if cfg!(windows) { expected_string = format!( - "\"--import-map\" \"{}\" \"http://localhost:4545/cli/tests/cat.ts\"", + "\"--import-map\" \"{}\" \"http://localhost:4545/cat.ts\"", import_map_url.to_string() ); } @@ -898,7 +897,7 @@ mod tests { fn install_file_url() { let temp_dir = TempDir::new().expect("tempdir fail"); let bin_dir = temp_dir.path().join("bin"); - let module_path = fs::canonicalize(tests_path().join("cat.ts")).unwrap(); + let module_path = fs::canonicalize(testdata_path().join("cat.ts")).unwrap(); let file_module_string = Url::from_file_path(module_path).unwrap().to_string(); assert!(file_module_string.starts_with("file:///")); diff --git a/cli/tools/test_runner.rs b/cli/tools/test_runner.rs index 106555f7d9..b0cf0c8455 100644 --- a/cli/tools/test_runner.rs +++ b/cli/tools/test_runner.rs @@ -708,7 +708,7 @@ mod tests { #[test] fn test_collect_test_module_specifiers() { - let test_data_path = test_util::root_path().join("cli/tests/subdir"); + let sub_dir_path = test_util::testdata_path().join("subdir"); let mut matched_urls = collect_test_module_specifiers( vec![ "https://example.com/colors_test.ts".to_string(), @@ -717,12 +717,11 @@ mod tests { "subdir2/mod2.ts".to_string(), "http://example.com/printf_test.ts".to_string(), ], - &test_data_path, + &sub_dir_path, is_supported, ) .unwrap(); - let test_data_url = - Url::from_file_path(test_data_path).unwrap().to_string(); + let test_data_url = Url::from_file_path(sub_dir_path).unwrap().to_string(); let expected: Vec = vec![ format!("{}/mod1.ts", test_data_url), diff --git a/cli/tsc.rs b/cli/tsc.rs index b355c12faa..57bbeeca38 100644 --- a/cli/tsc.rs +++ b/cli/tsc.rs @@ -596,8 +596,6 @@ mod tests { use crate::module_graph::tests::MockSpecifierHandler; use crate::module_graph::GraphBuilder; use deno_core::parking_lot::Mutex; - use std::env; - use std::path::PathBuf; async fn setup( maybe_specifier: Option, @@ -607,8 +605,7 @@ mod tests { let specifier = maybe_specifier .unwrap_or_else(|| resolve_url_or_path("file:///main.ts").unwrap()); let hash_data = maybe_hash_data.unwrap_or_else(|| vec![b"".to_vec()]); - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let fixtures = c.join("tests/tsc2"); + let fixtures = test_util::testdata_path().join("tsc2"); let handler = Arc::new(Mutex::new(MockSpecifierHandler { fixtures, ..MockSpecifierHandler::default() @@ -633,8 +630,7 @@ mod tests { specifier: &ModuleSpecifier, ) -> Result { let hash_data = vec![b"something".to_vec()]; - let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let fixtures = c.join("tests/tsc2"); + let fixtures = test_util::testdata_path().join("tsc2"); let handler = Arc::new(Mutex::new(MockSpecifierHandler { fixtures, ..Default::default() diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 29a3878874..c87d091ad6 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -151,7 +151,7 @@ delete Object.prototype.__proto__; // TS1103: 'for-await-of' statement is only allowed within an async function // or async generator. 1103, - // TS2306: File 'file:///Users/rld/src/deno/cli/tests/subdir/amd_like.js' is + // TS2306: File 'file:///Users/rld/src/deno/cli/tests/testdata/subdir/amd_like.js' is // not a module. 2306, // TS2688: Cannot find type definition file for '...'. @@ -166,7 +166,7 @@ delete Object.prototype.__proto__; // TS5009: Cannot find the common subdirectory path for the input files. 5009, // TS5055: Cannot write file - // 'http://localhost:4545/cli/tests/subdir/mt_application_x_javascript.j4.js' + // 'http://localhost:4545/subdir/mt_application_x_javascript.j4.js' // because it would overwrite input file. 5055, // TypeScript is overly opinionated that only CommonJS modules kinds can diff --git a/runtime/worker.rs b/runtime/worker.rs index 8057e38f11..b200ef08e0 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -329,10 +329,7 @@ mod tests { #[tokio::test] async fn execute_mod_esm_imports_a() { - let p = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .parent() - .unwrap() - .join("cli/tests/esm_imports_a.js"); + let p = test_util::testdata_path().join("esm_imports_a.js"); let module_specifier = resolve_url_or_path(&p.to_string_lossy()).unwrap(); let mut worker = create_test_worker(); let result = worker.execute_module(&module_specifier).await; @@ -375,10 +372,7 @@ mod tests { // This assumes cwd is project root (an assumption made throughout the // tests). let mut worker = create_test_worker(); - let p = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .parent() - .unwrap() - .join("cli/tests/001_hello.js"); + let p = test_util::testdata_path().join("001_hello.js"); let module_specifier = resolve_url_or_path(&p.to_string_lossy()).unwrap(); let result = worker.execute_module(&module_specifier).await; assert!(result.is_ok()); diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index 93a02c98e4..d0067b15f4 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -92,6 +92,10 @@ pub fn tests_path() -> PathBuf { root_path().join("cli").join("tests") } +pub fn testdata_path() -> PathBuf { + tests_path().join("testdata") +} + pub fn third_party_path() -> PathBuf { root_path().join("third_party") } @@ -200,7 +204,7 @@ async fn inf_redirects(req: Request) -> hyper::Result> { async fn another_redirect(req: Request) -> hyper::Result> { let p = req.uri().path(); assert_eq!(&p[0..1], "/"); - let url = format!("http://localhost:{}/cli/tests/subdir{}", PORT, p); + let url = format!("http://localhost:{}/subdir{}", PORT, p); Ok(redirect_resp(url)) } @@ -265,12 +269,9 @@ async fn get_tls_config( key: &str, ca: &str, ) -> io::Result> { - let mut cert_path = root_path(); - let mut key_path = root_path(); - let mut ca_path = root_path(); - cert_path.push(cert); - key_path.push(key); - ca_path.push(ca); + let cert_path = testdata_path().join(cert); + let key_path = testdata_path().join(key); + let ca_path = testdata_path().join(ca); let cert_file = std::fs::File::open(cert_path)?; let key_file = std::fs::File::open(key_path)?; @@ -323,9 +324,9 @@ async fn get_tls_config( } async fn run_wss_server(addr: &SocketAddr) { - let cert_file = "cli/tests/tls/localhost.crt"; - let key_file = "cli/tests/tls/localhost.key"; - let ca_cert_file = "cli/tests/tls/RootCA.pem"; + let cert_file = "tls/localhost.crt"; + let key_file = "tls/localhost.key"; + let ca_cert_file = "tls/RootCA.pem"; let tls_config = get_tls_config(cert_file, key_file, ca_cert_file) .await @@ -362,13 +363,13 @@ async fn run_wss_server(addr: &SocketAddr) { /// This server responds with 'PASS' if client authentication was successful. Try it by running /// test_server and -/// curl --key cli/tests/tls/localhost.key \ -/// --cert cli/tests/tls/localhost.crt \ -/// --cacert cli/tests/tls/RootCA.crt https://localhost:4552/ +/// curl --key cli/tests/testdata/tls/localhost.key \ +/// --cert cli/tests/testsdata/tls/localhost.crt \ +/// --cacert cli/tests/testdata/tls/RootCA.crt https://localhost:4552/ async fn run_tls_client_auth_server() { - let cert_file = "cli/tests/tls/localhost.crt"; - let key_file = "cli/tests/tls/localhost.key"; - let ca_cert_file = "cli/tests/tls/RootCA.pem"; + let cert_file = "tls/localhost.crt"; + let key_file = "tls/localhost.key"; + let ca_cert_file = "tls/RootCA.pem"; let tls_config = get_tls_config(cert_file, key_file, ca_cert_file) .await .unwrap(); @@ -444,7 +445,7 @@ async fn absolute_redirect( } } - let mut file_path = root_path(); + let mut file_path = testdata_path(); file_path.push(&req.uri().path()[1..]); if file_path.is_dir() || !file_path.exists() { let mut not_found_resp = Response::new(Body::empty()); @@ -676,7 +677,7 @@ async fn main_server(req: Request) -> hyper::Result> { ); Ok(res) } - (_, "/cli/tests/subdir/xTypeScriptTypesRedirect.d.ts") => { + (_, "/subdir/xTypeScriptTypesRedirect.d.ts") => { let mut res = Response::new(Body::from( "import './xTypeScriptTypesRedirected.d.ts';", )); @@ -686,7 +687,7 @@ async fn main_server(req: Request) -> hyper::Result> { ); Ok(res) } - (_, "/cli/tests/subdir/xTypeScriptTypesRedirected.d.ts") => { + (_, "/subdir/xTypeScriptTypesRedirected.d.ts") => { let mut res = Response::new(Body::from("export const foo: 'foo';")); res.headers_mut().insert( "Content-type", @@ -702,7 +703,7 @@ async fn main_server(req: Request) -> hyper::Result> { ); Ok(res) } - (_, "/cli/tests/subdir/file_with_:_in_name.ts") => { + (_, "/subdir/file_with_:_in_name.ts") => { let mut res = Response::new(Body::from( "console.log('Hello from file_with_:_in_name.ts');", )); @@ -712,7 +713,7 @@ async fn main_server(req: Request) -> hyper::Result> { ); Ok(res) } - (_, "/cli/tests/subdir/no_js_ext@1.0.0") => { + (_, "/subdir/no_js_ext@1.0.0") => { let mut res = Response::new(Body::from( r#"import { printHello } from "./mod2.ts"; printHello(); @@ -725,8 +726,8 @@ async fn main_server(req: Request) -> hyper::Result> { Ok(res) } (_, "/.well-known/deno-import-intellisense.json") => { - let file_path = root_path() - .join("cli/tests/lsp/registries/deno-import-intellisense.json"); + let file_path = + testdata_path().join("lsp/registries/deno-import-intellisense.json"); if let Ok(body) = tokio::fs::read(file_path).await { Ok(custom_headers( "/.well-known/deno-import-intellisense.json", @@ -737,10 +738,10 @@ async fn main_server(req: Request) -> hyper::Result> { } } _ => { - let mut file_path = root_path(); + let mut file_path = testdata_path(); file_path.push(&req.uri().path()[1..]); if let Ok(file) = tokio::fs::read(file_path).await { - let file_resp = custom_headers(&req.uri().path()[1..], file); + let file_resp = custom_headers(req.uri().path(), file); return Ok(file_resp); } @@ -860,12 +861,12 @@ async fn wrap_main_server() { async fn wrap_main_https_server() { let main_server_https_addr = SocketAddr::from(([127, 0, 0, 1], HTTPS_PORT)); - let cert_file = "cli/tests/tls/localhost.crt"; - let key_file = "cli/tests/tls/localhost.key"; - let ca_cert_file = "cli/tests/tls/RootCA.pem"; + let cert_file = "tls/localhost.crt"; + let key_file = "tls/localhost.key"; + let ca_cert_file = "tls/RootCA.pem"; let tls_config = get_tls_config(cert_file, key_file, ca_cert_file) .await - .expect("Cannot get TLS config"); + .unwrap(); loop { let tcp = TcpListener::bind(&main_server_https_addr) .await @@ -957,7 +958,7 @@ pub async fn run_all_servers() { fn custom_headers(p: &str, body: Vec) -> Response { let mut response = Response::new(Body::from(body)); - if p.ends_with("cli/tests/x_deno_warning.js") { + if p.ends_with("/x_deno_warning.js") { response.headers_mut().insert( "Content-Type", HeaderValue::from_static("application/javascript"), @@ -967,7 +968,7 @@ fn custom_headers(p: &str, body: Vec) -> Response { .insert("X-Deno-Warning", HeaderValue::from_static("foobar")); return response; } - if p.ends_with("cli/tests/053_import_compression/brotli") { + if p.ends_with("/053_import_compression/brotli") { response .headers_mut() .insert("Content-Encoding", HeaderValue::from_static("br")); @@ -980,7 +981,7 @@ fn custom_headers(p: &str, body: Vec) -> Response { .insert("Content-Length", HeaderValue::from_static("26")); return response; } - if p.ends_with("cli/tests/053_import_compression/gziped") { + if p.ends_with("/053_import_compression/gziped") { response .headers_mut() .insert("Content-Encoding", HeaderValue::from_static("gzip")); @@ -994,7 +995,7 @@ fn custom_headers(p: &str, body: Vec) -> Response { return response; } - if p.contains("cli/tests/encoding/") { + if p.contains("/encoding/") { let charset = p .split_terminator('/') .last() @@ -1069,7 +1070,7 @@ impl HttpServerCount { println!("test_server starting..."); let mut test_server = Command::new(test_server_path()) - .current_dir(root_path()) + .current_dir(testdata_path()) .stdout(Stdio::piped()) .spawn() .expect("failed to execute test_server"); @@ -1251,7 +1252,7 @@ pub fn run_and_collect_output_with_args( let mut deno_process_builder = deno_cmd(); deno_process_builder .args(args) - .current_dir(&tests_path()) + .current_dir(&testdata_path()) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::piped()); @@ -1313,7 +1314,7 @@ pub fn run_powershell_script_file( command .env("DENO_DIR", deno_dir.path()) - .current_dir(root_path()) + .current_dir(testdata_path()) .arg("-file") .arg(script_file_path); @@ -1348,9 +1349,7 @@ pub struct CheckOutputIntegrationTest { impl CheckOutputIntegrationTest { pub fn run(&self) { let args = self.args.split_whitespace(); - let root = root_path(); let deno_exe = deno_exe_path(); - println!("root path {}", root.display()); println!("deno_exe path {}", deno_exe.display()); let _http_server_guard = if self.http_server { @@ -1360,12 +1359,12 @@ impl CheckOutputIntegrationTest { }; let (mut reader, writer) = pipe().unwrap(); - let tests_dir = root.join("cli").join("tests"); + let testdata_dir = testdata_path(); let mut command = deno_cmd(); println!("deno_exe args {}", self.args); - println!("deno_exe tests path {:?}", &tests_dir); + println!("deno_exe testdata path {:?}", &testdata_dir); command.args(args); - command.current_dir(&tests_dir); + command.current_dir(&testdata_dir); command.stdin(Stdio::piped()); let writer_clone = writer.try_clone().unwrap(); command.stderr(writer_clone); @@ -1420,7 +1419,7 @@ impl CheckOutputIntegrationTest { let expected = if let Some(s) = self.output_str { s.to_owned() } else { - let output_path = tests_dir.join(self.output); + let output_path = testdata_dir.join(self.output); println!("output path {}", output_path.display()); std::fs::read_to_string(output_path).expect("cannot read output") }; @@ -1492,7 +1491,7 @@ pub fn pattern_match(pattern: &str, s: &str, wildcard: &str) -> bool { pub fn test_pty(args: &str, output_path: &str, input: &[u8]) { use pty::fork::Fork; - let tests_path = tests_path(); + let tests_path = testdata_path(); let fork = Fork::from_ptmx().unwrap(); if let Ok(mut master) = fork.is_parent() { let mut output_actual = String::new(); diff --git a/tools/lint.js b/tools/lint.js index 299632d905..f5aadc77c8 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -17,19 +17,19 @@ async function dlint() { "*.js", "*.ts", ":!:.github/mtime_cache/action.js", - ":!:cli/tests/swc_syntax_error.ts", - ":!:cli/tests/038_checkjs.js", - ":!:cli/tests/error_008_checkjs.js", + ":!:cli/tests/testdata/swc_syntax_error.ts", + ":!:cli/tests/testdata/038_checkjs.js", + ":!:cli/tests/testdata/error_008_checkjs.js", ":!:std/**/testdata/*", ":!:std/**/node_modules/*", ":!:cli/bench/node*.js", ":!:cli/compilers/wasm_wrap.js", ":!:cli/dts/**", - ":!:cli/tests/encoding/**", - ":!:cli/tests/error_syntax.js", + ":!:cli/tests/testdata/encoding/**", + ":!:cli/tests/testdata/error_syntax.js", ":!:cli/tests/unit/**", - ":!:cli/tests/lint/**", - ":!:cli/tests/tsc/**", + ":!:cli/tests/testdata/lint/**", + ":!:cli/tests/testdata/tsc/**", ":!:cli/tsc/*typescript.js", ":!:test_util/wpt/**", ]);