From 1464b756a4ef091ef97d1bf7340188ab5fe5492a Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 19 Sep 2022 09:32:21 -0500 Subject: [PATCH] refactor: move out test files from root testdata directory into sub directories (#15949) --- .dprint.json | 6 +- cli/bench/main.rs | 27 +- cli/file_fetcher.rs | 10 +- cli/fs_util.rs | 12 +- cli/http_util.rs | 17 +- cli/tests/integration/bundle_tests.rs | 68 +- cli/tests/integration/cache_tests.rs | 24 +- cli/tests/integration/cert_tests.rs | 316 +++ cli/tests/integration/check_tests.rs | 108 +- cli/tests/integration/compile_tests.rs | 30 +- cli/tests/integration/doc_tests.rs | 9 +- cli/tests/integration/eval_tests.rs | 14 +- cli/tests/integration/flags_tests.rs | 45 + cli/tests/integration/fmt_tests.rs | 20 +- cli/tests/integration/info_tests.rs | 70 +- cli/tests/integration/lsp_tests.rs | 4 +- cli/tests/integration/mod.rs | 1139 +--------- cli/tests/integration/repl_tests.rs | 10 +- cli/tests/integration/run_tests.rs | 2023 +++++++++++------ cli/tests/integration/vendor_tests.rs | 1 + cli/tests/integration/watcher_tests.rs | 20 +- cli/tests/integration/worker_tests.rs | 12 +- cli/tests/testdata/003_relative_import.ts | 3 - cli/tests/testdata/014_duplicate_import.ts | 9 - cli/tests/testdata/020_json_modules.ts | 2 - cli/tests/testdata/021_mjs_modules.ts | 2 - cli/tests/testdata/023_no_ext | 2 - .../024_import_no_ext_with_headers.ts | 1 - .../024_import_no_ext_with_headers.ts.out | 1 - cli/tests/testdata/029_eval.out | 1 - cli/tests/testdata/030_eval_ts.out | 1 - cli/tests/testdata/035_cached_only_flag.out | 4 - cli/tests/testdata/044_bad_resource.ts | 3 - cli/tests/testdata/045_proxy_test.ts.out | 6 - cli/tests/testdata/052_no_remote_flag.out | 4 - .../testdata/053_import_compression/main.ts | 13 - .../testdata/072_location_relative_fetch.ts | 2 - .../testdata/084_worker_custom_inspect.ts | 4 - cli/tests/testdata/Component.tsx | 1 - .../testdata/{ => assets}/DenoWinRunner.cs | 0 .../testdata/{ => assets}/DenoWinRunner.ps1 | 0 .../{ => assets}/deno_dom_0.1.3-alpha2.wasm | Bin cli/tests/testdata/{ => assets}/fixture.json | 0 cli/tests/testdata/{ => assets}/hello.txt | 0 .../testdata/{ => assets}/unreachable.wasm | Bin .../{ => benches}/response_string_perf.js | 0 .../{ => benches}/text_decoder_perf.js | 0 .../{ => benches}/text_encoder_into_perf.js | 0 .../{ => benches}/text_encoder_perf.js | 0 .../bare_imports/error_with_bare_import.ts} | 0 .../error_with_bare_import.ts.out} | 2 +- .../testdata/{ => bundle}/bundle.test.out | 0 .../no_errors.out} | 0 .../no_errors.ts} | 0 .../type_error.out} | 2 +- .../type_error.ts} | 0 .../decorators/ts_decorators.out} | 0 .../decorators/ts_decorators.ts} | 2 +- .../dynamic_import.ts} | 0 .../ignore_directives.test.out} | 0 .../bundle/import_map/import_map.json | 5 + .../import_map/main.ts} | 0 .../{bundle_jsx.out => bundle/jsx.out} | 0 .../lockfile/check_error.json} | 0 .../lockfile/check_error.out} | 2 +- cli/tests/testdata/bundle_im.json | 5 - .../{ => cache}/036_import_map_fetch.out | 0 .../{ => cache}/037_fetch_multiple.out | 0 .../095_cache_with_bare_import.ts} | 0 .../095_cache_with_bare_import.ts.out | 0 .../{ => cache}/cache_extensionless.out | 0 .../{ => cache}/cache_random_extension.out | 0 .../testdata/{ => cache}/ignore_require.js | 0 .../{ => cache}/performance_stats.out | 0 .../testdata/{ => cache}/redirect_cache.out | 0 cli/tests/testdata/{ => cert}/cafile_info.ts | 0 .../testdata/{ => cert}/cafile_info.ts.out | 2 +- .../testdata/{ => cert}/cafile_ts_fetch.ts | 2 +- .../{ => cert}/cafile_ts_fetch.ts.out | 0 .../cafile_ts_fetch_unsafe_ssl.ts.out | 0 .../testdata/{ => cert}/cafile_url_imports.ts | 0 .../{ => cert}/cafile_url_imports.ts.out | 0 .../cafile_url_imports_unsafe_ssl.ts.out | 0 .../{ => cert}/deno_land_unsafe_ssl.ts | 0 .../{ => cert}/deno_land_unsafe_ssl.ts.out | 0 .../{ => cert}/ip_address_unsafe_ssl.ts | 0 .../{ => cert}/ip_address_unsafe_ssl.ts.out | 0 .../testdata/{ => cert}/listen_tls_alpn.ts | 0 .../{ => cert}/listen_tls_alpn_fail.ts | 2 +- .../{ => cert}/localhost_unsafe_ssl.ts.out | 0 cli/tests/testdata/{ => check}/check_all.out | 0 cli/tests/testdata/{ => check}/check_all.ts | 0 ...declaration_header_file_with_no_exports.ts | 0 ...ration_header_file_with_no_exports_js.d.ts | 0 ...laration_header_file_with_no_exports_js.js | 0 .../testdata/check/module_detection_force.ts | 3 + .../module_detection_force/import.ts} | 0 .../check/module_detection_force/main.ts | 3 + cli/tests/testdata/circular1.js | 2 - cli/tests/testdata/circular1.js.out | 2 - cli/tests/testdata/circular2.js | 2 - .../testdata/{028_args.ts => compile/args.ts} | 0 .../{ => compile}/standalone_error.ts | 0 .../standalone_error_module_with_imports_1.ts | 0 .../standalone_error_module_with_imports_2.ts | 0 .../standalone_follow_redirects.ts | 0 .../standalone_follow_redirects_2.js | 0 .../standalone_import_datauri.ts | 0 .../compile/standalone_import_map.json | 5 + .../{ => compile}/standalone_import_map.ts | 0 .../{ => compile}/standalone_runtime_flags.ts | 0 cli/tests/testdata/config.ts.out | 4 - cli/tests/testdata/config_json_import.ts | 2 - .../config_types_remote.tsconfig.json | 7 - .../testdata/disallow_http_from_https_js.out | 3 - .../testdata/disallow_http_from_https_ts.out | 3 - ..._displays_all_overloads_in_details_view.ts | 0 ...plays_all_overloads_in_details_view.ts.out | 0 cli/tests/testdata/{ => doc}/deno_doc.ts | 0 .../testdata/{ => doc}/deno_doc_builtin.out | 0 cli/tests/testdata/empty.out | 0 cli/tests/testdata/error_002.ts | 7 - .../error_010_nonexistent_arg.disabled | 4 - .../testdata/error_010_nonexistent_arg.out | 1 - .../testdata/error_026_remote_import_error.ts | 1 - .../error_026_remote_import_error.ts.out | 7 - cli/tests/testdata/error_no_check.ts | 1 - cli/tests/testdata/error_no_check.ts.out | 2 - cli/tests/testdata/error_type_definitions.ts | 5 - .../error_worker_permissions_local.ts | 4 - .../dyn_import_eval.out} | 0 cli/tests/testdata/export_type_def.ts | 2 - cli/tests/testdata/fix_emittable_skipped.js | 7 - cli/tests/testdata/fix_js_import_js.ts | 3 - cli/tests/testdata/fix_js_imports.ts | 3 - .../testdata/{ => fmt}/badly_formatted.json | 0 .../testdata/{ => fmt}/badly_formatted.md | 0 .../testdata/{ => fmt}/badly_formatted.mjs | 0 .../{ => fmt}/badly_formatted_fixed.js | 0 .../{ => fmt}/badly_formatted_fixed.json | 0 .../{ => fmt}/badly_formatted_fixed.md | 0 .../testdata/fmt/with_config/subdir/a.ts | 2 +- .../testdata/fmt/with_config/subdir/b.ts | 4 +- cli/tests/testdata/import_meta2.ts | 1 - .../testdata/{ => info}/031_info_ts_error.out | 0 .../testdata/{ => info}/031_info_ts_error.ts | 0 .../testdata/{ => info}/041_info_flag.out | 0 .../{ => info}/041_info_flag_location.out | 0 .../{ => info}/049_info_flag_script_jsx.out | 2 +- .../{ => info}/054_info_local_imports.out | 0 .../{ => info}/065_import_map_info.out | 0 .../{ => info}/076_info_json_deps_order.out | 0 .../{ => info}/076_info_json_deps_order.ts | 0 .../{ => info}/error_009_missing_js_module.js | 0 .../error_009_missing_js_module.js.out | 0 cli/tests/testdata/{ => info}/info_json.out | 0 .../{ => info}/info_json_location.out | 0 .../{ => info}/info_missing_module.out | 0 .../info_recursive_imports_test.out | 0 .../{ => info}/info_recursive_imports_test.ts | 0 .../testdata/{ => info}/info_type_import.out | 0 cli/tests/testdata/info/info_type_import.ts | 3 + .../json_output/main.out} | 10 +- cli/tests/testdata/info/json_output/main.ts | 11 + .../multiple_imports.out} | 2 +- .../{ => info}/recursive_imports/A.ts | 0 .../{ => info}/recursive_imports/B.ts | 0 .../{ => info}/recursive_imports/C.ts | 0 .../{ => info}/recursive_imports/common.ts | 0 cli/tests/testdata/info_type_import.ts | 3 - cli/tests/testdata/inline_js_source_map_2.js | 4 - .../testdata/inline_js_source_map_2.js.out | 2 - ...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 - cli/tests/testdata/issue13562.ts | 3 - cli/tests/testdata/lock_check_err.out | 3 - .../lsp/code_action_redirect_response.json | 6 +- .../{ => lsp}/x_deno_warning_redirect.js | 0 cli/tests/testdata/main_module.ts | 3 - cli/tests/testdata/main_module.ts.out | 2 - cli/tests/testdata/main_module2.ts | 1 - cli/tests/testdata/module_detection_force.ts | 3 - cli/tests/testdata/nested_error.ts.out | 4 - cli/tests/testdata/no_color.js | 1 - cli/tests/testdata/raw_mode.ts | 18 - cli/tests/testdata/{ => repl}/import_type.ts | 0 cli/tests/testdata/{ => run}/001_hello.js | 0 cli/tests/testdata/{ => run}/001_hello.js.out | 0 cli/tests/testdata/{ => run}/002_hello.ts | 0 cli/tests/testdata/{ => run}/002_hello.ts.out | 0 cli/tests/testdata/run/003_relative_import.ts | 3 + .../{ => run}/003_relative_import.ts.out | 0 .../testdata/{ => run}/004_set_timeout.ts | 0 .../testdata/{ => run}/004_set_timeout.ts.out | 0 .../testdata/{ => run}/005_more_imports.ts | 2 +- .../{ => run}/005_more_imports.ts.out | 0 .../testdata/{ => run}/006_url_imports.ts | 0 .../testdata/{ => run}/006_url_imports.ts.out | 0 cli/tests/testdata/{ => run}/012_async.ts | 0 cli/tests/testdata/{ => run}/012_async.ts.out | 0 .../testdata/{ => run}/013_dynamic_import.ts | 2 +- .../{ => run}/013_dynamic_import.ts.out | 0 .../testdata/run/014_duplicate_import.ts | 9 + .../{ => run}/014_duplicate_import.ts.out | 0 .../015_duplicate_parallel_import.js | 2 +- .../015_duplicate_parallel_import.js.out | 0 .../testdata/{ => run}/016_double_await.ts | 0 .../{ => run}/016_double_await.ts.out | 0 .../testdata/{ => run}/017_import_redirect.ts | 0 .../{ => run}/017_import_redirect.ts.out | 0 .../{ => run}/017_import_redirect_info.out | 0 .../testdata/{ => run}/018_async_catch.ts | 0 .../testdata/{ => run}/018_async_catch.ts.out | 0 .../testdata/{ => run}/019_media_types.ts | 0 .../testdata/{ => run}/019_media_types.ts.out | 0 cli/tests/testdata/run/020_json_modules.ts | 2 + .../{ => run}/020_json_modules.ts.out | 0 cli/tests/testdata/run/021_mjs_modules.ts | 2 + .../testdata/{ => run}/021_mjs_modules.ts.out | 0 cli/tests/testdata/run/023_no_ext | 2 + cli/tests/testdata/{ => run}/023_no_ext.out | 0 cli/tests/testdata/{ => run}/025_hrtime.ts | 0 .../testdata/{ => run}/025_hrtime.ts.out | 0 .../{ => run}/025_reload_js_type_error.js | 0 .../{ => run}/025_reload_js_type_error.js.out | 0 .../{ => run}/026_redirect_javascript.js | 0 .../{ => run}/026_redirect_javascript.js.out | 0 .../{ => run}/027_redirect_typescript.ts | 0 .../{ => run}/027_redirect_typescript.ts.out | 0 cli/tests/testdata/run/028_args.ts | 3 + cli/tests/testdata/{ => run}/028_args.ts.out | 0 .../testdata/{ => run}/033_import_map.out | 0 .../{ => run}/033_import_map_remote.out | 0 .../testdata/run/035_cached_only_flag.out | 4 + cli/tests/testdata/{ => run}/038_checkjs.js | 0 .../testdata/{ => run}/038_checkjs.js.out | 0 .../{ => run}/042_dyn_import_evalcontext.ts | 0 .../042_dyn_import_evalcontext.ts.out | 0 cli/tests/testdata/run/044_bad_resource.ts | 3 + .../{ => run}/044_bad_resource.ts.out | 0 cli/tests/testdata/{ => run}/045_mod.ts | 0 cli/tests/testdata/{ => run}/045_output.ts | 0 .../045_programmatic_proxy_client.ts | 2 +- .../testdata/{ => run}/045_proxy_client.ts | 2 +- .../testdata/{ => run}/045_proxy_test.ts | 14 +- cli/tests/testdata/run/045_proxy_test.ts.out | 6 + cli/tests/testdata/{ => run}/046_jsx_test.tsx | 0 .../testdata/{ => run}/046_jsx_test.tsx.out | 0 cli/tests/testdata/{ => run}/047_jsx_test.jsx | 0 .../testdata/{ => run}/047_jsx_test.jsx.out | 0 .../testdata/{ => run}/048_media_types_jsx.ts | 0 .../{ => run}/048_media_types_jsx.ts.out | 0 cli/tests/testdata/run/052_no_remote_flag.out | 4 + .../056_make_temp_file_write_perm.out | 0 .../056_make_temp_file_write_perm.ts | 0 .../{ => run}/058_tasks_microtasks_close.ts | 0 .../058_tasks_microtasks_close.ts.out | 0 .../{ => run}/059_fs_relative_path_perm.ts | 0 .../059_fs_relative_path_perm.ts.out | 0 .../{ => run}/061_permissions_request.ts | 0 .../062_permissions_request_global.ts | 0 .../{ => run}/063_permissions_revoke.ts | 0 .../{ => run}/063_permissions_revoke.ts.out | 0 .../064_permissions_revoke_global.ts | 0 .../064_permissions_revoke_global.ts.out | 0 cli/tests/testdata/{ => run}/066_prompt.ts | 0 cli/tests/testdata/{ => run}/070_location.ts | 0 .../testdata/{ => run}/070_location.ts.out | 0 .../testdata/{ => run}/071_location_unset.ts | 0 .../{ => run}/071_location_unset.ts.out | 0 .../run/072_location_relative_fetch.ts | 2 + .../072_location_relative_fetch.ts.out | 0 .../{ => run}/075_import_local_query_hash.ts | 0 .../075_import_local_query_hash.ts.out | 0 .../testdata/{ => run}/077_fetch_empty.ts | 0 .../testdata/{ => run}/077_fetch_empty.ts.out | 0 .../testdata/{ => run}/078_unload_on_exit.ts | 0 .../{ => run}/078_unload_on_exit.ts.out | 0 .../{ => run}/079_location_authentication.ts | 0 .../079_location_authentication.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 .../088_dynamic_import_already_evaluating.ts | 0 ...8_dynamic_import_already_evaluating.ts.out | 0 .../{ => run}/088_dynamic_import_target.ts | 0 .../testdata/{ => run}/089_run_allow_list.ts | 0 .../{ => run}/089_run_allow_list.ts.out | 0 .../{ => run}/090_run_permissions_request.ts | 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 .../testdata/{ => run}/aggregate_error.out | 0 .../testdata/{ => run}/aggregate_error.ts | 0 cli/tests/testdata/{ => run}/async_error.ts | 0 .../testdata/{ => run}/async_error.ts.out | 0 cli/tests/testdata/{ => run}/before_unload.js | 0 .../testdata/{ => run}/before_unload.js.out | 0 .../{ => run}/blob_gc_finalization.js | 0 .../{ => run}/blob_gc_finalization.js.out | 0 .../testdata/{ => run}/byte_order_mark.out | 0 .../testdata/{ => run}/byte_order_mark.ts | 0 .../testdata/{ => run}/checkjs.tsconfig.json | 0 .../{ => run/cjs_imports}/commonjs.cjs | 0 .../cjs_imports/main.out} | 0 .../cjs_imports/main.ts} | 0 .../{ => run}/classic_workers_event_loop.js | 0 .../classic_workers_event_loop.js.out | 0 .../{ => run}/colors_without_globalThis.js | 0 cli/tests/testdata/{ => run}/complex_error.ts | 0 .../testdata/{ => run}/complex_error.ts.out | 0 .../{ => run}/complex_permissions_test.ts | 0 cli/tests/testdata/run/config/main.out | 4 + .../{config.ts => run/config/main.ts} | 0 .../config/tsconfig.json} | 0 cli/tests/testdata/run/config_json_import.ts | 2 + .../{ => run}/config_json_import.ts.out | 0 .../config_types/main.out} | 0 .../config_types/main.ts} | 0 .../run/config_types/remote.tsconfig.json | 7 + .../config_types/tsconfig.json} | 2 +- .../{subdir => run/config_types}/types.d.ts | 0 .../testdata/{ => run}/custom_inspect_url.js | 0 .../{ => run}/custom_inspect_url.js.out | 0 cli/tests/testdata/{ => run}/delete_window.js | 0 .../testdata/{ => run}/deno_exit_tampering.ts | 0 .../{ => run}/disallow_http_from_https.js | 2 +- .../{ => run}/disallow_http_from_https.ts | 2 +- .../run/disallow_http_from_https_js.out | 3 + .../run/disallow_http_from_https_ts.out | 3 + .../{ => run}/dom_exception_formatting.ts | 0 .../{ => run}/dom_exception_formatting.ts.out | 0 .../error_001.ts | 0 .../dynamic_import_already_rejected/main.out} | 0 .../dynamic_import_already_rejected/main.ts} | 0 .../delayed_error.ts | 0 .../dynamic_import_async_error/main.out} | 0 .../dynamic_import_async_error/main.ts} | 0 .../{ => run}/dynamic_import_conditional.js | 0 .../dynamic_import_conditional.js.out | 0 cli/tests/testdata/{subdir => run}/empty.ts | 0 cli/tests/testdata/run/error_001.ts | 9 + cli/tests/testdata/{ => run}/error_001.ts.out | 0 cli/tests/testdata/run/error_002.ts | 7 + cli/tests/testdata/{ => run}/error_002.ts.out | 0 .../{ => run}/error_003_typescript.ts | 0 .../{ => run}/error_003_typescript.ts.out | 0 .../{ => run}/error_004_missing_module.ts | 0 .../{ => run}/error_004_missing_module.ts.out | 0 .../error_005_missing_dynamic_import.ts | 0 .../error_005_missing_dynamic_import.ts.out | 0 .../{ => run}/error_006_import_ext_failure.ts | 0 .../error_006_import_ext_failure.ts.out | 0 cli/tests/testdata/{ => run}/error_007_any.ts | 0 .../testdata/{ => run}/error_007_any.ts.out | 0 .../testdata/{ => run}/error_008_checkjs.js | 0 .../{ => run}/error_008_checkjs.js.out | 0 .../{ => run}/error_009_extensions_error.js | 0 .../error_009_extensions_error.js.out | 0 .../error_009_missing_js_module.disabled | 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 .../{ => run}/error_013_missing_script.out | 0 .../error_014_catch_dynamic_import_error.js | 6 +- ...rror_014_catch_dynamic_import_error.js.out | 0 .../error_015_dynamic_import_permissions.js | 0 .../error_015_dynamic_import_permissions.out | 0 .../error_016_dynamic_import_permissions2.js | 0 .../error_016_dynamic_import_permissions2.out | 0 .../error_017_hide_long_source_ts.ts | 0 .../error_017_hide_long_source_ts.ts.out | 0 .../error_018_hide_long_source_js.js | 0 .../error_018_hide_long_source_js.js.out | 0 .../{ => run}/error_019_stack_function.ts | 0 .../{ => run}/error_019_stack_function.ts.out | 0 .../{ => run}/error_020_stack_constructor.ts | 0 .../error_020_stack_constructor.ts.out | 0 .../{ => run}/error_021_stack_method.ts | 0 .../{ => run}/error_021_stack_method.ts.out | 0 .../{ => run}/error_022_stack_custom_error.ts | 0 .../error_022_stack_custom_error.ts.out | 0 .../{ => run}/error_023_stack_async.ts | 0 .../{ => run}/error_023_stack_async.ts.out | 0 .../{ => run}/error_024_stack_promise_all.ts | 0 .../error_024_stack_promise_all.ts.out | 0 .../testdata/{ => run}/error_025_tab_indent | 0 .../{ => run}/error_025_tab_indent.out | 0 .../run/error_026_remote_import_error.ts | 1 + .../run/error_026_remote_import_error.ts.out | 7 + cli/tests/testdata/{ => run}/error_cause.ts | 0 .../testdata/{ => run}/error_cause.ts.out | 0 .../{ => run}/error_cause_recursive.ts | 0 .../{ => run}/error_cause_recursive.ts.out | 0 .../testdata/{ => run}/error_for_await.ts | 0 .../testdata/{ => run}/error_for_await.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 | 0 .../{ => run}/error_name_non_string.js | 0 .../{ => run}/error_name_non_string.js.out | 0 cli/tests/testdata/run/error_no_check.ts | 1 + cli/tests/testdata/run/error_no_check.ts.out | 2 + cli/tests/testdata/{ => run}/error_syntax.js | 0 .../testdata/{ => run}/error_syntax.js.out | 0 .../error_syntax_empty_trailing_line.mjs | 0 .../error_syntax_empty_trailing_line.mjs.out | 0 .../testdata/run/error_type_definitions.ts | 5 + .../{ => run}/error_type_definitions.ts.out | 0 .../testdata/{ => run}/es_private_fields.js | 0 .../{ => run}/es_private_fields.js.out | 0 .../eval_context_throw_dom_exception.js | 0 .../eval_context_throw_dom_exception.js.out | 0 .../{ => run}/event_listener_error.ts | 0 .../{ => run}/event_listener_error.ts.out | 0 .../{ => run}/event_listener_error_handled.ts | 0 .../event_listener_error_handled.ts.out | 0 .../event_listener_error_immediate_exit.ts | 0 ...event_listener_error_immediate_exit.ts.out | 0 ...nt_listener_error_immediate_exit_worker.ts | 0 ...istener_error_immediate_exit_worker.ts.out | 0 cli/tests/testdata/{ => run}/exec_path.ts | 0 cli/tests/testdata/{ => run}/exit_error42.ts | 0 .../testdata/{ => run}/exit_error42.ts.out | 0 cli/tests/testdata/run/export_type_def.ts | 2 + cli/tests/testdata/{ => run}/fetch/hello.txt | 0 cli/tests/testdata/{ => run}/fetch/other.ts | 0 cli/tests/testdata/{ => run}/fetch/test.ts | 0 .../{ => run}/fetch_async_error_stack.ts | 0 .../{ => run}/fetch_async_error_stack.ts.out | 0 .../{ => run}/fetch_response_finalization.js | 0 .../fetch_response_finalization.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_1.js | 0 .../{ => run/ffi}/unstable_ffi_1.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_10.js | 0 .../{ => run/ffi}/unstable_ffi_10.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_11.js | 0 .../{ => run/ffi}/unstable_ffi_11.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_12.js | 0 .../{ => run/ffi}/unstable_ffi_12.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_13.js | 0 .../{ => run/ffi}/unstable_ffi_13.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_14.js | 0 .../{ => run/ffi}/unstable_ffi_14.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_15.js | 0 .../{ => run/ffi}/unstable_ffi_15.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_2.js | 0 .../{ => run/ffi}/unstable_ffi_2.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_3.js | 0 .../{ => run/ffi}/unstable_ffi_3.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_4.js | 0 .../{ => run/ffi}/unstable_ffi_4.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_5.js | 0 .../{ => run/ffi}/unstable_ffi_5.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_6.js | 0 .../{ => run/ffi}/unstable_ffi_6.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_7.js | 0 .../{ => run/ffi}/unstable_ffi_7.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_8.js | 0 .../{ => run/ffi}/unstable_ffi_8.js.out | 0 .../testdata/{ => run/ffi}/unstable_ffi_9.js | 0 .../{ => run/ffi}/unstable_ffi_9.js.out | 0 .../{ => run}/finalization_registry.js | 0 .../{ => run}/finalization_registry.js.out | 0 .../{ => run}/fix_dynamic_import_errors.js | 4 +- .../fix_dynamic_import_errors.js.out | 0 .../testdata/run/fix_emittable_skipped.js | 7 + .../{ => run}/fix_emittable_skipped.ts.out | 0 .../{ => run}/fix_exotic_specifiers.ts | 0 .../{ => run}/fix_exotic_specifiers.ts.out | 0 cli/tests/testdata/run/fix_js_import_js.ts | 3 + .../{ => run}/fix_js_import_js.ts.out | 0 cli/tests/testdata/run/fix_js_imports.ts | 3 + .../testdata/{ => run}/fix_js_imports.ts.out | 0 .../{ => run}/fix_tsc_file_exists.out | 0 .../{ => run}/fix_worker_dispatchevent.ts | 0 .../{ => run}/fix_worker_dispatchevent.ts.out | 0 .../followup_dyn_import_resolves/main.ts | 0 .../followup_dyn_import_resolves/main.ts.out | 0 .../followup_dyn_import_resolves/sub1.ts | 0 .../followup_dyn_import_resolves/sub2.ts | 0 cli/tests/testdata/{ => run}/future_check.ts | 0 .../testdata/{ => run}/future_check2.out | 0 cli/tests/testdata/{ => run}/heapstats.js | 0 cli/tests/testdata/{ => run}/heapstats.js.out | 0 .../testdata/{ => run}/http2_request_url.ts | 0 cli/tests/testdata/{ => run}/https_import.ts | 0 .../testdata/{ => run}/https_import.ts.out | 0 cli/tests/testdata/{ => run}/if_main.ts | 0 cli/tests/testdata/{ => run}/if_main.ts.out | 0 .../testdata/{ => run}/import_blob_url.ts | 0 .../testdata/{ => run}/import_blob_url.ts.out | 0 .../{ => run}/import_blob_url_error_stack.ts | 0 .../import_blob_url_error_stack.ts.out | 0 .../import_blob_url_import_relative.ts | 0 .../import_blob_url_import_relative.ts.out | 0 .../{ => run}/import_blob_url_imports.ts | 0 .../{ => run}/import_blob_url_imports.ts.out | 0 .../testdata/{ => run}/import_blob_url_jsx.ts | 0 .../{ => run}/import_blob_url_jsx.ts.out | 0 .../import_compression}/brotli | 0 .../import_compression}/gziped | Bin .../import_compression/main.out} | 0 .../testdata/run/import_compression/main.ts | 13 + .../testdata/{ => run}/import_data_url.ts | 0 .../testdata/{ => run}/import_data_url.ts.out | 0 .../{ => run}/import_data_url_error_stack.ts | 0 .../import_data_url_error_stack.ts.out | 0 .../import_data_url_import_relative.ts | 0 .../import_data_url_import_relative.ts.out | 0 .../{ => run}/import_data_url_imports.ts | 0 .../{ => run}/import_data_url_imports.ts.out | 0 .../testdata/{ => run}/import_data_url_jsx.ts | 0 .../{ => run}/import_data_url_jsx.ts.out | 0 .../{ => run}/import_dynamic_data_url.ts | 0 .../{ => run}/import_dynamic_data_url.ts.out | 0 .../{ => run}/import_extensionless.ts | 0 .../{ => run}/import_extensionless.ts.out | 0 .../{ => run}/import_file_with_colon.ts | 0 .../{ => run}/import_file_with_colon.ts.out | 0 .../import_meta/importmap.json} | 0 .../import_meta/main.out} | 4 +- .../import_meta/main.ts} | 6 +- cli/tests/testdata/run/import_meta/other.ts | 1 + cli/tests/testdata/run/import_type.ts | 5 + .../testdata/{ => run}/import_type.ts.out | 0 .../{ => run}/inline_js_source_map.ts | 0 .../testdata/run/inline_js_source_map_2.js | 4 + .../run/inline_js_source_map_2.js.out | 2 + .../{ => run}/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/run/issue13562.ts | 3 + .../testdata/{ => run}/issue13562.ts.out | 0 cli/tests/testdata/{ => run}/issue9750.js | 0 .../testdata/{ => run}/js_import_detect.ts | 0 .../{ => run}/js_import_detect.ts.out | 0 .../{ => run}/js_root_with_ts_check.js | 0 .../{ => run}/js_root_with_ts_check.js.out | 0 .../{ => run}/jsx_import_from_ts.App.jsx | 0 .../testdata/{ => run}/jsx_import_from_ts.ts | 0 .../{ => run}/jsx_import_from_ts.ts.out | 0 .../testdata/{ => run}/jsx_import_source.out | 0 .../{ => run}/jsx_import_source_dev.out | 0 .../{ => run}/jsx_import_source_error.out | 0 .../jsx_import_source_import_map.out | 0 .../jsx_import_source_import_map_dev.out | 0 .../{ => run}/jsx_import_source_no_pragma.tsx | 0 .../{ => run}/jsx_import_source_pragma.tsx | 0 .../jsx_import_source_pragma_import_map.tsx | 0 .../testdata/{ => run}/lock_check_err.json | 2 +- cli/tests/testdata/run/lock_check_err.out | 3 + .../testdata/{ => run}/lock_check_err2.json | 0 .../testdata/{ => run}/lock_check_err2.out | 2 +- .../testdata/{ => run}/lock_check_ok.json | 2 +- .../testdata/{ => run}/lock_check_ok2.json | 0 .../{ => run}/lock_dynamic_imports.json | 2 +- .../{ => run}/lock_dynamic_imports.out | 2 +- .../{ => run/lock_write_fetch}/file_exists.ts | 0 .../lock_write_fetch/main.out} | 0 .../lock_write_fetch/main.ts} | 6 +- .../{ => run}/lock_write_requires_lock.out | 0 .../{ => run}/long_data_url_formatting.ts | 0 .../{ => run}/long_data_url_formatting.ts.out | 0 cli/tests/testdata/run/main_module/main.out | 2 + cli/tests/testdata/run/main_module/main.ts | 3 + cli/tests/testdata/run/main_module/other.ts | 1 + cli/tests/testdata/{ => run}/mts_dmts_mjs.out | 0 cli/tests/testdata/{ => run}/nested_error.ts | 0 cli/tests/testdata/run/nested_error.ts.out | 4 + .../testdata/{ => run}/no_check_decorators.ts | 0 .../{ => run}/no_check_decorators.ts.out | 0 .../hello.ts} | 0 .../main.out} | 0 .../main.ts} | 2 +- .../preserve_imports.tsconfig.json | 0 .../testdata/{ => run}/no_check_remote.ts | 0 .../{ => run}/no_check_remote.ts.disabled.out | 0 .../{ => run}/no_check_remote.ts.enabled.out | 0 cli/tests/testdata/{ => run}/no_mem_cache.js | 0 .../testdata/{ => run}/no_mem_cache.js.out | 0 cli/tests/testdata/{ => run}/no_prompt.ts | 0 .../testdata/{ => run}/no_validate_asm.js | 0 .../{ => run}/node_env_var_allowlist.ts | 0 ...nv_var_allowlist_with_unstable_flag.ts.out | 0 ...var_allowlist_without_unstable_flag.ts.out | 0 .../{034_onload => run/onload}/imported.ts | 2 +- .../{034_onload.out => run/onload/main.out} | 0 .../{034_onload => run/onload}/main.ts | 2 +- .../onload}/nest_imported.ts | 2 +- .../op_exit_op_set_exit_code_in_worker.ts | 0 .../op_exit_op_set_exit_code_worker.js | 0 .../testdata/{ => run}/permission_test.ts | 2 +- .../{ => run}/private_field_presence.ts | 0 .../{ => run}/private_field_presence.ts.out | 0 cli/tests/testdata/{ => run}/proto_exploit.js | 0 .../testdata/{ => run}/proto_exploit.js.out | 0 .../{ => run}/queue_microtask_error.ts | 0 .../{ => run}/queue_microtask_error.ts.out | 0 .../queue_microtask_error_handled.ts | 0 .../queue_microtask_error_handled.ts.out | 0 .../testdata/{ => run}/reference_types.ts | 0 .../testdata/{ => run}/reference_types.ts.out | 0 .../{ => run}/reference_types_error.js | 0 .../{ => run}/reference_types_error.js.out | 0 .../{ => run}/reference_types_remote.ts | 0 .../{ => run}/reference_types_remote.ts.out | 0 cli/tests/testdata/{ => run}/replace_self.js | 0 .../testdata/{ => run}/replace_self.js.out | 0 cli/tests/testdata/{ => run}/report_error.ts | 0 .../testdata/{ => run}/report_error.ts.out | 0 .../{ => run}/report_error_end_of_program.ts | 0 .../report_error_end_of_program.ts.out | 0 .../{ => run}/report_error_handled.ts | 0 .../{ => run}/report_error_handled.ts.out | 0 cli/tests/testdata/{ => run}/resolve_dns.ts | 0 .../testdata/{ => run}/resolve_dns.ts.out | 0 .../testdata/{ => run}/resolve_dns.zone.in | 0 .../testdata/{ => run}/runtime_decorators.ts | 0 .../{ => run}/runtime_decorators.ts.out | 0 cli/tests/testdata/{ => run}/seed_random.js | 0 .../testdata/{ => run}/seed_random.js.out | 0 .../testdata/{ => run}/set_exit_code_0.ts | 0 .../testdata/{ => run}/set_exit_code_1.ts | 0 .../testdata/{ => run}/set_exit_code_2.ts | 0 .../testdata/{ => run}/set_timeout_error.ts | 0 .../{ => run}/set_timeout_error.ts.out | 0 .../{ => run}/set_timeout_error_handled.ts | 0 .../set_timeout_error_handled.ts.out | 0 cli/tests/testdata/{ => run}/shebang.ts | 0 cli/tests/testdata/{ => run}/shebang.ts.out | 0 cli/tests/testdata/{ => run}/shebang2.ts | 0 .../{ => run}/single_compile_with_reload.ts | 0 .../single_compile_with_reload.ts.out | 0 .../single_compile_with_reload_dyn.ts | 2 +- .../single_compile_with_reload_worker.ts | 0 .../{ => run}/spawn_stdout_inherit.ts | 0 .../{ => run}/spawn_stdout_inherit.ts.out | 0 .../testdata/{ => run}/swc_syntax_error.ts | 0 .../{ => run}/swc_syntax_error.ts.out | 0 .../{ => run}/test_and_bench_in_run.js | 0 cli/tests/testdata/{ => run}/tls.out | 0 .../testdata/{ => run}/tls_connecttls.js | 8 +- cli/tests/testdata/{ => run}/tls_starttls.js | 8 +- .../top_level_await/circular.js} | 0 .../top_level_await/circular.out} | 0 .../top_level_await/loop.js} | 6 +- .../top_level_await/loop.out} | 0 .../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 .../top_level_await/order.js} | 0 .../top_level_await/order.out} | 0 .../{ => run/top_level_await}/tla/a.js | 0 .../{ => run/top_level_await}/tla/b.js | 0 .../{ => run/top_level_await}/tla/c.js | 0 .../{ => run/top_level_await}/tla/d.js | 0 .../{ => run/top_level_await}/tla/order.js | 0 .../{ => run/top_level_await}/tla/parent.js | 0 .../{ => run/top_level_await}/tla2/a.js | 0 .../{ => run/top_level_await}/tla2/b.js | 0 .../{ => run/top_level_await}/tla3/b.js | 2 +- .../top_level_await}/tla3/timeout_loop.js | 0 .../top_level_await}/top_level_await.js | 2 +- .../top_level_await}/top_level_await.out | 0 .../top_level_await}/top_level_await.ts | 2 +- .../top_level_await}/top_level_for_await.js | 0 .../top_level_await}/top_level_for_await.out | 0 .../top_level_await}/top_level_for_await.ts | 0 .../top_level_await/unresolved.js} | 0 .../top_level_await/unresolved.out} | 0 cli/tests/testdata/{ => run}/ts_decorators.ts | 0 .../testdata/{ => run}/ts_decorators.ts.out | 0 .../ts_import_from_js/deps.js} | 2 +- .../testdata/run/ts_import_from_js/main.js | 3 + .../ts_import_from_js/main.out} | 0 .../testdata/{ => run}/ts_type_imports.ts | 0 .../testdata/{ => run}/ts_type_imports.ts.out | 0 .../testdata/{ => run}/ts_type_imports_foo.ts | 0 .../{ => run}/ts_type_only_import.d.ts | 0 .../testdata/{ => run}/ts_type_only_import.ts | 0 .../{ => run}/ts_type_only_import.ts.out | 0 .../testdata/run/tsx_imports/Component.tsx | 1 + .../{ => run/tsx_imports}/tsx_imports.ts | 0 .../{ => run/tsx_imports}/tsx_imports.ts.out | 0 cli/tests/testdata/run/type_definitions.ts | 12 + .../{ => run}/type_definitions.ts.out | 0 .../{ => run}/type_definitions_for_export.ts | 0 .../type_definitions_for_export.ts.out | 0 .../testdata/{ => run}/type_directives_01.ts | 0 .../{ => run}/type_directives_01.ts.out | 0 cli/tests/testdata/run/type_directives_02.ts | 3 + .../{ => run}/type_directives_02.ts.out | 0 .../testdata/run/type_directives_js_main.js | 3 + .../{ => run}/type_directives_js_main.js.out | 0 .../testdata/run/type_directives_redirect.ts | 1 + .../{ => run}/type_directives_redirect.ts.out | 0 .../{ => run}/type_headers_deno_types.ts | 4 +- .../run/type_headers_deno_types.ts.out | 5 + .../testdata/{ => run}/unbuffered_stderr.ts | 0 .../{ => run}/unbuffered_stderr.ts.out | 0 .../testdata/{ => run}/unbuffered_stdout.ts | 0 .../{ => run}/unbuffered_stdout.ts.out | 0 .../testdata/{ => run}/unhandled_rejection.ts | 0 .../testdata/run/unhandled_rejection.ts.out | 9 + .../unhandled_rejection_sync_error.ts | 0 .../run/unhandled_rejection_sync_error.ts.out | 6 + cli/tests/testdata/{ => run}/unstable.js | 0 cli/tests/testdata/{ => run}/unstable.ts | 0 .../testdata/{ => run}/unstable_disabled.out | 0 .../{ => run}/unstable_disabled_js.out | 0 .../testdata/{ => run}/unstable_enabled.out | 0 .../{ => run}/unstable_enabled_js.out | 0 .../testdata/{ => run}/unstable_worker.ts | 2 +- .../testdata/{ => run}/unstable_worker.ts.out | 0 .../unsupported_dynamic_import_scheme.out | 0 cli/tests/testdata/{ => run}/v8_flags.js | 0 cli/tests/testdata/{ => run}/v8_flags.js.out | 0 .../{ => run}/v8_flags_unrecognized.out | 0 cli/tests/testdata/{ => run}/v8_help.out | 0 cli/tests/testdata/{ => run}/wasm.ts | 0 cli/tests/testdata/{ => run}/wasm.ts.out | 0 cli/tests/testdata/{ => run}/wasm_async.js | 0 cli/tests/testdata/{ => run}/wasm_async.out | 0 cli/tests/testdata/{ => run}/wasm_shared.out | 0 cli/tests/testdata/{ => run}/wasm_shared.ts | 0 .../{ => run}/wasm_streaming_panic_test.js | 0 .../wasm_streaming_panic_test.js.out | 0 .../testdata/{ => run}/wasm_unreachable.js | 2 +- .../testdata/{ => run}/wasm_unreachable.out | 0 cli/tests/testdata/{ => run}/wasm_url.js | 2 +- cli/tests/testdata/{ => run}/wasm_url.out | 2 +- cli/tests/testdata/{ => run}/weakref.ts | 0 cli/tests/testdata/{ => run}/weakref.ts.out | 0 .../{ => run}/websocket_server_idletimeout.ts | 0 ...rver_multi_field_connection_header_test.ts | 2 +- .../testdata/{ => run}/websocket_test.ts | 4 +- .../{ => run}/websocketstream_ping_test.ts | 0 .../{ => run}/websocketstream_test.ts | 2 +- .../{ => run}/webstorage/config_a.jsonc | 0 .../{ => run}/webstorage/config_b.jsonc | 0 .../testdata/{ => run}/webstorage/fixture.ts | 0 .../testdata/{ => run}/webstorage/logger.ts | 0 .../{ => run}/webstorage/serialization.ts | 0 .../{ => run}/webstorage/serialization.ts.out | 0 .../testdata/{ => run}/webstorage/setter.ts | 0 .../worker_close_in_wasm_reactions.js | 2 +- .../worker_close_in_wasm_reactions.js.out | 0 .../testdata/{ => run}/worker_close_nested.js | 2 +- .../{ => run}/worker_close_nested.js.out | 0 .../testdata/{ => run}/worker_close_race.js | 2 +- .../{ => run}/worker_close_race.js.out | 0 .../{ => run}/worker_drop_handle_race.js | 2 +- .../{ => run}/worker_drop_handle_race.js.out | 0 .../worker_drop_handle_race_terminate.js | 0 .../worker_drop_handle_race_terminate.js.out | 0 .../{ => run}/worker_event_handler_test.js | 2 +- .../worker_event_handler_test.js.out | 0 .../{ => run}/worker_message_before_close.js | 2 +- .../worker_message_before_close.js.out | 0 .../testdata/{ => runtime}/esm_imports_a.js | 0 .../testdata/{ => runtime}/esm_imports_b.js | 0 .../testdata/standalone_dynamic_imports.ts | 15 - cli/tests/testdata/standalone_import.ts | 2 - cli/tests/testdata/standalone_import_map.json | 5 - cli/tests/testdata/std_lint.out | 3 - cli/tests/testdata/test/resource_sanitizer.ts | 2 +- cli/tests/testdata/ts_import_from_js.js | 3 - cli/tests/testdata/ts_with_generic.ts | 3 - cli/tests/testdata/type_definitions.ts | 12 - cli/tests/testdata/type_directives_02.ts | 3 - cli/tests/testdata/type_directives_js_main.js | 3 - .../testdata/type_directives_redirect.ts | 1 - .../testdata/type_headers_deno_types.ts.out | 5 - cli/tests/testdata/{ => types}/types.out | 0 cli/tests/testdata/unhandled_rejection.ts.out | 9 - .../unhandled_rejection_sync_error.ts.out | 6 - .../computepass_shader.wgsl} | 0 .../hellotriangle.out} | Bin .../hellotriangle_shader.wgsl} | 0 .../custom_inspect/main.out} | 0 .../testdata/workers/custom_inspect/main.ts | 4 + .../custom_inspect/worker.ts} | 0 .../workers/error_worker_permissions_local.ts | 4 + .../error_worker_permissions_local.ts.out | 0 .../error_worker_permissions_remote.ts | 0 .../error_worker_permissions_remote.ts.out | 0 cli/tests/unit/fetch_test.ts | 48 +- cli/tests/unit/files_test.ts | 30 +- cli/tests/unit/flock_test.ts | 2 +- cli/tests/unit/net_test.ts | 2 +- cli/tests/unit/read_dir_test.ts | 4 +- cli/tests/unit/read_file_test.ts | 20 +- cli/tests/unit/read_text_file_test.ts | 22 +- cli/tests/unit/real_path_test.ts | 8 +- cli/tests/unit/resources_test.ts | 2 +- cli/tests/unit/stat_test.ts | 2 +- cli/tests/unit/tty_test.ts | 4 +- cli/tests/unit/wasm_test.ts | 4 +- cli/tests/unit/webgpu_test.ts | 6 +- cli/tools/fmt.rs | 4 +- runtime/worker.rs | 4 +- test_util/src/lib.rs | 16 +- tools/lint.js | 2 +- 816 files changed, 2430 insertions(+), 2425 deletions(-) create mode 100644 cli/tests/integration/cert_tests.rs create mode 100644 cli/tests/integration/flags_tests.rs delete mode 100644 cli/tests/testdata/003_relative_import.ts delete mode 100644 cli/tests/testdata/014_duplicate_import.ts delete mode 100644 cli/tests/testdata/020_json_modules.ts delete mode 100644 cli/tests/testdata/021_mjs_modules.ts delete mode 100644 cli/tests/testdata/023_no_ext delete mode 100644 cli/tests/testdata/024_import_no_ext_with_headers.ts delete mode 100644 cli/tests/testdata/024_import_no_ext_with_headers.ts.out delete mode 100644 cli/tests/testdata/029_eval.out delete mode 100644 cli/tests/testdata/030_eval_ts.out delete mode 100644 cli/tests/testdata/035_cached_only_flag.out delete mode 100644 cli/tests/testdata/044_bad_resource.ts delete mode 100644 cli/tests/testdata/045_proxy_test.ts.out delete mode 100644 cli/tests/testdata/052_no_remote_flag.out delete mode 100644 cli/tests/testdata/053_import_compression/main.ts delete mode 100644 cli/tests/testdata/072_location_relative_fetch.ts delete mode 100644 cli/tests/testdata/084_worker_custom_inspect.ts delete mode 100644 cli/tests/testdata/Component.tsx rename cli/tests/testdata/{ => assets}/DenoWinRunner.cs (100%) rename cli/tests/testdata/{ => assets}/DenoWinRunner.ps1 (100%) rename cli/tests/testdata/{ => assets}/deno_dom_0.1.3-alpha2.wasm (100%) rename cli/tests/testdata/{ => assets}/fixture.json (100%) rename cli/tests/testdata/{ => assets}/hello.txt (100%) rename cli/tests/testdata/{ => assets}/unreachable.wasm (100%) rename cli/tests/testdata/{ => benches}/response_string_perf.js (100%) rename cli/tests/testdata/{ => benches}/text_decoder_perf.js (100%) rename cli/tests/testdata/{ => benches}/text_encoder_into_perf.js (100%) rename cli/tests/testdata/{ => benches}/text_encoder_perf.js (100%) rename cli/tests/testdata/{095_cache_with_bare_import.ts => bundle/bare_imports/error_with_bare_import.ts} (100%) rename cli/tests/testdata/{error_027_bundle_with_bare_import.ts.out => bundle/bare_imports/error_with_bare_import.ts.out} (50%) rename cli/tests/testdata/{ => bundle}/bundle.test.out (100%) rename cli/tests/testdata/bundle/{check_local_by_default.out => check_local_by_default/no_errors.out} (100%) rename cli/tests/testdata/bundle/{check_local_by_default.ts => check_local_by_default/no_errors.ts} (100%) rename cli/tests/testdata/bundle/{check_local_by_default2.out => check_local_by_default/type_error.out} (58%) rename cli/tests/testdata/bundle/{check_local_by_default2.ts => check_local_by_default/type_error.ts} (100%) rename cli/tests/testdata/{ts_decorators_bundle.out => bundle/decorators/ts_decorators.out} (100%) rename cli/tests/testdata/{ts_decorators_bundle.ts => bundle/decorators/ts_decorators.ts} (90%) rename cli/tests/testdata/{bundle_dynamic_import.ts => bundle/dynamic_import.ts} (100%) rename cli/tests/testdata/{bundle_ignore_directives.test.out => bundle/ignore_directives.test.out} (100%) create mode 100644 cli/tests/testdata/bundle/import_map/import_map.json rename cli/tests/testdata/{bundle_im.ts => bundle/import_map/main.ts} (100%) rename cli/tests/testdata/{bundle_jsx.out => bundle/jsx.out} (100%) rename cli/tests/testdata/{lock_check_err_with_bundle.json => bundle/lockfile/check_error.json} (100%) rename cli/tests/testdata/{lock_check_err_with_bundle.out => bundle/lockfile/check_error.out} (77%) delete mode 100644 cli/tests/testdata/bundle_im.json rename cli/tests/testdata/{ => cache}/036_import_map_fetch.out (100%) rename cli/tests/testdata/{ => cache}/037_fetch_multiple.out (100%) rename cli/tests/testdata/{error_027_bundle_with_bare_import.ts => cache/095_cache_with_bare_import.ts} (100%) rename cli/tests/testdata/{ => cache}/095_cache_with_bare_import.ts.out (100%) rename cli/tests/testdata/{ => cache}/cache_extensionless.out (100%) rename cli/tests/testdata/{ => cache}/cache_random_extension.out (100%) rename cli/tests/testdata/{ => cache}/ignore_require.js (100%) rename cli/tests/testdata/{ => cache}/performance_stats.out (100%) rename cli/tests/testdata/{ => cache}/redirect_cache.out (100%) rename cli/tests/testdata/{ => cert}/cafile_info.ts (100%) rename cli/tests/testdata/{ => cert}/cafile_info.ts.out (93%) rename cli/tests/testdata/{ => cert}/cafile_ts_fetch.ts (52%) rename cli/tests/testdata/{ => cert}/cafile_ts_fetch.ts.out (100%) rename cli/tests/testdata/{ => cert}/cafile_ts_fetch_unsafe_ssl.ts.out (100%) rename cli/tests/testdata/{ => cert}/cafile_url_imports.ts (100%) rename cli/tests/testdata/{ => cert}/cafile_url_imports.ts.out (100%) rename cli/tests/testdata/{ => cert}/cafile_url_imports_unsafe_ssl.ts.out (100%) rename cli/tests/testdata/{ => cert}/deno_land_unsafe_ssl.ts (100%) rename cli/tests/testdata/{ => cert}/deno_land_unsafe_ssl.ts.out (100%) rename cli/tests/testdata/{ => cert}/ip_address_unsafe_ssl.ts (100%) rename cli/tests/testdata/{ => cert}/ip_address_unsafe_ssl.ts.out (100%) rename cli/tests/testdata/{ => cert}/listen_tls_alpn.ts (100%) rename cli/tests/testdata/{ => cert}/listen_tls_alpn_fail.ts (84%) rename cli/tests/testdata/{ => cert}/localhost_unsafe_ssl.ts.out (100%) rename cli/tests/testdata/{ => check}/check_all.out (100%) rename cli/tests/testdata/{ => check}/check_all.ts (100%) rename cli/tests/testdata/{ => check}/declaration_header_file_with_no_exports.ts (100%) rename cli/tests/testdata/{ => check}/declaration_header_file_with_no_exports_js.d.ts (100%) rename cli/tests/testdata/{ => check}/declaration_header_file_with_no_exports_js.js (100%) create mode 100644 cli/tests/testdata/check/module_detection_force.ts rename cli/tests/testdata/{module_detection_force_import.ts => check/module_detection_force/import.ts} (100%) create mode 100644 cli/tests/testdata/check/module_detection_force/main.ts delete mode 100644 cli/tests/testdata/circular1.js delete mode 100644 cli/tests/testdata/circular1.js.out delete mode 100644 cli/tests/testdata/circular2.js rename cli/tests/testdata/{028_args.ts => compile/args.ts} (100%) rename cli/tests/testdata/{ => compile}/standalone_error.ts (100%) rename cli/tests/testdata/{ => compile}/standalone_error_module_with_imports_1.ts (100%) rename cli/tests/testdata/{ => compile}/standalone_error_module_with_imports_2.ts (100%) rename cli/tests/testdata/{ => compile}/standalone_follow_redirects.ts (100%) rename cli/tests/testdata/{ => compile}/standalone_follow_redirects_2.js (100%) rename cli/tests/testdata/{ => compile}/standalone_import_datauri.ts (100%) create mode 100644 cli/tests/testdata/compile/standalone_import_map.json rename cli/tests/testdata/{ => compile}/standalone_import_map.ts (100%) rename cli/tests/testdata/{ => compile}/standalone_runtime_flags.ts (100%) delete mode 100644 cli/tests/testdata/config.ts.out delete mode 100644 cli/tests/testdata/config_json_import.ts delete mode 100644 cli/tests/testdata/config_types_remote.tsconfig.json delete mode 100644 cli/tests/testdata/disallow_http_from_https_js.out delete mode 100644 cli/tests/testdata/disallow_http_from_https_ts.out rename cli/tests/testdata/{ => doc}/060_deno_doc_displays_all_overloads_in_details_view.ts (100%) rename cli/tests/testdata/{ => doc}/060_deno_doc_displays_all_overloads_in_details_view.ts.out (100%) rename cli/tests/testdata/{ => doc}/deno_doc.ts (100%) rename cli/tests/testdata/{ => doc}/deno_doc_builtin.out (100%) delete mode 100644 cli/tests/testdata/empty.out delete mode 100644 cli/tests/testdata/error_002.ts delete mode 100644 cli/tests/testdata/error_010_nonexistent_arg.disabled delete mode 100644 cli/tests/testdata/error_010_nonexistent_arg.out delete mode 100644 cli/tests/testdata/error_026_remote_import_error.ts delete mode 100644 cli/tests/testdata/error_026_remote_import_error.ts.out delete mode 100644 cli/tests/testdata/error_no_check.ts delete mode 100644 cli/tests/testdata/error_no_check.ts.out delete mode 100644 cli/tests/testdata/error_type_definitions.ts delete mode 100644 cli/tests/testdata/error_worker_permissions_local.ts rename cli/tests/testdata/{041_dyn_import_eval.out => eval/dyn_import_eval.out} (100%) delete mode 100644 cli/tests/testdata/export_type_def.ts delete mode 100644 cli/tests/testdata/fix_emittable_skipped.js delete mode 100644 cli/tests/testdata/fix_js_import_js.ts delete mode 100644 cli/tests/testdata/fix_js_imports.ts rename cli/tests/testdata/{ => fmt}/badly_formatted.json (100%) rename cli/tests/testdata/{ => fmt}/badly_formatted.md (100%) rename cli/tests/testdata/{ => fmt}/badly_formatted.mjs (100%) rename cli/tests/testdata/{ => fmt}/badly_formatted_fixed.js (100%) rename cli/tests/testdata/{ => fmt}/badly_formatted_fixed.json (100%) rename cli/tests/testdata/{ => fmt}/badly_formatted_fixed.md (100%) delete mode 100644 cli/tests/testdata/import_meta2.ts rename cli/tests/testdata/{ => info}/031_info_ts_error.out (100%) rename cli/tests/testdata/{ => info}/031_info_ts_error.ts (100%) rename cli/tests/testdata/{ => info}/041_info_flag.out (100%) rename cli/tests/testdata/{ => info}/041_info_flag_location.out (100%) rename cli/tests/testdata/{ => info}/049_info_flag_script_jsx.out (92%) rename cli/tests/testdata/{ => info}/054_info_local_imports.out (100%) rename cli/tests/testdata/{ => info}/065_import_map_info.out (100%) rename cli/tests/testdata/{ => info}/076_info_json_deps_order.out (100%) rename cli/tests/testdata/{ => info}/076_info_json_deps_order.ts (100%) rename cli/tests/testdata/{ => info}/error_009_missing_js_module.js (100%) rename cli/tests/testdata/{ => info}/error_009_missing_js_module.js.out (100%) rename cli/tests/testdata/{ => info}/info_json.out (100%) rename cli/tests/testdata/{ => info}/info_json_location.out (100%) rename cli/tests/testdata/{ => info}/info_missing_module.out (100%) rename cli/tests/testdata/{ => info}/info_recursive_imports_test.out (100%) rename cli/tests/testdata/{ => info}/info_recursive_imports_test.ts (100%) rename cli/tests/testdata/{ => info}/info_type_import.out (100%) create mode 100644 cli/tests/testdata/info/info_type_import.ts rename cli/tests/testdata/{055_info_file_json.out => info/json_output/main.out} (89%) create mode 100644 cli/tests/testdata/info/json_output/main.ts rename cli/tests/testdata/{022_info_flag_script.out => info/multiple_imports.out} (92%) rename cli/tests/testdata/{ => info}/recursive_imports/A.ts (100%) rename cli/tests/testdata/{ => info}/recursive_imports/B.ts (100%) rename cli/tests/testdata/{ => info}/recursive_imports/C.ts (100%) rename cli/tests/testdata/{ => info}/recursive_imports/common.ts (100%) delete mode 100644 cli/tests/testdata/info_type_import.ts delete mode 100644 cli/tests/testdata/inline_js_source_map_2.js delete mode 100644 cli/tests/testdata/inline_js_source_map_2.js.out delete mode 100644 cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js delete mode 100644 cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js.out delete mode 100644 cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js delete mode 100644 cli/tests/testdata/issue13562.ts delete mode 100644 cli/tests/testdata/lock_check_err.out rename cli/tests/testdata/{ => lsp}/x_deno_warning_redirect.js (100%) delete mode 100644 cli/tests/testdata/main_module.ts delete mode 100644 cli/tests/testdata/main_module.ts.out delete mode 100644 cli/tests/testdata/main_module2.ts delete mode 100644 cli/tests/testdata/module_detection_force.ts delete mode 100644 cli/tests/testdata/nested_error.ts.out delete mode 100644 cli/tests/testdata/no_color.js delete mode 100644 cli/tests/testdata/raw_mode.ts rename cli/tests/testdata/{ => repl}/import_type.ts (100%) rename cli/tests/testdata/{ => run}/001_hello.js (100%) rename cli/tests/testdata/{ => run}/001_hello.js.out (100%) rename cli/tests/testdata/{ => run}/002_hello.ts (100%) rename cli/tests/testdata/{ => run}/002_hello.ts.out (100%) create mode 100644 cli/tests/testdata/run/003_relative_import.ts rename cli/tests/testdata/{ => run}/003_relative_import.ts.out (100%) rename cli/tests/testdata/{ => run}/004_set_timeout.ts (100%) rename cli/tests/testdata/{ => run}/004_set_timeout.ts.out (100%) rename cli/tests/testdata/{ => run}/005_more_imports.ts (65%) rename cli/tests/testdata/{ => run}/005_more_imports.ts.out (100%) rename cli/tests/testdata/{ => run}/006_url_imports.ts (100%) rename cli/tests/testdata/{ => run}/006_url_imports.ts.out (100%) rename cli/tests/testdata/{ => run}/012_async.ts (100%) rename cli/tests/testdata/{ => run}/012_async.ts.out (100%) rename cli/tests/testdata/{ => run}/013_dynamic_import.ts (91%) rename cli/tests/testdata/{ => run}/013_dynamic_import.ts.out (100%) create mode 100644 cli/tests/testdata/run/014_duplicate_import.ts rename cli/tests/testdata/{ => run}/014_duplicate_import.ts.out (100%) rename cli/tests/testdata/{ => run}/015_duplicate_parallel_import.js (91%) rename cli/tests/testdata/{ => run}/015_duplicate_parallel_import.js.out (100%) rename cli/tests/testdata/{ => run}/016_double_await.ts (100%) rename cli/tests/testdata/{ => run}/016_double_await.ts.out (100%) rename cli/tests/testdata/{ => run}/017_import_redirect.ts (100%) rename cli/tests/testdata/{ => run}/017_import_redirect.ts.out (100%) rename cli/tests/testdata/{ => run}/017_import_redirect_info.out (100%) rename cli/tests/testdata/{ => run}/018_async_catch.ts (100%) rename cli/tests/testdata/{ => run}/018_async_catch.ts.out (100%) rename cli/tests/testdata/{ => run}/019_media_types.ts (100%) rename cli/tests/testdata/{ => run}/019_media_types.ts.out (100%) create mode 100644 cli/tests/testdata/run/020_json_modules.ts rename cli/tests/testdata/{ => run}/020_json_modules.ts.out (100%) create mode 100644 cli/tests/testdata/run/021_mjs_modules.ts rename cli/tests/testdata/{ => run}/021_mjs_modules.ts.out (100%) create mode 100644 cli/tests/testdata/run/023_no_ext rename cli/tests/testdata/{ => run}/023_no_ext.out (100%) rename cli/tests/testdata/{ => run}/025_hrtime.ts (100%) rename cli/tests/testdata/{ => run}/025_hrtime.ts.out (100%) rename cli/tests/testdata/{ => run}/025_reload_js_type_error.js (100%) rename cli/tests/testdata/{ => run}/025_reload_js_type_error.js.out (100%) rename cli/tests/testdata/{ => run}/026_redirect_javascript.js (100%) rename cli/tests/testdata/{ => run}/026_redirect_javascript.js.out (100%) rename cli/tests/testdata/{ => run}/027_redirect_typescript.ts (100%) rename cli/tests/testdata/{ => run}/027_redirect_typescript.ts.out (100%) create mode 100644 cli/tests/testdata/run/028_args.ts rename cli/tests/testdata/{ => run}/028_args.ts.out (100%) rename cli/tests/testdata/{ => run}/033_import_map.out (100%) rename cli/tests/testdata/{ => run}/033_import_map_remote.out (100%) create mode 100644 cli/tests/testdata/run/035_cached_only_flag.out rename cli/tests/testdata/{ => run}/038_checkjs.js (100%) rename cli/tests/testdata/{ => run}/038_checkjs.js.out (100%) rename cli/tests/testdata/{ => run}/042_dyn_import_evalcontext.ts (100%) rename cli/tests/testdata/{ => run}/042_dyn_import_evalcontext.ts.out (100%) create mode 100644 cli/tests/testdata/run/044_bad_resource.ts rename cli/tests/testdata/{ => run}/044_bad_resource.ts.out (100%) rename cli/tests/testdata/{ => run}/045_mod.ts (100%) rename cli/tests/testdata/{ => run}/045_output.ts (100%) rename cli/tests/testdata/{ => run}/045_programmatic_proxy_client.ts (89%) rename cli/tests/testdata/{ => run}/045_proxy_client.ts (78%) rename cli/tests/testdata/{ => run}/045_proxy_test.ts (87%) create mode 100644 cli/tests/testdata/run/045_proxy_test.ts.out rename cli/tests/testdata/{ => run}/046_jsx_test.tsx (100%) rename cli/tests/testdata/{ => run}/046_jsx_test.tsx.out (100%) rename cli/tests/testdata/{ => run}/047_jsx_test.jsx (100%) rename cli/tests/testdata/{ => run}/047_jsx_test.jsx.out (100%) rename cli/tests/testdata/{ => run}/048_media_types_jsx.ts (100%) rename cli/tests/testdata/{ => run}/048_media_types_jsx.ts.out (100%) create mode 100644 cli/tests/testdata/run/052_no_remote_flag.out rename cli/tests/testdata/{ => run}/056_make_temp_file_write_perm.out (100%) rename cli/tests/testdata/{ => run}/056_make_temp_file_write_perm.ts (100%) rename cli/tests/testdata/{ => run}/058_tasks_microtasks_close.ts (100%) rename cli/tests/testdata/{ => run}/058_tasks_microtasks_close.ts.out (100%) rename cli/tests/testdata/{ => run}/059_fs_relative_path_perm.ts (100%) rename cli/tests/testdata/{ => run}/059_fs_relative_path_perm.ts.out (100%) rename cli/tests/testdata/{ => run}/061_permissions_request.ts (100%) rename cli/tests/testdata/{ => run}/062_permissions_request_global.ts (100%) rename cli/tests/testdata/{ => run}/063_permissions_revoke.ts (100%) rename cli/tests/testdata/{ => run}/063_permissions_revoke.ts.out (100%) rename cli/tests/testdata/{ => run}/064_permissions_revoke_global.ts (100%) rename cli/tests/testdata/{ => run}/064_permissions_revoke_global.ts.out (100%) rename cli/tests/testdata/{ => run}/066_prompt.ts (100%) rename cli/tests/testdata/{ => run}/070_location.ts (100%) rename cli/tests/testdata/{ => run}/070_location.ts.out (100%) rename cli/tests/testdata/{ => run}/071_location_unset.ts (100%) rename cli/tests/testdata/{ => run}/071_location_unset.ts.out (100%) create mode 100644 cli/tests/testdata/run/072_location_relative_fetch.ts rename cli/tests/testdata/{ => run}/072_location_relative_fetch.ts.out (100%) rename cli/tests/testdata/{ => run}/075_import_local_query_hash.ts (100%) rename cli/tests/testdata/{ => run}/075_import_local_query_hash.ts.out (100%) rename cli/tests/testdata/{ => run}/077_fetch_empty.ts (100%) rename cli/tests/testdata/{ => run}/077_fetch_empty.ts.out (100%) rename cli/tests/testdata/{ => run}/078_unload_on_exit.ts (100%) rename cli/tests/testdata/{ => run}/078_unload_on_exit.ts.out (100%) rename cli/tests/testdata/{ => run}/079_location_authentication.ts (100%) rename cli/tests/testdata/{ => run}/079_location_authentication.ts.out (100%) rename cli/tests/testdata/{ => run}/081_location_relative_fetch_redirect.ts (100%) rename cli/tests/testdata/{ => run}/081_location_relative_fetch_redirect.ts.out (100%) rename cli/tests/testdata/{ => run}/082_prepare_stack_trace_throw.js (100%) rename cli/tests/testdata/{ => run}/082_prepare_stack_trace_throw.js.out (100%) rename cli/tests/testdata/{ => run}/083_legacy_external_source_map.ts (100%) rename cli/tests/testdata/{ => run}/088_dynamic_import_already_evaluating.ts (100%) rename cli/tests/testdata/{ => run}/088_dynamic_import_already_evaluating.ts.out (100%) rename cli/tests/testdata/{ => run}/088_dynamic_import_target.ts (100%) rename cli/tests/testdata/{ => run}/089_run_allow_list.ts (100%) rename cli/tests/testdata/{ => run}/089_run_allow_list.ts.out (100%) rename cli/tests/testdata/{ => run}/090_run_permissions_request.ts (100%) rename cli/tests/testdata/{ => run}/091_use_define_for_class_fields.ts (100%) rename cli/tests/testdata/{ => run}/091_use_define_for_class_fields.ts.out (100%) rename cli/tests/testdata/{ => run}/092_import_map_unmapped_bare_specifier.ts (100%) rename cli/tests/testdata/{ => run}/092_import_map_unmapped_bare_specifier.ts.out (100%) rename cli/tests/testdata/{ => run}/aggregate_error.out (100%) rename cli/tests/testdata/{ => run}/aggregate_error.ts (100%) rename cli/tests/testdata/{ => run}/async_error.ts (100%) rename cli/tests/testdata/{ => run}/async_error.ts.out (100%) rename cli/tests/testdata/{ => run}/before_unload.js (100%) rename cli/tests/testdata/{ => run}/before_unload.js.out (100%) rename cli/tests/testdata/{ => run}/blob_gc_finalization.js (100%) rename cli/tests/testdata/{ => run}/blob_gc_finalization.js.out (100%) rename cli/tests/testdata/{ => run}/byte_order_mark.out (100%) rename cli/tests/testdata/{ => run}/byte_order_mark.ts (100%) rename cli/tests/testdata/{ => run}/checkjs.tsconfig.json (100%) rename cli/tests/testdata/{ => run/cjs_imports}/commonjs.cjs (100%) rename cli/tests/testdata/{cjs_imports.ts.out => run/cjs_imports/main.out} (100%) rename cli/tests/testdata/{cjs_imports.ts => run/cjs_imports/main.ts} (100%) rename cli/tests/testdata/{ => run}/classic_workers_event_loop.js (100%) rename cli/tests/testdata/{ => run}/classic_workers_event_loop.js.out (100%) rename cli/tests/testdata/{ => run}/colors_without_globalThis.js (100%) rename cli/tests/testdata/{ => run}/complex_error.ts (100%) rename cli/tests/testdata/{ => run}/complex_error.ts.out (100%) rename cli/tests/testdata/{ => run}/complex_permissions_test.ts (100%) create mode 100644 cli/tests/testdata/run/config/main.out rename cli/tests/testdata/{config.ts => run/config/main.ts} (100%) rename cli/tests/testdata/{config.tsconfig.json => run/config/tsconfig.json} (100%) create mode 100644 cli/tests/testdata/run/config_json_import.ts rename cli/tests/testdata/{ => run}/config_json_import.ts.out (100%) rename cli/tests/testdata/{config_types.ts.out => run/config_types/main.out} (100%) rename cli/tests/testdata/{config_types.ts => run/config_types/main.ts} (100%) create mode 100644 cli/tests/testdata/run/config_types/remote.tsconfig.json rename cli/tests/testdata/{config_types.tsconfig.json => run/config_types/tsconfig.json} (65%) rename cli/tests/testdata/{subdir => run/config_types}/types.d.ts (100%) rename cli/tests/testdata/{ => run}/custom_inspect_url.js (100%) rename cli/tests/testdata/{ => run}/custom_inspect_url.js.out (100%) rename cli/tests/testdata/{ => run}/delete_window.js (100%) rename cli/tests/testdata/{ => run}/deno_exit_tampering.ts (100%) rename cli/tests/testdata/{ => run}/disallow_http_from_https.js (59%) rename cli/tests/testdata/{ => run}/disallow_http_from_https.ts (59%) create mode 100644 cli/tests/testdata/run/disallow_http_from_https_js.out create mode 100644 cli/tests/testdata/run/disallow_http_from_https_ts.out rename cli/tests/testdata/{ => run}/dom_exception_formatting.ts (100%) rename cli/tests/testdata/{ => run}/dom_exception_formatting.ts.out (100%) rename cli/tests/testdata/{ => run/dynamic_import_already_rejected}/error_001.ts (100%) rename cli/tests/testdata/{086_dynamic_import_already_rejected.ts.out => run/dynamic_import_already_rejected/main.out} (100%) rename cli/tests/testdata/{086_dynamic_import_already_rejected.ts => run/dynamic_import_already_rejected/main.ts} (100%) rename cli/tests/testdata/{ => run/dynamic_import_async_error}/delayed_error.ts (100%) rename cli/tests/testdata/{085_dynamic_import_async_error.ts.out => run/dynamic_import_async_error/main.out} (100%) rename cli/tests/testdata/{085_dynamic_import_async_error.ts => run/dynamic_import_async_error/main.ts} (100%) rename cli/tests/testdata/{ => run}/dynamic_import_conditional.js (100%) rename cli/tests/testdata/{ => run}/dynamic_import_conditional.js.out (100%) rename cli/tests/testdata/{subdir => run}/empty.ts (100%) create mode 100644 cli/tests/testdata/run/error_001.ts rename cli/tests/testdata/{ => run}/error_001.ts.out (100%) create mode 100644 cli/tests/testdata/run/error_002.ts rename cli/tests/testdata/{ => run}/error_002.ts.out (100%) rename cli/tests/testdata/{ => run}/error_003_typescript.ts (100%) rename cli/tests/testdata/{ => run}/error_003_typescript.ts.out (100%) rename cli/tests/testdata/{ => run}/error_004_missing_module.ts (100%) rename cli/tests/testdata/{ => run}/error_004_missing_module.ts.out (100%) rename cli/tests/testdata/{ => run}/error_005_missing_dynamic_import.ts (100%) rename cli/tests/testdata/{ => run}/error_005_missing_dynamic_import.ts.out (100%) rename cli/tests/testdata/{ => run}/error_006_import_ext_failure.ts (100%) rename cli/tests/testdata/{ => run}/error_006_import_ext_failure.ts.out (100%) rename cli/tests/testdata/{ => run}/error_007_any.ts (100%) rename cli/tests/testdata/{ => run}/error_007_any.ts.out (100%) rename cli/tests/testdata/{ => run}/error_008_checkjs.js (100%) rename cli/tests/testdata/{ => run}/error_008_checkjs.js.out (100%) rename cli/tests/testdata/{ => run}/error_009_extensions_error.js (100%) rename cli/tests/testdata/{ => run}/error_009_extensions_error.js.out (100%) rename cli/tests/testdata/{ => run}/error_009_missing_js_module.disabled (100%) rename cli/tests/testdata/{ => run}/error_011_bad_module_specifier.ts (100%) rename cli/tests/testdata/{ => run}/error_011_bad_module_specifier.ts.out (100%) rename cli/tests/testdata/{ => run}/error_012_bad_dynamic_import_specifier.ts (100%) rename cli/tests/testdata/{ => run}/error_012_bad_dynamic_import_specifier.ts.out (100%) rename cli/tests/testdata/{ => run}/error_013_missing_script.out (100%) rename cli/tests/testdata/{ => run}/error_014_catch_dynamic_import_error.js (79%) rename cli/tests/testdata/{ => run}/error_014_catch_dynamic_import_error.js.out (100%) rename cli/tests/testdata/{ => run}/error_015_dynamic_import_permissions.js (100%) rename cli/tests/testdata/{ => run}/error_015_dynamic_import_permissions.out (100%) rename cli/tests/testdata/{ => run}/error_016_dynamic_import_permissions2.js (100%) rename cli/tests/testdata/{ => run}/error_016_dynamic_import_permissions2.out (100%) rename cli/tests/testdata/{ => run}/error_017_hide_long_source_ts.ts (100%) rename cli/tests/testdata/{ => run}/error_017_hide_long_source_ts.ts.out (100%) rename cli/tests/testdata/{ => run}/error_018_hide_long_source_js.js (100%) rename cli/tests/testdata/{ => run}/error_018_hide_long_source_js.js.out (100%) rename cli/tests/testdata/{ => run}/error_019_stack_function.ts (100%) rename cli/tests/testdata/{ => run}/error_019_stack_function.ts.out (100%) rename cli/tests/testdata/{ => run}/error_020_stack_constructor.ts (100%) rename cli/tests/testdata/{ => run}/error_020_stack_constructor.ts.out (100%) rename cli/tests/testdata/{ => run}/error_021_stack_method.ts (100%) rename cli/tests/testdata/{ => run}/error_021_stack_method.ts.out (100%) rename cli/tests/testdata/{ => run}/error_022_stack_custom_error.ts (100%) rename cli/tests/testdata/{ => run}/error_022_stack_custom_error.ts.out (100%) rename cli/tests/testdata/{ => run}/error_023_stack_async.ts (100%) rename cli/tests/testdata/{ => run}/error_023_stack_async.ts.out (100%) rename cli/tests/testdata/{ => run}/error_024_stack_promise_all.ts (100%) rename cli/tests/testdata/{ => run}/error_024_stack_promise_all.ts.out (100%) rename cli/tests/testdata/{ => run}/error_025_tab_indent (100%) rename cli/tests/testdata/{ => run}/error_025_tab_indent.out (100%) create mode 100644 cli/tests/testdata/run/error_026_remote_import_error.ts create mode 100644 cli/tests/testdata/run/error_026_remote_import_error.ts.out rename cli/tests/testdata/{ => run}/error_cause.ts (100%) rename cli/tests/testdata/{ => run}/error_cause.ts.out (100%) rename cli/tests/testdata/{ => run}/error_cause_recursive.ts (100%) rename cli/tests/testdata/{ => run}/error_cause_recursive.ts.out (100%) rename cli/tests/testdata/{ => run}/error_for_await.ts (100%) rename cli/tests/testdata/{ => run}/error_for_await.ts.out (100%) rename cli/tests/testdata/{ => run}/error_import_map_unable_to_load.out (100%) rename cli/tests/testdata/{ => run}/error_local_static_import_from_remote.js (100%) rename cli/tests/testdata/{ => run}/error_local_static_import_from_remote.js.out (66%) rename cli/tests/testdata/{ => run}/error_local_static_import_from_remote.ts (100%) rename cli/tests/testdata/{ => run}/error_local_static_import_from_remote.ts.out (66%) rename cli/tests/testdata/{ => run}/error_missing_module_named_import.ts (100%) rename cli/tests/testdata/{ => run}/error_missing_module_named_import.ts.out (100%) rename cli/tests/testdata/{ => run}/error_name_non_string.js (100%) rename cli/tests/testdata/{ => run}/error_name_non_string.js.out (100%) create mode 100644 cli/tests/testdata/run/error_no_check.ts create mode 100644 cli/tests/testdata/run/error_no_check.ts.out rename cli/tests/testdata/{ => run}/error_syntax.js (100%) rename cli/tests/testdata/{ => run}/error_syntax.js.out (100%) rename cli/tests/testdata/{ => run}/error_syntax_empty_trailing_line.mjs (100%) rename cli/tests/testdata/{ => run}/error_syntax_empty_trailing_line.mjs.out (100%) create mode 100644 cli/tests/testdata/run/error_type_definitions.ts rename cli/tests/testdata/{ => run}/error_type_definitions.ts.out (100%) rename cli/tests/testdata/{ => run}/es_private_fields.js (100%) rename cli/tests/testdata/{ => run}/es_private_fields.js.out (100%) rename cli/tests/testdata/{ => run}/eval_context_throw_dom_exception.js (100%) rename cli/tests/testdata/{ => run}/eval_context_throw_dom_exception.js.out (100%) rename cli/tests/testdata/{ => run}/event_listener_error.ts (100%) rename cli/tests/testdata/{ => run}/event_listener_error.ts.out (100%) rename cli/tests/testdata/{ => run}/event_listener_error_handled.ts (100%) rename cli/tests/testdata/{ => run}/event_listener_error_handled.ts.out (100%) rename cli/tests/testdata/{ => run}/event_listener_error_immediate_exit.ts (100%) rename cli/tests/testdata/{ => run}/event_listener_error_immediate_exit.ts.out (100%) rename cli/tests/testdata/{ => run}/event_listener_error_immediate_exit_worker.ts (100%) rename cli/tests/testdata/{ => run}/event_listener_error_immediate_exit_worker.ts.out (100%) rename cli/tests/testdata/{ => run}/exec_path.ts (100%) rename cli/tests/testdata/{ => run}/exit_error42.ts (100%) rename cli/tests/testdata/{ => run}/exit_error42.ts.out (100%) create mode 100644 cli/tests/testdata/run/export_type_def.ts rename cli/tests/testdata/{ => run}/fetch/hello.txt (100%) rename cli/tests/testdata/{ => run}/fetch/other.ts (100%) rename cli/tests/testdata/{ => run}/fetch/test.ts (100%) rename cli/tests/testdata/{ => run}/fetch_async_error_stack.ts (100%) rename cli/tests/testdata/{ => run}/fetch_async_error_stack.ts.out (100%) rename cli/tests/testdata/{ => run}/fetch_response_finalization.js (100%) rename cli/tests/testdata/{ => run}/fetch_response_finalization.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_1.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_1.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_10.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_10.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_11.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_11.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_12.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_12.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_13.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_13.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_14.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_14.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_15.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_15.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_2.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_2.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_3.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_3.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_4.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_4.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_5.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_5.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_6.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_6.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_7.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_7.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_8.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_8.js.out (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_9.js (100%) rename cli/tests/testdata/{ => run/ffi}/unstable_ffi_9.js.out (100%) rename cli/tests/testdata/{ => run}/finalization_registry.js (100%) rename cli/tests/testdata/{ => run}/finalization_registry.js.out (100%) rename cli/tests/testdata/{ => run}/fix_dynamic_import_errors.js (52%) rename cli/tests/testdata/{ => run}/fix_dynamic_import_errors.js.out (100%) create mode 100644 cli/tests/testdata/run/fix_emittable_skipped.js rename cli/tests/testdata/{ => run}/fix_emittable_skipped.ts.out (100%) rename cli/tests/testdata/{ => run}/fix_exotic_specifiers.ts (100%) rename cli/tests/testdata/{ => run}/fix_exotic_specifiers.ts.out (100%) create mode 100644 cli/tests/testdata/run/fix_js_import_js.ts rename cli/tests/testdata/{ => run}/fix_js_import_js.ts.out (100%) create mode 100644 cli/tests/testdata/run/fix_js_imports.ts rename cli/tests/testdata/{ => run}/fix_js_imports.ts.out (100%) rename cli/tests/testdata/{ => run}/fix_tsc_file_exists.out (100%) rename cli/tests/testdata/{ => run}/fix_worker_dispatchevent.ts (100%) rename cli/tests/testdata/{ => run}/fix_worker_dispatchevent.ts.out (100%) rename cli/tests/testdata/{ => run}/followup_dyn_import_resolves/main.ts (100%) rename cli/tests/testdata/{ => run}/followup_dyn_import_resolves/main.ts.out (100%) rename cli/tests/testdata/{ => run}/followup_dyn_import_resolves/sub1.ts (100%) rename cli/tests/testdata/{ => run}/followup_dyn_import_resolves/sub2.ts (100%) rename cli/tests/testdata/{ => run}/future_check.ts (100%) rename cli/tests/testdata/{ => run}/future_check2.out (100%) rename cli/tests/testdata/{ => run}/heapstats.js (100%) rename cli/tests/testdata/{ => run}/heapstats.js.out (100%) rename cli/tests/testdata/{ => run}/http2_request_url.ts (100%) rename cli/tests/testdata/{ => run}/https_import.ts (100%) rename cli/tests/testdata/{ => run}/https_import.ts.out (100%) rename cli/tests/testdata/{ => run}/if_main.ts (100%) rename cli/tests/testdata/{ => run}/if_main.ts.out (100%) rename cli/tests/testdata/{ => run}/import_blob_url.ts (100%) rename cli/tests/testdata/{ => run}/import_blob_url.ts.out (100%) rename cli/tests/testdata/{ => run}/import_blob_url_error_stack.ts (100%) rename cli/tests/testdata/{ => run}/import_blob_url_error_stack.ts.out (100%) rename cli/tests/testdata/{ => run}/import_blob_url_import_relative.ts (100%) rename cli/tests/testdata/{ => run}/import_blob_url_import_relative.ts.out (100%) rename cli/tests/testdata/{ => run}/import_blob_url_imports.ts (100%) rename cli/tests/testdata/{ => run}/import_blob_url_imports.ts.out (100%) rename cli/tests/testdata/{ => run}/import_blob_url_jsx.ts (100%) rename cli/tests/testdata/{ => run}/import_blob_url_jsx.ts.out (100%) rename cli/tests/testdata/{053_import_compression => run/import_compression}/brotli (100%) rename cli/tests/testdata/{053_import_compression => run/import_compression}/gziped (100%) rename cli/tests/testdata/{053_import_compression.out => run/import_compression/main.out} (100%) create mode 100644 cli/tests/testdata/run/import_compression/main.ts rename cli/tests/testdata/{ => run}/import_data_url.ts (100%) rename cli/tests/testdata/{ => run}/import_data_url.ts.out (100%) rename cli/tests/testdata/{ => run}/import_data_url_error_stack.ts (100%) rename cli/tests/testdata/{ => run}/import_data_url_error_stack.ts.out (100%) rename cli/tests/testdata/{ => run}/import_data_url_import_relative.ts (100%) rename cli/tests/testdata/{ => run}/import_data_url_import_relative.ts.out (100%) rename cli/tests/testdata/{ => run}/import_data_url_imports.ts (100%) rename cli/tests/testdata/{ => run}/import_data_url_imports.ts.out (100%) rename cli/tests/testdata/{ => run}/import_data_url_jsx.ts (100%) rename cli/tests/testdata/{ => run}/import_data_url_jsx.ts.out (100%) rename cli/tests/testdata/{ => run}/import_dynamic_data_url.ts (100%) rename cli/tests/testdata/{ => run}/import_dynamic_data_url.ts.out (100%) rename cli/tests/testdata/{ => run}/import_extensionless.ts (100%) rename cli/tests/testdata/{ => run}/import_extensionless.ts.out (100%) rename cli/tests/testdata/{ => run}/import_file_with_colon.ts (100%) rename cli/tests/testdata/{ => run}/import_file_with_colon.ts.out (100%) rename cli/tests/testdata/{import_meta.importmap.json => run/import_meta/importmap.json} (100%) rename cli/tests/testdata/{import_meta.ts.out => run/import_meta/main.out} (83%) rename cli/tests/testdata/{import_meta.ts => run/import_meta/main.ts} (82%) create mode 100644 cli/tests/testdata/run/import_meta/other.ts create mode 100644 cli/tests/testdata/run/import_type.ts rename cli/tests/testdata/{ => run}/import_type.ts.out (100%) rename cli/tests/testdata/{ => run}/inline_js_source_map.ts (100%) create mode 100644 cli/tests/testdata/run/inline_js_source_map_2.js create mode 100644 cli/tests/testdata/run/inline_js_source_map_2.js.out rename cli/tests/testdata/{ => run}/inline_js_source_map_2.ts (100%) create mode 100644 cli/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js create mode 100644 cli/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js.out create mode 100644 cli/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js rename cli/tests/testdata/{ => run}/inline_js_source_map_with_contents_from_graph.js.out (59%) create mode 100644 cli/tests/testdata/run/issue13562.ts rename cli/tests/testdata/{ => run}/issue13562.ts.out (100%) rename cli/tests/testdata/{ => run}/issue9750.js (100%) rename cli/tests/testdata/{ => run}/js_import_detect.ts (100%) rename cli/tests/testdata/{ => run}/js_import_detect.ts.out (100%) rename cli/tests/testdata/{ => run}/js_root_with_ts_check.js (100%) rename cli/tests/testdata/{ => run}/js_root_with_ts_check.js.out (100%) rename cli/tests/testdata/{ => run}/jsx_import_from_ts.App.jsx (100%) rename cli/tests/testdata/{ => run}/jsx_import_from_ts.ts (100%) rename cli/tests/testdata/{ => run}/jsx_import_from_ts.ts.out (100%) rename cli/tests/testdata/{ => run}/jsx_import_source.out (100%) rename cli/tests/testdata/{ => run}/jsx_import_source_dev.out (100%) rename cli/tests/testdata/{ => run}/jsx_import_source_error.out (100%) rename cli/tests/testdata/{ => run}/jsx_import_source_import_map.out (100%) rename cli/tests/testdata/{ => run}/jsx_import_source_import_map_dev.out (100%) rename cli/tests/testdata/{ => run}/jsx_import_source_no_pragma.tsx (100%) rename cli/tests/testdata/{ => run}/jsx_import_source_pragma.tsx (100%) rename cli/tests/testdata/{ => run}/jsx_import_source_pragma_import_map.tsx (100%) rename cli/tests/testdata/{ => run}/lock_check_err.json (66%) create mode 100644 cli/tests/testdata/run/lock_check_err.out rename cli/tests/testdata/{ => run}/lock_check_err2.json (100%) rename cli/tests/testdata/{ => run}/lock_check_err2.out (81%) rename cli/tests/testdata/{ => run}/lock_check_ok.json (50%) rename cli/tests/testdata/{ => run}/lock_check_ok2.json (100%) rename cli/tests/testdata/{ => run}/lock_dynamic_imports.json (70%) rename cli/tests/testdata/{ => run}/lock_dynamic_imports.out (78%) rename cli/tests/testdata/{ => run/lock_write_fetch}/file_exists.ts (100%) rename cli/tests/testdata/{lock_write_fetch.ts.out => run/lock_write_fetch/main.out} (100%) rename cli/tests/testdata/{lock_write_fetch.ts => run/lock_write_fetch/main.ts} (90%) rename cli/tests/testdata/{ => run}/lock_write_requires_lock.out (100%) rename cli/tests/testdata/{ => run}/long_data_url_formatting.ts (100%) rename cli/tests/testdata/{ => run}/long_data_url_formatting.ts.out (100%) create mode 100644 cli/tests/testdata/run/main_module/main.out create mode 100644 cli/tests/testdata/run/main_module/main.ts create mode 100644 cli/tests/testdata/run/main_module/other.ts rename cli/tests/testdata/{ => run}/mts_dmts_mjs.out (100%) rename cli/tests/testdata/{ => run}/nested_error.ts (100%) create mode 100644 cli/tests/testdata/run/nested_error.ts.out rename cli/tests/testdata/{ => run}/no_check_decorators.ts (100%) rename cli/tests/testdata/{ => run}/no_check_decorators.ts.out (100%) rename cli/tests/testdata/{087_hello.ts => run/no_check_imports_not_used_as_values/hello.ts} (100%) rename cli/tests/testdata/{087_no_check_imports_not_used_as_values.ts.out => run/no_check_imports_not_used_as_values/main.out} (100%) rename cli/tests/testdata/{087_no_check_imports_not_used_as_values.ts => run/no_check_imports_not_used_as_values/main.ts} (55%) rename cli/tests/testdata/{ => run/no_check_imports_not_used_as_values}/preserve_imports.tsconfig.json (100%) rename cli/tests/testdata/{ => run}/no_check_remote.ts (100%) rename cli/tests/testdata/{ => run}/no_check_remote.ts.disabled.out (100%) rename cli/tests/testdata/{ => run}/no_check_remote.ts.enabled.out (100%) rename cli/tests/testdata/{ => run}/no_mem_cache.js (100%) rename cli/tests/testdata/{ => run}/no_mem_cache.js.out (100%) rename cli/tests/testdata/{ => run}/no_prompt.ts (100%) rename cli/tests/testdata/{ => run}/no_validate_asm.js (100%) rename cli/tests/testdata/{ => run}/node_env_var_allowlist.ts (100%) rename cli/tests/testdata/{ => run}/node_env_var_allowlist_with_unstable_flag.ts.out (100%) rename cli/tests/testdata/{ => run}/node_env_var_allowlist_without_unstable_flag.ts.out (100%) rename cli/tests/testdata/{034_onload => run/onload}/imported.ts (81%) rename cli/tests/testdata/{034_onload.out => run/onload/main.out} (100%) rename cli/tests/testdata/{034_onload => run/onload}/main.ts (89%) rename cli/tests/testdata/{034_onload => run/onload}/nest_imported.ts (80%) rename cli/tests/testdata/{ => run}/op_exit_op_set_exit_code_in_worker.ts (100%) rename cli/tests/testdata/{ => run}/op_exit_op_set_exit_code_worker.js (100%) rename cli/tests/testdata/{ => run}/permission_test.ts (94%) rename cli/tests/testdata/{ => run}/private_field_presence.ts (100%) rename cli/tests/testdata/{ => run}/private_field_presence.ts.out (100%) rename cli/tests/testdata/{ => run}/proto_exploit.js (100%) rename cli/tests/testdata/{ => run}/proto_exploit.js.out (100%) rename cli/tests/testdata/{ => run}/queue_microtask_error.ts (100%) rename cli/tests/testdata/{ => run}/queue_microtask_error.ts.out (100%) rename cli/tests/testdata/{ => run}/queue_microtask_error_handled.ts (100%) rename cli/tests/testdata/{ => run}/queue_microtask_error_handled.ts.out (100%) rename cli/tests/testdata/{ => run}/reference_types.ts (100%) rename cli/tests/testdata/{ => run}/reference_types.ts.out (100%) rename cli/tests/testdata/{ => run}/reference_types_error.js (100%) rename cli/tests/testdata/{ => run}/reference_types_error.js.out (100%) rename cli/tests/testdata/{ => run}/reference_types_remote.ts (100%) rename cli/tests/testdata/{ => run}/reference_types_remote.ts.out (100%) rename cli/tests/testdata/{ => run}/replace_self.js (100%) rename cli/tests/testdata/{ => run}/replace_self.js.out (100%) rename cli/tests/testdata/{ => run}/report_error.ts (100%) rename cli/tests/testdata/{ => run}/report_error.ts.out (100%) rename cli/tests/testdata/{ => run}/report_error_end_of_program.ts (100%) rename cli/tests/testdata/{ => run}/report_error_end_of_program.ts.out (100%) rename cli/tests/testdata/{ => run}/report_error_handled.ts (100%) rename cli/tests/testdata/{ => run}/report_error_handled.ts.out (100%) rename cli/tests/testdata/{ => run}/resolve_dns.ts (100%) rename cli/tests/testdata/{ => run}/resolve_dns.ts.out (100%) rename cli/tests/testdata/{ => run}/resolve_dns.zone.in (100%) rename cli/tests/testdata/{ => run}/runtime_decorators.ts (100%) rename cli/tests/testdata/{ => run}/runtime_decorators.ts.out (100%) rename cli/tests/testdata/{ => run}/seed_random.js (100%) rename cli/tests/testdata/{ => run}/seed_random.js.out (100%) rename cli/tests/testdata/{ => run}/set_exit_code_0.ts (100%) rename cli/tests/testdata/{ => run}/set_exit_code_1.ts (100%) rename cli/tests/testdata/{ => run}/set_exit_code_2.ts (100%) rename cli/tests/testdata/{ => run}/set_timeout_error.ts (100%) rename cli/tests/testdata/{ => run}/set_timeout_error.ts.out (100%) rename cli/tests/testdata/{ => run}/set_timeout_error_handled.ts (100%) rename cli/tests/testdata/{ => run}/set_timeout_error_handled.ts.out (100%) rename cli/tests/testdata/{ => run}/shebang.ts (100%) rename cli/tests/testdata/{ => run}/shebang.ts.out (100%) rename cli/tests/testdata/{ => run}/shebang2.ts (100%) rename cli/tests/testdata/{ => run}/single_compile_with_reload.ts (100%) rename cli/tests/testdata/{ => run}/single_compile_with_reload.ts.out (100%) rename cli/tests/testdata/{ => run}/single_compile_with_reload_dyn.ts (65%) rename cli/tests/testdata/{ => run}/single_compile_with_reload_worker.ts (100%) rename cli/tests/testdata/{ => run}/spawn_stdout_inherit.ts (100%) rename cli/tests/testdata/{ => run}/spawn_stdout_inherit.ts.out (100%) rename cli/tests/testdata/{ => run}/swc_syntax_error.ts (100%) rename cli/tests/testdata/{ => run}/swc_syntax_error.ts.out (100%) rename cli/tests/testdata/{ => run}/test_and_bench_in_run.js (100%) rename cli/tests/testdata/{ => run}/tls.out (100%) rename cli/tests/testdata/{ => run}/tls_connecttls.js (85%) rename cli/tests/testdata/{ => run}/tls_starttls.js (86%) rename cli/tests/testdata/{top_level_await_circular.js => run/top_level_await/circular.js} (100%) rename cli/tests/testdata/{top_level_await_circular.out => run/top_level_await/circular.out} (100%) rename cli/tests/testdata/{top_level_await_loop.js => run/top_level_await/loop.js} (64%) rename cli/tests/testdata/{top_level_await_loop.out => run/top_level_await/loop.out} (100%) rename cli/tests/testdata/{top_level_await_nested.out => run/top_level_await/nested.out} (100%) rename cli/tests/testdata/{top_level_await_nested => run/top_level_await/nested}/a.js (100%) rename cli/tests/testdata/{top_level_await_nested => run/top_level_await/nested}/b.js (100%) rename cli/tests/testdata/{top_level_await_nested => run/top_level_await/nested}/main.js (100%) rename cli/tests/testdata/{top_level_await_order.js => run/top_level_await/order.js} (100%) rename cli/tests/testdata/{top_level_await_order.out => run/top_level_await/order.out} (100%) rename cli/tests/testdata/{ => run/top_level_await}/tla/a.js (100%) rename cli/tests/testdata/{ => run/top_level_await}/tla/b.js (100%) rename cli/tests/testdata/{ => run/top_level_await}/tla/c.js (100%) rename cli/tests/testdata/{ => run/top_level_await}/tla/d.js (100%) rename cli/tests/testdata/{ => run/top_level_await}/tla/order.js (100%) rename cli/tests/testdata/{ => run/top_level_await}/tla/parent.js (100%) rename cli/tests/testdata/{ => run/top_level_await}/tla2/a.js (100%) rename cli/tests/testdata/{ => run/top_level_await}/tla2/b.js (100%) rename cli/tests/testdata/{ => run/top_level_await}/tla3/b.js (69%) rename cli/tests/testdata/{ => run/top_level_await}/tla3/timeout_loop.js (100%) rename cli/tests/testdata/{ => run/top_level_await}/top_level_await.js (56%) rename cli/tests/testdata/{ => run/top_level_await}/top_level_await.out (100%) rename cli/tests/testdata/{ => run/top_level_await}/top_level_await.ts (54%) rename cli/tests/testdata/{ => run/top_level_await}/top_level_for_await.js (100%) rename cli/tests/testdata/{ => run/top_level_await}/top_level_for_await.out (100%) rename cli/tests/testdata/{ => run/top_level_await}/top_level_for_await.ts (100%) rename cli/tests/testdata/{top_level_await_unresolved.js => run/top_level_await/unresolved.js} (100%) rename cli/tests/testdata/{top_level_await_unresolved.out => run/top_level_await/unresolved.out} (100%) rename cli/tests/testdata/{ => run}/ts_decorators.ts (100%) rename cli/tests/testdata/{ => run}/ts_decorators.ts.out (100%) rename cli/tests/testdata/{ts_import_from_js.deps.js => run/ts_import_from_js/deps.js} (67%) create mode 100644 cli/tests/testdata/run/ts_import_from_js/main.js rename cli/tests/testdata/{ts_import_from_js.js.out => run/ts_import_from_js/main.out} (100%) rename cli/tests/testdata/{ => run}/ts_type_imports.ts (100%) rename cli/tests/testdata/{ => run}/ts_type_imports.ts.out (100%) rename cli/tests/testdata/{ => run}/ts_type_imports_foo.ts (100%) rename cli/tests/testdata/{ => run}/ts_type_only_import.d.ts (100%) rename cli/tests/testdata/{ => run}/ts_type_only_import.ts (100%) rename cli/tests/testdata/{ => run}/ts_type_only_import.ts.out (100%) create mode 100644 cli/tests/testdata/run/tsx_imports/Component.tsx rename cli/tests/testdata/{ => run/tsx_imports}/tsx_imports.ts (100%) rename cli/tests/testdata/{ => run/tsx_imports}/tsx_imports.ts.out (100%) create mode 100644 cli/tests/testdata/run/type_definitions.ts rename cli/tests/testdata/{ => run}/type_definitions.ts.out (100%) rename cli/tests/testdata/{ => run}/type_definitions_for_export.ts (100%) rename cli/tests/testdata/{ => run}/type_definitions_for_export.ts.out (100%) rename cli/tests/testdata/{ => run}/type_directives_01.ts (100%) rename cli/tests/testdata/{ => run}/type_directives_01.ts.out (100%) create mode 100644 cli/tests/testdata/run/type_directives_02.ts rename cli/tests/testdata/{ => run}/type_directives_02.ts.out (100%) create mode 100644 cli/tests/testdata/run/type_directives_js_main.js rename cli/tests/testdata/{ => run}/type_directives_js_main.js.out (100%) create mode 100644 cli/tests/testdata/run/type_directives_redirect.ts rename cli/tests/testdata/{ => run}/type_directives_redirect.ts.out (100%) rename cli/tests/testdata/{ => run}/type_headers_deno_types.ts (75%) create mode 100644 cli/tests/testdata/run/type_headers_deno_types.ts.out rename cli/tests/testdata/{ => run}/unbuffered_stderr.ts (100%) rename cli/tests/testdata/{ => run}/unbuffered_stderr.ts.out (100%) rename cli/tests/testdata/{ => run}/unbuffered_stdout.ts (100%) rename cli/tests/testdata/{ => run}/unbuffered_stdout.ts.out (100%) rename cli/tests/testdata/{ => run}/unhandled_rejection.ts (100%) create mode 100644 cli/tests/testdata/run/unhandled_rejection.ts.out rename cli/tests/testdata/{ => run}/unhandled_rejection_sync_error.ts (100%) create mode 100644 cli/tests/testdata/run/unhandled_rejection_sync_error.ts.out rename cli/tests/testdata/{ => run}/unstable.js (100%) rename cli/tests/testdata/{ => run}/unstable.ts (100%) rename cli/tests/testdata/{ => run}/unstable_disabled.out (100%) rename cli/tests/testdata/{ => run}/unstable_disabled_js.out (100%) rename cli/tests/testdata/{ => run}/unstable_enabled.out (100%) rename cli/tests/testdata/{ => run}/unstable_enabled_js.out (100%) rename cli/tests/testdata/{ => run}/unstable_worker.ts (62%) rename cli/tests/testdata/{ => run}/unstable_worker.ts.out (100%) rename cli/tests/testdata/{ => run}/unsupported_dynamic_import_scheme.out (100%) rename cli/tests/testdata/{ => run}/v8_flags.js (100%) rename cli/tests/testdata/{ => run}/v8_flags.js.out (100%) rename cli/tests/testdata/{ => run}/v8_flags_unrecognized.out (100%) rename cli/tests/testdata/{ => run}/v8_help.out (100%) rename cli/tests/testdata/{ => run}/wasm.ts (100%) rename cli/tests/testdata/{ => run}/wasm.ts.out (100%) rename cli/tests/testdata/{ => run}/wasm_async.js (100%) rename cli/tests/testdata/{ => run}/wasm_async.out (100%) rename cli/tests/testdata/{ => run}/wasm_shared.out (100%) rename cli/tests/testdata/{ => run}/wasm_shared.ts (100%) rename cli/tests/testdata/{ => run}/wasm_streaming_panic_test.js (100%) rename cli/tests/testdata/{ => run}/wasm_streaming_panic_test.js.out (100%) rename cli/tests/testdata/{ => run}/wasm_unreachable.js (82%) rename cli/tests/testdata/{ => run}/wasm_unreachable.out (100%) rename cli/tests/testdata/{ => run}/wasm_url.js (81%) rename cli/tests/testdata/{ => run}/wasm_url.out (57%) rename cli/tests/testdata/{ => run}/weakref.ts (100%) rename cli/tests/testdata/{ => run}/weakref.ts.out (100%) rename cli/tests/testdata/{ => run}/websocket_server_idletimeout.ts (100%) rename cli/tests/testdata/{ => run}/websocket_server_multi_field_connection_header_test.ts (89%) rename cli/tests/testdata/{ => run}/websocket_test.ts (98%) rename cli/tests/testdata/{ => run}/websocketstream_ping_test.ts (100%) rename cli/tests/testdata/{ => run}/websocketstream_test.ts (99%) rename cli/tests/testdata/{ => run}/webstorage/config_a.jsonc (100%) rename cli/tests/testdata/{ => run}/webstorage/config_b.jsonc (100%) rename cli/tests/testdata/{ => run}/webstorage/fixture.ts (100%) rename cli/tests/testdata/{ => run}/webstorage/logger.ts (100%) rename cli/tests/testdata/{ => run}/webstorage/serialization.ts (100%) rename cli/tests/testdata/{ => run}/webstorage/serialization.ts.out (100%) rename cli/tests/testdata/{ => run}/webstorage/setter.ts (100%) rename cli/tests/testdata/{ => run}/worker_close_in_wasm_reactions.js (80%) rename cli/tests/testdata/{ => run}/worker_close_in_wasm_reactions.js.out (100%) rename cli/tests/testdata/{ => run}/worker_close_nested.js (89%) rename cli/tests/testdata/{ => run}/worker_close_nested.js.out (100%) rename cli/tests/testdata/{ => run}/worker_close_race.js (85%) rename cli/tests/testdata/{ => run}/worker_close_race.js.out (100%) rename cli/tests/testdata/{ => run}/worker_drop_handle_race.js (88%) rename cli/tests/testdata/{ => run}/worker_drop_handle_race.js.out (100%) rename cli/tests/testdata/{ => run}/worker_drop_handle_race_terminate.js (100%) rename cli/tests/testdata/{ => run}/worker_drop_handle_race_terminate.js.out (100%) rename cli/tests/testdata/{ => run}/worker_event_handler_test.js (51%) rename cli/tests/testdata/{ => run}/worker_event_handler_test.js.out (100%) rename cli/tests/testdata/{ => run}/worker_message_before_close.js (89%) rename cli/tests/testdata/{ => run}/worker_message_before_close.js.out (100%) rename cli/tests/testdata/{ => runtime}/esm_imports_a.js (100%) rename cli/tests/testdata/{ => runtime}/esm_imports_b.js (100%) delete mode 100644 cli/tests/testdata/standalone_dynamic_imports.ts delete mode 100644 cli/tests/testdata/standalone_import.ts delete mode 100644 cli/tests/testdata/standalone_import_map.json delete mode 100644 cli/tests/testdata/std_lint.out delete mode 100644 cli/tests/testdata/ts_import_from_js.js delete mode 100644 cli/tests/testdata/ts_with_generic.ts delete mode 100644 cli/tests/testdata/type_definitions.ts delete mode 100644 cli/tests/testdata/type_directives_02.ts delete mode 100644 cli/tests/testdata/type_directives_js_main.js delete mode 100644 cli/tests/testdata/type_directives_redirect.ts delete mode 100644 cli/tests/testdata/type_headers_deno_types.ts.out rename cli/tests/testdata/{ => types}/types.out (100%) delete mode 100644 cli/tests/testdata/unhandled_rejection.ts.out delete mode 100644 cli/tests/testdata/unhandled_rejection_sync_error.ts.out rename cli/tests/testdata/{webgpu_computepass_shader.wgsl => webgpu/computepass_shader.wgsl} (100%) rename cli/tests/testdata/{webgpu_hellotriangle.out => webgpu/hellotriangle.out} (100%) rename cli/tests/testdata/{webgpu_hellotriangle_shader.wgsl => webgpu/hellotriangle_shader.wgsl} (100%) rename cli/tests/testdata/{084_worker_custom_inspect.ts.out => workers/custom_inspect/main.out} (100%) create mode 100644 cli/tests/testdata/workers/custom_inspect/main.ts rename cli/tests/testdata/{084_worker_custom_inspect_worker.ts => workers/custom_inspect/worker.ts} (100%) create mode 100644 cli/tests/testdata/workers/error_worker_permissions_local.ts rename cli/tests/testdata/{ => workers}/error_worker_permissions_local.ts.out (100%) rename cli/tests/testdata/{ => workers}/error_worker_permissions_remote.ts (100%) rename cli/tests/testdata/{ => workers}/error_worker_permissions_remote.ts.out (100%) diff --git a/.dprint.json b/.dprint.json index 64ac4e4648..e98a017476 100644 --- a/.dprint.json +++ b/.dprint.json @@ -27,13 +27,13 @@ "cli/dts/lib.scripthost.d.ts", "cli/dts/lib.webworker*.d.ts", "cli/dts/typescript.d.ts", - "cli/tests/testdata/badly_formatted.json", - "cli/tests/testdata/badly_formatted.md", + "cli/tests/testdata/fmt/badly_formatted.json", + "cli/tests/testdata/fmt/badly_formatted.md", "cli/tests/testdata/byte_order_mark.ts", "cli/tests/testdata/encoding", "cli/tests/testdata/fmt/*", "cli/tests/testdata/import_assertions/json_with_shebang.json", - "cli/tests/testdata/inline_js_source_map*", + "cli/tests/testdata/run/inline_js_source_map*", "cli/tests/testdata/malformed_config/*", "cli/tests/testdata/npm/registry/", "cli/tests/testdata/test/markdown_windows.md", diff --git a/cli/bench/main.rs b/cli/bench/main.rs index 0ef520edde..c1d8ba2e4f 100644 --- a/cli/bench/main.rs +++ b/cli/bench/main.rs @@ -35,7 +35,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option)] = &[ // invalidating that cache. ( "cold_hello", - &["run", "--reload", "cli/tests/testdata/002_hello.ts"], + &["run", "--reload", "cli/tests/testdata/run/002_hello.ts"], None, ), ( @@ -43,19 +43,23 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option)] = &[ &[ "run", "--reload", - "cli/tests/testdata/003_relative_import.ts", + "cli/tests/testdata/run/003_relative_import.ts", ], None, ), - ("hello", &["run", "cli/tests/testdata/002_hello.ts"], None), + ( + "hello", + &["run", "cli/tests/testdata/run/002_hello.ts"], + None, + ), ( "relative_import", - &["run", "cli/tests/testdata/003_relative_import.ts"], + &["run", "cli/tests/testdata/run/003_relative_import.ts"], None, ), ( "error_001", - &["run", "cli/tests/testdata/error_001.ts"], + &["run", "cli/tests/testdata/run/error_001.ts"], Some(1), ), ( @@ -64,7 +68,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option)] = &[ "run", "--reload", "--no-check", - "cli/tests/testdata/002_hello.ts", + "cli/tests/testdata/run/002_hello.ts", ], None, ), @@ -97,22 +101,25 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option)] = &[ ), ( "text_decoder", - &["run", "cli/tests/testdata/text_decoder_perf.js"], + &["run", "cli/tests/testdata/benches/text_decoder_perf.js"], None, ), ( "text_encoder", - &["run", "cli/tests/testdata/text_encoder_perf.js"], + &["run", "cli/tests/testdata/benches/text_encoder_perf.js"], None, ), ( "text_encoder_into", - &["run", "cli/tests/testdata/text_encoder_into_perf.js"], + &[ + "run", + "cli/tests/testdata/benches/text_encoder_into_perf.js", + ], None, ), ( "response_string", - &["run", "cli/tests/testdata/response_string_perf.js"], + &["run", "cli/tests/testdata/benches/response_string_perf.js"], None, ), ( diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs index 044707cff3..3e3776f245 100644 --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -1551,7 +1551,8 @@ mod tests { None, ) .unwrap(); - let specifier = resolve_url("http://localhost:4545/002_hello.ts").unwrap(); + let specifier = + resolve_url("http://localhost:4545/run/002_hello.ts").unwrap(); let result = file_fetcher .fetch(&specifier, &mut Permissions::allow_all()) @@ -1559,7 +1560,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/002_hello.ts\", but --no-remote is specified."); + assert_eq!(err.to_string(), "A remote specifier was requested: \"http://localhost:4545/run/002_hello.ts\", but --no-remote is specified."); } #[tokio::test] @@ -1587,7 +1588,8 @@ mod tests { None, ) .unwrap(); - let specifier = resolve_url("http://localhost:4545/002_hello.ts").unwrap(); + let specifier = + resolve_url("http://localhost:4545/run/002_hello.ts").unwrap(); let result = file_fetcher_01 .fetch(&specifier, &mut Permissions::allow_all()) @@ -1595,7 +1597,7 @@ mod tests { assert!(result.is_err()); let err = result.unwrap_err(); assert_eq!(get_custom_error_class(&err), Some("NotCached")); - assert_eq!(err.to_string(), "Specifier not found in cache: \"http://localhost:4545/002_hello.ts\", --cached-only is specified."); + assert_eq!(err.to_string(), "Specifier not found in cache: \"http://localhost:4545/run/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 69d4f7248d..f3a4addc03 100644 --- a/cli/fs_util.rs +++ b/cli/fs_util.rs @@ -542,8 +542,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("testdata/001_hello.js"))); - assert!(is_supported_ext(Path::new("testdata/002_hello.ts"))); + assert!(is_supported_ext(Path::new("testdata/run/001_hello.js"))); + assert!(is_supported_ext(Path::new("testdata/run/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"))); @@ -563,8 +563,12 @@ mod tests { assert!(is_supported_test_ext(Path::new("README.md"))); assert!(is_supported_test_ext(Path::new("readme.MD"))); assert!(is_supported_test_ext(Path::new("lib/typescript.d.ts"))); - assert!(is_supported_test_ext(Path::new("testdata/001_hello.js"))); - assert!(is_supported_test_ext(Path::new("testdata/002_hello.ts"))); + assert!(is_supported_test_ext(Path::new( + "testdata/run/001_hello.js" + ))); + assert!(is_supported_test_ext(Path::new( + "testdata/run/002_hello.ts" + ))); assert!(is_supported_test_ext(Path::new("foo.jsx"))); assert!(is_supported_test_ext(Path::new("foo.tsx"))); assert!(is_supported_test_ext(Path::new("foo.TS"))); diff --git a/cli/http_util.rs b/cli/http_util.rs index 122b71a596..54d641befa 100644 --- a/cli/http_util.rs +++ b/cli/http_util.rs @@ -324,7 +324,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/fixture.json").unwrap(); + let url = Url::parse("http://127.0.0.1:4545/assets/fixture.json").unwrap(); let client = create_test_client(); let result = fetch_once(FetchOnceArgs { client, @@ -348,7 +348,7 @@ 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/053_import_compression/gziped") + let url = Url::parse("http://127.0.0.1:4545/run/import_compression/gziped") .unwrap(); let client = create_test_client(); let result = fetch_once(FetchOnceArgs { @@ -412,7 +412,7 @@ 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/053_import_compression/brotli") + let url = Url::parse("http://127.0.0.1:4545/run/import_compression/brotli") .unwrap(); let client = create_test_client(); let result = fetch_once(FetchOnceArgs { @@ -462,9 +462,10 @@ 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/fixture.json").unwrap(); + let url = Url::parse("http://127.0.0.1:4546/assets/fixture.json").unwrap(); // Dns resolver substitutes `127.0.0.1` with `localhost` - let target_url = Url::parse("http://localhost:4545/fixture.json").unwrap(); + let target_url = + Url::parse("http://localhost:4545/assets/fixture.json").unwrap(); let client = create_test_client(); let result = fetch_once(FetchOnceArgs { client, @@ -523,7 +524,7 @@ 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/fixture.json").unwrap(); + let url = Url::parse("https://localhost:5545/assets/fixture.json").unwrap(); let client = create_http_client( version::get_user_agent(), @@ -630,7 +631,7 @@ mod tests { 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/053_import_compression/gziped") + Url::parse("https://localhost:5545/run/import_compression/gziped") .unwrap(); let client = create_http_client( version::get_user_agent(), @@ -724,7 +725,7 @@ mod tests { 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/053_import_compression/brotli") + Url::parse("https://localhost:5545/run/import_compression/brotli") .unwrap(); let client = create_http_client( version::get_user_agent(), diff --git a/cli/tests/integration/bundle_tests.rs b/cli/tests/integration/bundle_tests.rs index a2e5290007..ff5a51e981 100644 --- a/cli/tests/integration/bundle_tests.rs +++ b/cli/tests/integration/bundle_tests.rs @@ -231,27 +231,27 @@ fn bundle_js() { #[test] fn bundle_dynamic_import() { let _g = util::http_server(); - let dynamic_import = util::testdata_path().join("bundle_dynamic_import.ts"); + let dynamic_import = util::testdata_path().join("bundle/dynamic_import.ts"); assert!(dynamic_import.is_file()); let t = TempDir::new(); - let bundle = t.path().join("bundle_dynamic_import.bundle.js"); + let output_path = t.path().join("bundle_dynamic_import.bundle.js"); let mut deno = util::deno_cmd() .current_dir(util::testdata_path()) .arg("bundle") .arg(dynamic_import) - .arg(&bundle) + .arg(&output_path) .spawn() .unwrap(); let status = deno.wait().unwrap(); assert!(status.success()); - assert!(bundle.is_file()); + assert!(output_path.is_file()); let output = util::deno_cmd() .current_dir(util::testdata_path()) .arg("run") .arg("--allow-net") .arg("--quiet") - .arg(&bundle) + .arg(&output_path) .output() .unwrap(); // check the output of the test.ts program. @@ -264,23 +264,24 @@ fn bundle_dynamic_import() { #[test] fn bundle_import_map() { - let import = util::testdata_path().join("bundle_im.ts"); - let import_map_path = util::testdata_path().join("bundle_im.json"); + let import = util::testdata_path().join("bundle/import_map/main.ts"); + let import_map_path = + util::testdata_path().join("bundle/import_map/import_map.json"); assert!(import.is_file()); let t = TempDir::new(); - let bundle = t.path().join("import_map.bundle.js"); + let output_path = t.path().join("import_map.bundle.js"); let mut deno = util::deno_cmd() .current_dir(util::testdata_path()) .arg("bundle") .arg("--import-map") .arg(import_map_path) .arg(import) - .arg(&bundle) + .arg(&output_path) .spawn() .unwrap(); let status = deno.wait().unwrap(); assert!(status.success()); - assert!(bundle.is_file()); + assert!(output_path.is_file()); // Now we try to use that bundle from another module. let test = t.path().join("test.js"); @@ -309,23 +310,24 @@ fn bundle_import_map() { #[test] fn bundle_import_map_no_check() { - let import = util::testdata_path().join("bundle_im.ts"); - let import_map_path = util::testdata_path().join("bundle_im.json"); + let import = util::testdata_path().join("bundle/import_map/main.ts"); + let import_map_path = + util::testdata_path().join("bundle/import_map/import_map.json"); assert!(import.is_file()); let t = TempDir::new(); - let bundle = t.path().join("import_map.bundle.js"); + let output_path = t.path().join("import_map.bundle.js"); let mut deno = util::deno_cmd() .current_dir(util::testdata_path()) .arg("bundle") .arg("--import-map") .arg(import_map_path) .arg(import) - .arg(&bundle) + .arg(&output_path) .spawn() .unwrap(); let status = deno.wait().unwrap(); assert!(status.success()); - assert!(bundle.is_file()); + assert!(output_path.is_file()); // Now we try to use that bundle from another module. let test = t.path().join("test.js"); @@ -414,32 +416,32 @@ fn bundle_json_module_escape_sub() { ); } -itest!(lock_check_err_with_bundle { - 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", +itest!(lockfile_check_error { + args: "bundle --lock=bundle/lockfile/check_error.json http://127.0.0.1:4545/subdir/mod1.ts", + output: "bundle/lockfile/check_error.out", exit_code: 10, http_server: true, }); itest!(bundle { args: "bundle subdir/mod1.ts", - output: "bundle.test.out", + output: "bundle/bundle.test.out", }); itest!(bundle_jsx { - args: "bundle jsx_import_from_ts.ts", - output: "bundle_jsx.out", + args: "bundle run/jsx_import_from_ts.ts", + output: "bundle/jsx.out", }); -itest!(error_027_bundle_with_bare_import { - args: "bundle error_027_bundle_with_bare_import.ts", - output: "error_027_bundle_with_bare_import.ts.out", +itest!(error_bundle_with_bare_import { + args: "bundle bundle/bare_imports/error_with_bare_import.ts", + output: "bundle/bare_imports/error_with_bare_import.ts.out", exit_code: 1, }); itest!(ts_decorators_bundle { - args: "bundle ts_decorators_bundle.ts", - output: "ts_decorators_bundle.out", + args: "bundle bundle/decorators/ts_decorators.ts", + output: "bundle/decorators/ts_decorators.out", }); itest!(bundle_export_specifier_with_alias { @@ -449,18 +451,18 @@ itest!(bundle_export_specifier_with_alias { itest!(bundle_ignore_directives { args: "bundle subdir/mod1.ts", - output: "bundle_ignore_directives.test.out", + output: "bundle/ignore_directives.test.out", }); -itest!(check_local_by_default { - args: "bundle --quiet bundle/check_local_by_default.ts", - output: "bundle/check_local_by_default.out", +itest!(check_local_by_default_no_errors { + args: "bundle --quiet bundle/check_local_by_default/no_errors.ts", + output: "bundle/check_local_by_default/no_errors.out", http_server: true, }); -itest!(check_local_by_default2 { - args: "bundle --quiet bundle/check_local_by_default2.ts", - output: "bundle/check_local_by_default2.out", +itest!(check_local_by_default_type_error { + args: "bundle --quiet bundle/check_local_by_default/type_error.ts", + output: "bundle/check_local_by_default/type_error.out", http_server: true, exit_code: 1, }); diff --git a/cli/tests/integration/cache_tests.rs b/cli/tests/integration/cache_tests.rs index 54aea81069..3fca335a97 100644 --- a/cli/tests/integration/cache_tests.rs +++ b/cli/tests/integration/cache_tests.rs @@ -5,48 +5,48 @@ use crate::itest; itest!(_036_import_map_fetch { args: "cache --quiet --reload --import-map=import_maps/import_map.json import_maps/test.ts", - output: "036_import_map_fetch.out", + output: "cache/036_import_map_fetch.out", }); itest!(_037_fetch_multiple { - args: "cache --reload --check=all fetch/test.ts fetch/other.ts", + args: "cache --reload --check=all run/fetch/test.ts run/fetch/other.ts", http_server: true, - output: "037_fetch_multiple.out", + output: "cache/037_fetch_multiple.out", }); itest!(_095_cache_with_bare_import { - args: "cache 095_cache_with_bare_import.ts", - output: "095_cache_with_bare_import.ts.out", + args: "cache cache/095_cache_with_bare_import.ts", + output: "cache/095_cache_with_bare_import.ts.out", exit_code: 1, }); itest!(cache_extensionless { args: "cache --reload --check=all http://localhost:4545/subdir/no_js_ext", - output: "cache_extensionless.out", + output: "cache/cache_extensionless.out", http_server: true, }); itest!(cache_random_extension { args: "cache --reload --check=all http://localhost:4545/subdir/no_js_ext@1.0.0", - output: "cache_random_extension.out", + output: "cache/cache_random_extension.out", http_server: true, }); itest!(performance_stats { - args: "cache --reload --check=all --log-level debug 002_hello.ts", - output: "performance_stats.out", + args: "cache --reload --check=all --log-level debug run/002_hello.ts", + output: "cache/performance_stats.out", }); itest!(redirect_cache { http_server: true, args: "cache --reload --check=all http://localhost:4548/subdir/redirects/a.ts", - output: "redirect_cache.out", + output: "cache/redirect_cache.out", }); itest!(ignore_require { - args: "cache --reload --no-check ignore_require.js", + args: "cache --reload --no-check cache/ignore_require.js", output_str: Some(""), exit_code: 0, }); @@ -71,7 +71,7 @@ fn relative_home_dir() { .arg("cache") .arg("--reload") .arg("--no-check") - .arg("002_hello.ts") + .arg("run/002_hello.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() diff --git a/cli/tests/integration/cert_tests.rs b/cli/tests/integration/cert_tests.rs new file mode 100644 index 0000000000..fd19c1cc18 --- /dev/null +++ b/cli/tests/integration/cert_tests.rs @@ -0,0 +1,316 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +use crate::itest; +use deno_runtime::deno_net::ops_tls::TlsStream; +use deno_runtime::deno_tls::rustls; +use deno_runtime::deno_tls::rustls_pemfile; +use std::io::BufReader; +use std::io::Cursor; +use std::io::Read; +use std::process::Command; +use std::sync::Arc; +use test_util as util; +use test_util::TempDir; +use tokio::task::LocalSet; + +itest_flaky!(cafile_url_imports { + args: "run --quiet --reload --cert tls/RootCA.pem cert/cafile_url_imports.ts", + output: "cert/cafile_url_imports.ts.out", + http_server: true, +}); + +itest_flaky!(cafile_ts_fetch { + args: + "run --quiet --reload --allow-net --cert tls/RootCA.pem cert/cafile_ts_fetch.ts", + output: "cert/cafile_ts_fetch.ts.out", + http_server: true, +}); + +itest_flaky!(cafile_eval { + args: "eval --cert tls/RootCA.pem fetch('https://localhost:5545/cert/cafile_ts_fetch.ts.out').then(r=>r.text()).then(t=>console.log(t.trimEnd()))", + output: "cert/cafile_ts_fetch.ts.out", + http_server: true, +}); + +itest_flaky!(cafile_info { + args: + "info --quiet --cert tls/RootCA.pem https://localhost:5545/cert/cafile_info.ts", + output: "cert/cafile_info.ts.out", + http_server: true, +}); + +itest_flaky!(cafile_url_imports_unsafe_ssl { + args: "run --quiet --reload --unsafely-ignore-certificate-errors=localhost cert/cafile_url_imports.ts", + output: "cert/cafile_url_imports_unsafe_ssl.ts.out", + http_server: true, +}); + +itest_flaky!(cafile_ts_fetch_unsafe_ssl { + args: + "run --quiet --reload --allow-net --unsafely-ignore-certificate-errors cert/cafile_ts_fetch.ts", + output: "cert/cafile_ts_fetch_unsafe_ssl.ts.out", + http_server: true, +}); + +itest!(deno_land_unsafe_ssl { + args: + "run --quiet --reload --allow-net --unsafely-ignore-certificate-errors=deno.land cert/deno_land_unsafe_ssl.ts", + output: "cert/deno_land_unsafe_ssl.ts.out", +}); + +itest!(ip_address_unsafe_ssl { + args: + "run --quiet --reload --allow-net --unsafely-ignore-certificate-errors=1.1.1.1 cert/ip_address_unsafe_ssl.ts", + output: "cert/ip_address_unsafe_ssl.ts.out", +}); + +itest!(localhost_unsafe_ssl { + args: + "run --quiet --reload --allow-net --unsafely-ignore-certificate-errors=deno.land cert/cafile_url_imports.ts", + output: "cert/localhost_unsafe_ssl.ts.out", + http_server: true, + exit_code: 1, +}); + +#[flaky_test::flaky_test] +fn cafile_env_fetch() { + use deno_core::url::Url; + let _g = util::http_server(); + let deno_dir = TempDir::new(); + let module_url = + Url::parse("https://localhost:5545/cert/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::testdata_path()) + .arg("cache") + .arg(module_url.to_string()) + .output() + .expect("Failed to spawn script"); + assert!(output.status.success()); +} + +#[flaky_test::flaky_test] +fn cafile_fetch() { + use deno_core::url::Url; + let _g = util::http_server(); + let deno_dir = TempDir::new(); + let module_url = + Url::parse("http://localhost:4545/cert/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::testdata_path()) + .arg("cache") + .arg("--cert") + .arg(cafile) + .arg(module_url.to_string()) + .output() + .expect("Failed to spawn script"); + assert!(output.status.success()); + let out = std::str::from_utf8(&output.stdout).unwrap(); + assert_eq!(out, ""); +} + +#[flaky_test::flaky_test] +fn cafile_install_remote_module() { + let _g = util::http_server(); + let temp_dir = TempDir::new(); + let bin_dir = temp_dir.path().join("bin"); + std::fs::create_dir(&bin_dir).unwrap(); + let deno_dir = TempDir::new(); + 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::testdata_path()) + .arg("install") + .arg("--cert") + .arg(cafile) + .arg("--root") + .arg(temp_dir.path()) + .arg("-n") + .arg("echo_test") + .arg("https://localhost:5545/echo.ts") + .output() + .expect("Failed to spawn script"); + println!("{}", std::str::from_utf8(&install_output.stdout).unwrap()); + eprintln!("{}", std::str::from_utf8(&install_output.stderr).unwrap()); + assert!(install_output.status.success()); + + let mut echo_test_path = bin_dir.join("echo_test"); + if cfg!(windows) { + echo_test_path = echo_test_path.with_extension("cmd"); + } + assert!(echo_test_path.exists()); + + let output = Command::new(echo_test_path) + .current_dir(temp_dir.path()) + .arg("foo") + .env("PATH", util::target_dir()) + .output() + .expect("failed to spawn script"); + let stdout = std::str::from_utf8(&output.stdout).unwrap().trim(); + assert!(stdout.ends_with("foo")); +} + +#[flaky_test::flaky_test] +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/subdir/mod1.ts"; + let cafile = util::testdata_path().join("tls/RootCA.pem"); + let t = TempDir::new(); + let bundle = t.path().join("mod1.bundle.js"); + let mut deno = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("bundle") + .arg("--cert") + .arg(cafile) + .arg(mod1) + .arg(&bundle) + .spawn() + .expect("failed to spawn script"); + let status = deno.wait().expect("failed to wait for the child process"); + assert!(status.success()); + assert!(bundle.is_file()); + + // Now we try to use that bundle from another module. + let test = t.path().join("test.js"); + std::fs::write( + &test, + " + import { printHello3 } from \"./mod1.bundle.js\"; + printHello3(); ", + ) + .expect("error writing file"); + + let output = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("run") + .arg("--check") + .arg(&test) + .output() + .expect("failed to spawn script"); + // check the output of the test.ts program. + assert!(std::str::from_utf8(&output.stdout) + .unwrap() + .trim() + .ends_with("Hello")); + assert_eq!(output.stderr, b""); +} + +#[tokio::test] +async fn listen_tls_alpn() { + // TLS streams require the presence of an ambient local task set to gracefully + // close dropped connections in the background. + LocalSet::new() + .run_until(async { + let mut child = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("run") + .arg("--unstable") + .arg("--quiet") + .arg("--allow-net") + .arg("--allow-read") + .arg("./cert/listen_tls_alpn.ts") + .arg("4504") + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap(); + let stdout = child.stdout.as_mut().unwrap(); + let mut msg = [0; 5]; + let read = stdout.read(&mut msg).unwrap(); + assert_eq!(read, 5); + assert_eq!(&msg, b"READY"); + + let mut reader = &mut BufReader::new(Cursor::new(include_bytes!( + "../testdata/tls/RootCA.crt" + ))); + let certs = rustls_pemfile::certs(&mut reader).unwrap(); + let mut root_store = rustls::RootCertStore::empty(); + root_store.add_parsable_certificates(&certs); + let mut cfg = rustls::ClientConfig::builder() + .with_safe_defaults() + .with_root_certificates(root_store) + .with_no_client_auth(); + cfg.alpn_protocols.push(b"foobar".to_vec()); + let cfg = Arc::new(cfg); + + let hostname = rustls::ServerName::try_from("localhost").unwrap(); + + let tcp_stream = tokio::net::TcpStream::connect("localhost:4504") + .await + .unwrap(); + let mut tls_stream = + TlsStream::new_client_side(tcp_stream, cfg, hostname); + + tls_stream.handshake().await.unwrap(); + + let (_, rustls_connection) = tls_stream.get_ref(); + let alpn = rustls_connection.alpn_protocol().unwrap(); + assert_eq!(alpn, b"foobar"); + + let status = child.wait().unwrap(); + assert!(status.success()); + }) + .await; +} + +#[tokio::test] +async fn listen_tls_alpn_fail() { + // TLS streams require the presence of an ambient local task set to gracefully + // close dropped connections in the background. + LocalSet::new() + .run_until(async { + let mut child = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("run") + .arg("--unstable") + .arg("--quiet") + .arg("--allow-net") + .arg("--allow-read") + .arg("./cert/listen_tls_alpn_fail.ts") + .arg("4505") + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap(); + let stdout = child.stdout.as_mut().unwrap(); + let mut msg = [0; 5]; + let read = stdout.read(&mut msg).unwrap(); + assert_eq!(read, 5); + assert_eq!(&msg, b"READY"); + + let mut reader = &mut BufReader::new(Cursor::new(include_bytes!( + "../testdata/tls/RootCA.crt" + ))); + let certs = rustls_pemfile::certs(&mut reader).unwrap(); + let mut root_store = rustls::RootCertStore::empty(); + root_store.add_parsable_certificates(&certs); + let mut cfg = rustls::ClientConfig::builder() + .with_safe_defaults() + .with_root_certificates(root_store) + .with_no_client_auth(); + cfg.alpn_protocols.push(b"boofar".to_vec()); + let cfg = Arc::new(cfg); + + let hostname = rustls::ServerName::try_from("localhost").unwrap(); + + let tcp_stream = tokio::net::TcpStream::connect("localhost:4505") + .await + .unwrap(); + let mut tls_stream = + TlsStream::new_client_side(tcp_stream, cfg, hostname); + + tls_stream.handshake().await.unwrap_err(); + + let (_, rustls_connection) = tls_stream.get_ref(); + assert!(rustls_connection.alpn_protocol().is_none()); + + let status = child.wait().unwrap(); + assert!(status.success()); + }) + .await; +} diff --git a/cli/tests/integration/check_tests.rs b/cli/tests/integration/check_tests.rs index 5ceaffe51b..ab96670ef3 100644 --- a/cli/tests/integration/check_tests.rs +++ b/cli/tests/integration/check_tests.rs @@ -1,50 +1,52 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. +use std::process::Command; use std::process::Stdio; use crate::itest; use test_util as util; +use util::TempDir; itest!(_095_check_with_bare_import { - args: "check 095_cache_with_bare_import.ts", - output: "095_cache_with_bare_import.ts.out", + args: "check cache/095_cache_with_bare_import.ts", + output: "cache/095_cache_with_bare_import.ts.out", exit_code: 1, }); itest!(check_extensionless { args: "check --reload http://localhost:4545/subdir/no_js_ext", - output: "cache_extensionless.out", + output: "cache/cache_extensionless.out", http_server: true, }); itest!(check_random_extension { args: "check --reload http://localhost:4545/subdir/no_js_ext@1.0.0", - output: "cache_random_extension.out", + output: "cache/cache_random_extension.out", http_server: true, }); itest!(check_all { - args: "check --quiet --remote check_all.ts", - output: "check_all.out", + args: "check --quiet --remote check/check_all.ts", + output: "check/check_all.out", http_server: true, exit_code: 1, }); itest!(check_all_local { - args: "check --quiet check_all.ts", + args: "check --quiet check/check_all.ts", output_str: Some(""), http_server: true, }); itest!(module_detection_force { - args: "check --quiet module_detection_force.ts", + args: "check --quiet check/module_detection_force/main.ts", output_str: Some(""), }); // Regression test for https://github.com/denoland/deno/issues/14937. itest!(declaration_header_file_with_no_exports { - args: "check --quiet declaration_header_file_with_no_exports.ts", + args: "check --quiet check/declaration_header_file_with_no_exports.ts", output_str: Some(""), }); @@ -106,3 +108,91 @@ fn reload_flag() { stderr.contains("Check") } } + +#[test] +fn typecheck_declarations_ns() { + let output = util::deno_cmd() + .arg("test") + .arg("--doc") + .arg(util::root_path().join("cli/dts/lib.deno.ns.d.ts")) + .output() + .unwrap(); + println!("stdout: {}", String::from_utf8(output.stdout).unwrap()); + println!("stderr: {}", String::from_utf8(output.stderr).unwrap()); + assert!(output.status.success()); +} + +#[test] +fn typecheck_declarations_unstable() { + let output = util::deno_cmd() + .arg("test") + .arg("--doc") + .arg("--unstable") + .arg(util::root_path().join("cli/dts/lib.deno.unstable.d.ts")) + .output() + .unwrap(); + println!("stdout: {}", String::from_utf8(output.stdout).unwrap()); + println!("stderr: {}", String::from_utf8(output.stderr).unwrap()); + assert!(output.status.success()); +} + +#[test] +fn typecheck_core() { + let deno_dir = TempDir::new(); + let test_file = deno_dir.path().join("test_deno_core_types.ts"); + std::fs::write( + &test_file, + format!( + "import \"{}\";", + deno_core::resolve_path( + util::root_path() + .join("core/lib.deno_core.d.ts") + .to_str() + .unwrap() + ) + .unwrap() + ), + ) + .unwrap(); + let output = util::deno_cmd_with_deno_dir(&deno_dir) + .arg("run") + .arg(test_file.to_str().unwrap()) + .output() + .unwrap(); + println!("stdout: {}", String::from_utf8(output.stdout).unwrap()); + println!("stderr: {}", String::from_utf8(output.stderr).unwrap()); + assert!(output.status.success()); +} + +#[test] +fn ts_no_recheck_on_redirect() { + let deno_dir = util::new_deno_dir(); + let e = util::deno_exe_path(); + + let redirect_ts = util::testdata_path().join("run/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::testdata_path()) + .arg("run") + .arg("--check") + .arg(redirect_ts.clone()) + .spawn() + .expect("failed to span script"); + let status_initial = + initial.wait().expect("failed to wait for child process"); + assert!(status_initial.success()); + + let mut cmd = Command::new(e); + cmd.env("DENO_DIR", deno_dir.path()); + let output = cmd + .current_dir(util::testdata_path()) + .arg("run") + .arg("--check") + .arg(redirect_ts) + .output() + .expect("failed to spawn script"); + + assert!(std::str::from_utf8(&output.stderr).unwrap().is_empty()); +} diff --git a/cli/tests/integration/compile_tests.rs b/cli/tests/integration/compile_tests.rs index 5c9a7f0749..dea17e5986 100644 --- a/cli/tests/integration/compile_tests.rs +++ b/cli/tests/integration/compile_tests.rs @@ -53,7 +53,7 @@ fn standalone_args() { .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./028_args.ts") + .arg("./compile/args.ts") .arg("a") .arg("b") .stdout(std::process::Stdio::piped()) @@ -90,7 +90,7 @@ fn standalone_error() { .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./standalone_error.ts") + .arg("./compile/standalone_error.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -135,7 +135,7 @@ fn standalone_error_module_with_imports() { .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./standalone_error_module_with_imports_1.ts") + .arg("./compile/standalone_error_module_with_imports_1.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -177,7 +177,7 @@ fn standalone_load_datauri() { .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./standalone_import_datauri.ts") + .arg("./compile/standalone_import_datauri.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -210,7 +210,7 @@ fn standalone_follow_redirects() { .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./standalone_follow_redirects.ts") + .arg("./compile/standalone_follow_redirects.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -244,7 +244,7 @@ fn compile_with_file_exists_error() { .arg("--unstable") .arg("--output") .arg(&output_path) - .arg("./028_args.ts") + .arg("./compile/args.ts") .stderr(std::process::Stdio::piped()) .spawn() .unwrap() @@ -278,7 +278,7 @@ fn compile_with_directory_exists_error() { .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./028_args.ts") + .arg("./compile/args.ts") .stderr(std::process::Stdio::piped()) .spawn() .unwrap() @@ -312,7 +312,7 @@ fn compile_with_conflict_file_exists_error() { .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./028_args.ts") + .arg("./compile/args.ts") .stderr(std::process::Stdio::piped()) .spawn() .unwrap() @@ -349,7 +349,7 @@ fn compile_and_overwrite_file() { .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./028_args.ts") + .arg("./compile/args.ts") .stderr(std::process::Stdio::piped()) .spawn() .unwrap() @@ -364,7 +364,7 @@ fn compile_and_overwrite_file() { .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./028_args.ts") + .arg("./compile/args.ts") .stderr(std::process::Stdio::piped()) .spawn() .unwrap() @@ -390,7 +390,7 @@ fn standalone_runtime_flags() { .arg("1") .arg("--output") .arg(&exe) - .arg("./standalone_runtime_flags.ts") + .arg("./compile/standalone_runtime_flags.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -426,10 +426,10 @@ fn standalone_import_map() { .arg("--unstable") .arg("--allow-read") .arg("--import-map") - .arg("standalone_import_map.json") + .arg("compile/standalone_import_map.json") .arg("--output") .arg(&exe) - .arg("./standalone_import_map.ts") + .arg("./compile/standalone_import_map.ts") .stdout(std::process::Stdio::piped()) .spawn() .unwrap() @@ -461,7 +461,7 @@ fn skip_rebundle() { .arg("--unstable") .arg("--output") .arg(&exe) - .arg("./001_hello.js") + .arg("./run/001_hello.js") .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::piped()) .spawn() @@ -470,7 +470,7 @@ fn skip_rebundle() { .unwrap(); assert!(output.status.success()); - //no "Bundle testdata_path/001_hello.js" in output + //no "Bundle testdata_path/run/001_hello.js" in output assert!(!String::from_utf8(output.stderr).unwrap().contains("Bundle")); let output = Command::new(exe) diff --git a/cli/tests/integration/doc_tests.rs b/cli/tests/integration/doc_tests.rs index f225eeb2c9..4309d97547 100644 --- a/cli/tests/integration/doc_tests.rs +++ b/cli/tests/integration/doc_tests.rs @@ -8,7 +8,7 @@ use crate::itest; itest!(deno_doc_builtin { args: "doc", - output: "deno_doc_builtin.out", + output: "doc/deno_doc_builtin.out", }); #[test] @@ -19,7 +19,7 @@ fn deno_doc() { let output = util::deno_cmd_with_deno_dir(&dir) .current_dir(util::testdata_path()) .arg("doc") - .arg("deno_doc.ts") + .arg("doc/deno_doc.ts") .env("NO_COLOR", "1") .stdout(std::process::Stdio::piped()) .spawn() @@ -56,8 +56,9 @@ itest!(deno_doc_types_header { }); itest!(_060_deno_doc_displays_all_overloads_in_details_view { - args: "doc 060_deno_doc_displays_all_overloads_in_details_view.ts NS.test", - output: "060_deno_doc_displays_all_overloads_in_details_view.ts.out", + args: + "doc doc/060_deno_doc_displays_all_overloads_in_details_view.ts NS.test", + output: "doc/060_deno_doc_displays_all_overloads_in_details_view.ts.out", }); itest!(deno_doc_types_header_direct { diff --git a/cli/tests/integration/eval_tests.rs b/cli/tests/integration/eval_tests.rs index 892ca7ffd1..2d560812e6 100644 --- a/cli/tests/integration/eval_tests.rs +++ b/cli/tests/integration/eval_tests.rs @@ -44,27 +44,27 @@ fn eval_randomness() { assert!(numbers.len() > 1); } -itest!(_029_eval { +itest!(eval_basic { args: "eval console.log(\"hello\")", - output: "029_eval.out", + output_str: Some("hello\n"), }); // Ugly parentheses due to whitespace delimiting problem. -itest!(_030_eval_ts { +itest!(eval_ts { args: "eval --quiet --ext=ts console.log((123)as(number))", // 'as' is a TS keyword only - output: "030_eval_ts.out", + output_str: Some("123\n"), }); -itest!(_041_dyn_import_eval { +itest!(dyn_import_eval { args: "eval import('./subdir/mod4.js').then(console.log)", - output: "041_dyn_import_eval.out", + output: "eval/dyn_import_eval.out", }); // Cannot write the expression to evaluate as "console.log(typeof gc)" // because itest! splits args on whitespace. itest!(v8_flags_eval { args: "eval --v8-flags=--expose-gc console.log(typeof(gc))", - output: "v8_flags.js.out", + output: "run/v8_flags.js.out", }); itest!(check_local_by_default { diff --git a/cli/tests/integration/flags_tests.rs b/cli/tests/integration/flags_tests.rs new file mode 100644 index 0000000000..5e3814e223 --- /dev/null +++ b/cli/tests/integration/flags_tests.rs @@ -0,0 +1,45 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +use crate::itest; +use test_util as util; + +#[test] +fn help_flag() { + let status = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("--help") + .spawn() + .unwrap() + .wait() + .unwrap(); + assert!(status.success()); +} + +#[test] +fn version_short_flag() { + let status = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("-V") + .spawn() + .unwrap() + .wait() + .unwrap(); + assert!(status.success()); +} + +#[test] +fn version_long_flag() { + let status = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("--version") + .spawn() + .unwrap() + .wait() + .unwrap(); + assert!(status.success()); +} + +itest!(types { + args: "types", + output: "types/types.out", +}); diff --git a/cli/tests/integration/fmt_tests.rs b/cli/tests/integration/fmt_tests.rs index 048e9aa216..53b45de199 100644 --- a/cli/tests/integration/fmt_tests.rs +++ b/cli/tests/integration/fmt_tests.rs @@ -7,29 +7,29 @@ use test_util::TempDir; #[test] fn fmt_test() { let t = TempDir::new(); - let fixed_js = util::testdata_path().join("badly_formatted_fixed.js"); + let testdata_fmt_dir = util::testdata_path().join("fmt"); + let fixed_js = testdata_fmt_dir.join("badly_formatted_fixed.js"); let badly_formatted_original_js = - util::testdata_path().join("badly_formatted.mjs"); + testdata_fmt_dir.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).unwrap(); - let fixed_md = util::testdata_path().join("badly_formatted_fixed.md"); - let badly_formatted_original_md = - util::testdata_path().join("badly_formatted.md"); + let fixed_md = testdata_fmt_dir.join("badly_formatted_fixed.md"); + let badly_formatted_original_md = testdata_fmt_dir.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).unwrap(); - let fixed_json = util::testdata_path().join("badly_formatted_fixed.json"); + let fixed_json = testdata_fmt_dir.join("badly_formatted_fixed.json"); let badly_formatted_original_json = - util::testdata_path().join("badly_formatted.json"); + testdata_fmt_dir.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).unwrap(); // First, check formatting by ignoring the badly formatted file. let status = util::deno_cmd() - .current_dir(util::testdata_path()) + .current_dir(&testdata_fmt_dir) .arg("fmt") .arg(format!( "--ignore={},{},{}", @@ -48,7 +48,7 @@ fn fmt_test() { // Check without ignore. let status = util::deno_cmd() - .current_dir(util::testdata_path()) + .current_dir(&testdata_fmt_dir) .arg("fmt") .arg("--check") .arg(badly_formatted_js_str) @@ -62,7 +62,7 @@ fn fmt_test() { // Format the source file. let status = util::deno_cmd() - .current_dir(util::testdata_path()) + .current_dir(&testdata_fmt_dir) .arg("fmt") .arg(badly_formatted_js_str) .arg(badly_formatted_md_str) diff --git a/cli/tests/integration/info_tests.rs b/cli/tests/integration/info_tests.rs index aa678cb6db..0cb8750783 100644 --- a/cli/tests/integration/info_tests.rs +++ b/cli/tests/integration/info_tests.rs @@ -8,7 +8,7 @@ use test_util::TempDir; #[test] fn info_with_compiled_source() { let _g = util::http_server(); - let module_path = "http://127.0.0.1:4545/048_media_types_jsx.ts"; + let module_path = "http://127.0.0.1:4545/run/048_media_types_jsx.ts"; let t = TempDir::new(); let mut deno = util::deno_cmd() @@ -37,79 +37,79 @@ fn info_with_compiled_source() { assert_eq!(output.stderr, b""); } -itest!(_022_info_flag_script { - args: "info http://127.0.0.1:4545/019_media_types.ts", - output: "022_info_flag_script.out", +itest!(multiple_imports { + args: "info http://127.0.0.1:4545/run/019_media_types.ts", + output: "info/multiple_imports.out", http_server: true, }); -itest!(_031_info_ts_error { - args: "info 031_info_ts_error.ts", - output: "031_info_ts_error.out", +itest!(info_ts_error { + args: "info info/031_info_ts_error.ts", + output: "info/031_info_ts_error.out", }); -itest!(_041_info_flag { +itest!(info_flag { args: "info", - output: "041_info_flag.out", + output: "info/041_info_flag.out", }); -itest!(_042_info_flag_location { +itest!(info_flag_location { args: "info --location https://deno.land", - output: "041_info_flag_location.out", + output: "info/041_info_flag_location.out", }); itest!(info_json { args: "info --json --unstable", - output: "info_json.out", + output: "info/info_json.out", }); itest!(info_json_location { args: "info --json --unstable --location https://deno.land", - output: "info_json_location.out", + output: "info/info_json_location.out", }); -itest!(_049_info_flag_script_jsx { - args: "info http://127.0.0.1:4545/048_media_types_jsx.ts", - output: "049_info_flag_script_jsx.out", +itest!(info_flag_script_jsx { + args: "info http://127.0.0.1:4545/run/048_media_types_jsx.ts", + output: "info/049_info_flag_script_jsx.out", http_server: true, }); -itest!(_055_info_file_json { - args: "info --quiet --json --unstable 005_more_imports.ts", - output: "055_info_file_json.out", +itest!(json_file { + args: "info --quiet --json --unstable info/json_output/main.ts", + output: "info/json_output/main.out", exit_code: 0, }); -itest!(_065_import_map_info { +itest!(import_map_info { args: "info --quiet --import-map=import_maps/import_map.json import_maps/test.ts", - output: "065_import_map_info.out", + output: "info/065_import_map_info.out", }); -itest!(_076_info_json_deps_order { - args: "info --unstable --json 076_info_json_deps_order.ts", - output: "076_info_json_deps_order.out", +itest!(info_json_deps_order { + args: "info --unstable --json info/076_info_json_deps_order.ts", + output: "info/076_info_json_deps_order.out", }); itest!(info_missing_module { - args: "info error_009_missing_js_module.js", - output: "info_missing_module.out", + args: "info info/error_009_missing_js_module.js", + output: "info/info_missing_module.out", }); itest!(info_recursive_modules { - args: "info --quiet info_recursive_imports_test.ts", - output: "info_recursive_imports_test.out", + args: "info --quiet info/info_recursive_imports_test.ts", + output: "info/info_recursive_imports_test.out", exit_code: 0, }); itest!(info_type_import { - args: "info info_type_import.ts", - output: "info_type_import.out", + args: "info info/info_type_import.ts", + output: "info/info_type_import.out", }); itest!(_054_info_local_imports { - args: "info --quiet 005_more_imports.ts", - output: "054_info_local_imports.out", + args: "info --quiet run/005_more_imports.ts", + output: "info/054_info_local_imports.out", exit_code: 0, }); @@ -120,13 +120,13 @@ itest!(data_null_error { output: "info/data_null_error/data_null_error.out", }); -itest!(deno_info_types_header_direct { - args: "info --reload type_directives_01.ts", +itest!(types_header_direct { + args: "info --reload run/type_directives_01.ts", output: "info/types_header.out", http_server: true, }); -itest!(deno_info_with_config_override { +itest!(with_config_override { args: "info info/with_config/test.ts --config info/with_config/deno-override.json --import-map info/with_config/import_map.json", output: "info/with_config/with_config.out", }); diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 7e75e852bb..d49a8a8140 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -4107,8 +4107,8 @@ fn lsp_diagnostics_warn_redirect() { severity: Some(lsp::DiagnosticSeverity::INFORMATION), code: Some(lsp::NumberOrString::String("redirect".to_string())), source: Some("deno".to_string()), - message: "The import of \"http://127.0.0.1:4545/x_deno_warning.js\" was redirected to \"http://127.0.0.1:4545/x_deno_warning_redirect.js\".".to_string(), - data: Some(json!({"specifier": "http://127.0.0.1:4545/x_deno_warning.js", "redirect": "http://127.0.0.1:4545/x_deno_warning_redirect.js"})), + message: "The import of \"http://127.0.0.1:4545/x_deno_warning.js\" was redirected to \"http://127.0.0.1:4545/lsp/x_deno_warning_redirect.js\".".to_string(), + data: Some(json!({"specifier": "http://127.0.0.1:4545/x_deno_warning.js", "redirect": "http://127.0.0.1:4545/lsp/x_deno_warning_redirect.js"})), ..Default::default() } ], diff --git a/cli/tests/integration/mod.rs b/cli/tests/integration/mod.rs index 143bda819d..373d04e706 100644 --- a/cli/tests/integration/mod.rs +++ b/cli/tests/integration/mod.rs @@ -1,22 +1,6 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. -use crate::itest; -use deno_core::url; -use deno_runtime::deno_fetch::reqwest; -use deno_runtime::deno_net::ops_tls::TlsStream; -use deno_runtime::deno_tls::rustls; -use deno_runtime::deno_tls::rustls_pemfile; -use std::fs; -use std::io::BufReader; -use std::io::Cursor; -use std::io::{Read, Write}; -use std::process::Command; -use std::sync::Arc; use test_util as util; -use test_util::TempDir; -use tokio::task::LocalSet; -use trust_dns_client::serialize::txt::Lexer; -use trust_dns_client::serialize::txt::Parser; #[macro_export] macro_rules! itest( @@ -58,6 +42,8 @@ mod bench; mod bundle; #[path = "cache_tests.rs"] mod cache; +#[path = "cert_tests.rs"] +mod cert; #[path = "check_tests.rs"] mod check; #[path = "compile_tests.rs"] @@ -68,6 +54,8 @@ mod coverage; mod doc; #[path = "eval_tests.rs"] mod eval; +#[path = "flags_tests.rs"] +mod flags; #[path = "fmt_tests.rs"] mod fmt; #[path = "info_tests.rs"] @@ -101,917 +89,6 @@ mod watcher; #[path = "worker_tests.rs"] mod worker; -#[test] -fn help_flag() { - let status = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("--help") - .spawn() - .unwrap() - .wait() - .unwrap(); - assert!(status.success()); -} - -#[test] -fn version_short_flag() { - let status = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("-V") - .spawn() - .unwrap() - .wait() - .unwrap(); - assert!(status.success()); -} - -#[test] -fn version_long_flag() { - let status = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("--version") - .spawn() - .unwrap() - .wait() - .unwrap(); - assert!(status.success()); -} - -itest!(types { - args: "types", - output: "types.out", -}); - -#[test] -fn cache_test() { - let _g = util::http_server(); - let deno_dir = TempDir::new(); - let module_url = - 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::testdata_path()) - .arg("cache") - .arg("--check=all") - .arg("-L") - .arg("debug") - .arg(module_url.to_string()) - .output() - .expect("Failed to spawn script"); - assert!(output.status.success()); - - let prg = util::deno_exe_path(); - let output = Command::new(&prg) - .env("DENO_DIR", deno_dir.path()) - .env("HTTP_PROXY", "http://nil") - .env("NO_COLOR", "1") - .current_dir(util::testdata_path()) - .arg("run") - .arg(module_url.to_string()) - .output() - .expect("Failed to spawn script"); - - let str_output = std::str::from_utf8(&output.stdout).unwrap(); - - 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 - .read_to_string(&mut module_output) - .unwrap(); - - assert_eq!(module_output, str_output); -} - -#[test] -fn cache_invalidation_test() { - let deno_dir = TempDir::new(); - let fixture_path = deno_dir.path().join("fixture.ts"); - { - let mut file = std::fs::File::create(fixture_path.clone()) - .expect("could not create fixture"); - file - .write_all(b"console.log(\"42\");") - .expect("could not write fixture"); - } - let output = Command::new(util::deno_exe_path()) - .env("DENO_DIR", deno_dir.path()) - .current_dir(util::testdata_path()) - .arg("run") - .arg(fixture_path.to_str().unwrap()) - .output() - .expect("Failed to spawn script"); - assert!(output.status.success()); - let actual = std::str::from_utf8(&output.stdout).unwrap(); - assert_eq!(actual, "42\n"); - { - let mut file = std::fs::File::create(fixture_path.clone()) - .expect("could not create fixture"); - file - .write_all(b"console.log(\"43\");") - .expect("could not write fixture"); - } - let output = Command::new(util::deno_exe_path()) - .env("DENO_DIR", deno_dir.path()) - .current_dir(util::testdata_path()) - .arg("run") - .arg(fixture_path.to_str().unwrap()) - .output() - .expect("Failed to spawn script"); - assert!(output.status.success()); - let actual = std::str::from_utf8(&output.stdout).unwrap(); - assert_eq!(actual, "43\n"); -} - -#[test] -fn cache_invalidation_test_no_check() { - let deno_dir = TempDir::new(); - let fixture_path = deno_dir.path().join("fixture.ts"); - { - let mut file = std::fs::File::create(fixture_path.clone()) - .expect("could not create fixture"); - file - .write_all(b"console.log(\"42\");") - .expect("could not write fixture"); - } - let output = Command::new(util::deno_exe_path()) - .env("DENO_DIR", deno_dir.path()) - .current_dir(util::testdata_path()) - .arg("run") - .arg("--no-check") - .arg(fixture_path.to_str().unwrap()) - .output() - .expect("Failed to spawn script"); - assert!(output.status.success()); - let actual = std::str::from_utf8(&output.stdout).unwrap(); - assert_eq!(actual, "42\n"); - { - let mut file = std::fs::File::create(fixture_path.clone()) - .expect("could not create fixture"); - file - .write_all(b"console.log(\"43\");") - .expect("could not write fixture"); - } - let output = Command::new(util::deno_exe_path()) - .env("DENO_DIR", deno_dir.path()) - .current_dir(util::testdata_path()) - .arg("run") - .arg("--no-check") - .arg(fixture_path.to_str().unwrap()) - .output() - .expect("Failed to spawn script"); - assert!(output.status.success()); - let actual = std::str::from_utf8(&output.stdout).unwrap(); - assert_eq!(actual, "43\n"); -} - -#[test] -fn ts_dependency_recompilation() { - let t = TempDir::new(); - let ats = t.path().join("a.ts"); - - std::fs::write( - &ats, - " - import { foo } from \"./b.ts\"; - - function print(str: string): void { - console.log(str); - } - - print(foo);", - ) - .unwrap(); - - let bts = t.path().join("b.ts"); - std::fs::write( - &bts, - " - export const foo = \"foo\";", - ) - .unwrap(); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .env("NO_COLOR", "1") - .arg("run") - .arg("--check") - .arg(&ats) - .output() - .expect("failed to spawn script"); - - let stdout_output = std::str::from_utf8(&output.stdout).unwrap().trim(); - let stderr_output = std::str::from_utf8(&output.stderr).unwrap().trim(); - - assert!(stdout_output.ends_with("foo")); - assert!(stderr_output.starts_with("Check")); - - // Overwrite contents of b.ts and run again - std::fs::write( - &bts, - " - export const foo = 5;", - ) - .expect("error writing file"); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .env("NO_COLOR", "1") - .arg("run") - .arg("--check") - .arg(&ats) - .output() - .expect("failed to spawn script"); - - let stdout_output = std::str::from_utf8(&output.stdout).unwrap().trim(); - let stderr_output = std::str::from_utf8(&output.stderr).unwrap().trim(); - - // error: TS2345 [ERROR]: Argument of type '5' is not assignable to parameter of type 'string'. - assert!(stderr_output.contains("TS2345")); - assert!(!output.status.success()); - assert!(stdout_output.is_empty()); -} - -#[test] -fn ts_no_recheck_on_redirect() { - let deno_dir = util::new_deno_dir(); - let e = util::deno_exe_path(); - - 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::testdata_path()) - .arg("run") - .arg("--check") - .arg(redirect_ts.clone()) - .spawn() - .expect("failed to span script"); - let status_initial = - initial.wait().expect("failed to wait for child process"); - assert!(status_initial.success()); - - let mut cmd = Command::new(e); - cmd.env("DENO_DIR", deno_dir.path()); - let output = cmd - .current_dir(util::testdata_path()) - .arg("run") - .arg("--check") - .arg(redirect_ts) - .output() - .expect("failed to spawn script"); - - assert!(std::str::from_utf8(&output.stderr).unwrap().is_empty()); -} - -#[test] -fn timeout_clear() { - // https://github.com/denoland/deno/issues/7599 - - use std::time::Duration; - use std::time::Instant; - - let source_code = r#" -const handle = setTimeout(() => { - console.log("timeout finish"); -}, 10000); -clearTimeout(handle); -console.log("finish"); -"#; - - let mut p = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg("-") - .stdin(std::process::Stdio::piped()) - .spawn() - .unwrap(); - let stdin = p.stdin.as_mut().unwrap(); - stdin.write_all(source_code.as_bytes()).unwrap(); - let start = Instant::now(); - let status = p.wait().unwrap(); - let end = Instant::now(); - assert!(status.success()); - // check that program did not run for 10 seconds - // for timeout to clear - assert!(end - start < Duration::new(10, 0)); -} - -#[test] -fn broken_stdout() { - let (reader, writer) = os_pipe::pipe().unwrap(); - // drop the reader to create a broken pipe - drop(reader); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("eval") - .arg("console.log(3.14)") - .stdout(writer) - .stderr(std::process::Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); - - assert!(!output.status.success()); - let stderr = std::str::from_utf8(output.stderr.as_ref()).unwrap().trim(); - assert!(stderr.contains("Uncaught BrokenPipe")); - assert!(!stderr.contains("panic")); -} - -itest!(error_cause { - args: "run error_cause.ts", - output: "error_cause.ts.out", - exit_code: 1, -}); - -itest!(error_cause_recursive { - args: "run error_cause_recursive.ts", - output: "error_cause_recursive.ts.out", - exit_code: 1, -}); - -itest_flaky!(cafile_url_imports { - args: "run --quiet --reload --cert tls/RootCA.pem cafile_url_imports.ts", - output: "cafile_url_imports.ts.out", - http_server: true, -}); - -itest_flaky!(cafile_ts_fetch { - args: - "run --quiet --reload --allow-net --cert tls/RootCA.pem cafile_ts_fetch.ts", - output: "cafile_ts_fetch.ts.out", - http_server: true, -}); - -itest_flaky!(cafile_eval { - 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_flaky!(cafile_info { - args: - "info --quiet --cert tls/RootCA.pem https://localhost:5545/cafile_info.ts", - output: "cafile_info.ts.out", - http_server: true, -}); - -itest_flaky!(cafile_url_imports_unsafe_ssl { - args: "run --quiet --reload --unsafely-ignore-certificate-errors=localhost cafile_url_imports.ts", - output: "cafile_url_imports_unsafe_ssl.ts.out", - http_server: true, -}); - -itest_flaky!(cafile_ts_fetch_unsafe_ssl { - args: - "run --quiet --reload --allow-net --unsafely-ignore-certificate-errors cafile_ts_fetch.ts", - output: "cafile_ts_fetch_unsafe_ssl.ts.out", - http_server: true, -}); - -itest!(deno_land_unsafe_ssl { - args: - "run --quiet --reload --allow-net --unsafely-ignore-certificate-errors=deno.land deno_land_unsafe_ssl.ts", - output: "deno_land_unsafe_ssl.ts.out", -}); - -itest!(ip_address_unsafe_ssl { - args: - "run --quiet --reload --allow-net --unsafely-ignore-certificate-errors=1.1.1.1 ip_address_unsafe_ssl.ts", - output: "ip_address_unsafe_ssl.ts.out", -}); - -itest!(localhost_unsafe_ssl { - args: - "run --quiet --reload --allow-net --unsafely-ignore-certificate-errors=deno.land cafile_url_imports.ts", - output: "localhost_unsafe_ssl.ts.out", - http_server: true, - exit_code: 1, -}); - -#[flaky_test::flaky_test] -fn cafile_env_fetch() { - use deno_core::url::Url; - let _g = util::http_server(); - let deno_dir = TempDir::new(); - let module_url = - 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::testdata_path()) - .arg("cache") - .arg(module_url.to_string()) - .output() - .expect("Failed to spawn script"); - assert!(output.status.success()); -} - -#[flaky_test::flaky_test] -fn cafile_fetch() { - use deno_core::url::Url; - let _g = util::http_server(); - let deno_dir = TempDir::new(); - let module_url = - 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::testdata_path()) - .arg("cache") - .arg("--cert") - .arg(cafile) - .arg(module_url.to_string()) - .output() - .expect("Failed to spawn script"); - assert!(output.status.success()); - let out = std::str::from_utf8(&output.stdout).unwrap(); - assert_eq!(out, ""); -} - -#[flaky_test::flaky_test] -fn cafile_install_remote_module() { - let _g = util::http_server(); - let temp_dir = TempDir::new(); - let bin_dir = temp_dir.path().join("bin"); - std::fs::create_dir(&bin_dir).unwrap(); - let deno_dir = TempDir::new(); - 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::testdata_path()) - .arg("install") - .arg("--cert") - .arg(cafile) - .arg("--root") - .arg(temp_dir.path()) - .arg("-n") - .arg("echo_test") - .arg("https://localhost:5545/echo.ts") - .output() - .expect("Failed to spawn script"); - println!("{}", std::str::from_utf8(&install_output.stdout).unwrap()); - eprintln!("{}", std::str::from_utf8(&install_output.stderr).unwrap()); - assert!(install_output.status.success()); - - let mut echo_test_path = bin_dir.join("echo_test"); - if cfg!(windows) { - echo_test_path = echo_test_path.with_extension("cmd"); - } - assert!(echo_test_path.exists()); - - let output = Command::new(echo_test_path) - .current_dir(temp_dir.path()) - .arg("foo") - .env("PATH", util::target_dir()) - .output() - .expect("failed to spawn script"); - let stdout = std::str::from_utf8(&output.stdout).unwrap().trim(); - assert!(stdout.ends_with("foo")); -} - -#[flaky_test::flaky_test] -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/subdir/mod1.ts"; - let cafile = util::testdata_path().join("tls/RootCA.pem"); - let t = TempDir::new(); - let bundle = t.path().join("mod1.bundle.js"); - let mut deno = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("bundle") - .arg("--cert") - .arg(cafile) - .arg(mod1) - .arg(&bundle) - .spawn() - .expect("failed to spawn script"); - let status = deno.wait().expect("failed to wait for the child process"); - assert!(status.success()); - assert!(bundle.is_file()); - - // Now we try to use that bundle from another module. - let test = t.path().join("test.js"); - std::fs::write( - &test, - " - import { printHello3 } from \"./mod1.bundle.js\"; - printHello3(); ", - ) - .expect("error writing file"); - - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg("--check") - .arg(&test) - .output() - .expect("failed to spawn script"); - // check the output of the test.ts program. - assert!(std::str::from_utf8(&output.stdout) - .unwrap() - .trim() - .ends_with("Hello")); - assert_eq!(output.stderr, b""); -} - -#[test] -fn websocket() { - let _g = util::http_server(); - - 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") - .arg("--allow-net") - .arg("--cert") - .arg(root_ca) - .arg(script) - .spawn() - .unwrap() - .wait() - .unwrap(); - - assert!(status.success()); -} - -#[test] -fn websocketstream() { - let _g = util::http_server(); - - 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") - .arg("--allow-net") - .arg("--cert") - .arg(root_ca) - .arg(script) - .spawn() - .unwrap() - .wait() - .unwrap(); - - assert!(status.success()); -} - -#[test] -fn websocketstream_ping() { - use deno_runtime::deno_websocket::tokio_tungstenite::tungstenite; - let _g = util::http_server(); - - let script = util::testdata_path().join("websocketstream_ping_test.ts"); - let root_ca = util::testdata_path().join("tls/RootCA.pem"); - let mut child = util::deno_cmd() - .arg("test") - .arg("--unstable") - .arg("--allow-net") - .arg("--cert") - .arg(root_ca) - .arg(script) - .stdout(std::process::Stdio::piped()) - .spawn() - .unwrap(); - - let server = std::net::TcpListener::bind("127.0.0.1:4513").unwrap(); - let (stream, _) = server.accept().unwrap(); - let mut socket = tungstenite::accept(stream).unwrap(); - socket - .write_message(tungstenite::Message::Text(String::from("A"))) - .unwrap(); - socket - .write_message(tungstenite::Message::Ping(vec![])) - .unwrap(); - socket - .write_message(tungstenite::Message::Text(String::from("B"))) - .unwrap(); - let message = socket.read_message().unwrap(); - assert_eq!(message, tungstenite::Message::Pong(vec![])); - socket - .write_message(tungstenite::Message::Text(String::from("C"))) - .unwrap(); - socket.close(None).unwrap(); - - assert!(child.wait().unwrap().success()); -} - -#[test] -fn websocket_server_multi_field_connection_header() { - let script = util::testdata_path() - .join("websocket_server_multi_field_connection_header_test.ts"); - let root_ca = util::testdata_path().join("tls/RootCA.pem"); - let mut child = util::deno_cmd() - .arg("run") - .arg("--unstable") - .arg("--allow-net") - .arg("--cert") - .arg(root_ca) - .arg(script) - .stdout(std::process::Stdio::piped()) - .spawn() - .unwrap(); - - let stdout = child.stdout.as_mut().unwrap(); - let mut buffer = [0; 5]; - let read = stdout.read(&mut buffer).unwrap(); - assert_eq!(read, 5); - let msg = std::str::from_utf8(&buffer).unwrap(); - assert_eq!(msg, "READY"); - - let req = http::request::Builder::new() - .header(http::header::CONNECTION, "keep-alive, Upgrade") - .uri("ws://localhost:4319") - .body(()) - .unwrap(); - let (mut socket, _) = - deno_runtime::deno_websocket::tokio_tungstenite::tungstenite::connect(req) - .unwrap(); - let message = socket.read_message().unwrap(); - assert_eq!(message, deno_runtime::deno_websocket::tokio_tungstenite::tungstenite::Message::Close(None)); - socket.close(None).unwrap(); - assert!(child.wait().unwrap().success()); -} - -// TODO(bartlomieju): this should use `deno run`, not `deno test`; but the -// test hangs then. https://github.com/denoland/deno/issues/14283 -#[test] -#[ignore] -fn websocket_server_idletimeout() { - let script = util::testdata_path().join("websocket_server_idletimeout.ts"); - let root_ca = util::testdata_path().join("tls/RootCA.pem"); - let mut child = util::deno_cmd() - .arg("test") - .arg("--unstable") - .arg("--allow-net") - .arg("--cert") - .arg(root_ca) - .arg(script) - .stdout(std::process::Stdio::piped()) - .spawn() - .unwrap(); - - let stdout = child.stdout.as_mut().unwrap(); - let mut buffer = [0; 5]; - let read = stdout.read(&mut buffer).unwrap(); - assert_eq!(read, 5); - let msg = std::str::from_utf8(&buffer).unwrap(); - assert_eq!(msg, "READY"); - - let req = http::request::Builder::new() - .uri("ws://localhost:4509") - .body(()) - .unwrap(); - let (_ws, _request) = - deno_runtime::deno_websocket::tokio_tungstenite::tungstenite::connect(req) - .unwrap(); - - assert!(child.wait().unwrap().success()); -} - -#[cfg(not(windows))] -#[test] -fn set_raw_should_not_panic_on_no_tty() { - let output = util::deno_cmd() - .arg("eval") - .arg("--unstable") - .arg("Deno.setRaw(Deno.stdin.rid, true)") - // stdin set to piped so it certainly does not refer to TTY - .stdin(std::process::Stdio::piped()) - // stderr is piped so we can capture output. - .stderr(std::process::Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); - assert!(!output.status.success()); - let stderr = std::str::from_utf8(&output.stderr).unwrap().trim(); - assert!(stderr.contains("BadResource")); -} - -#[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_resolve_dns() { - use std::net::SocketAddr; - use std::str::FromStr; - use std::sync::Arc; - use std::time::Duration; - use tokio::net::TcpListener; - use tokio::net::UdpSocket; - use tokio::sync::oneshot; - use trust_dns_server::authority::Catalog; - use trust_dns_server::authority::ZoneType; - use trust_dns_server::proto::rr::Name; - use trust_dns_server::store::in_memory::InMemoryAuthority; - use trust_dns_server::ServerFuture; - - const DNS_PORT: u16 = 4553; - - // Setup DNS server for testing - async fn run_dns_server(tx: oneshot::Sender<()>) { - let zone_file = - fs::read_to_string(util::testdata_path().join("resolve_dns.zone.in")) - .unwrap(); - let lexer = Lexer::new(&zone_file); - let records = Parser::new().parse( - lexer, - Some(Name::from_str("example.com").unwrap()), - None, - ); - if records.is_err() { - panic!("failed to parse: {:?}", records.err()) - } - let (origin, records) = records.unwrap(); - let authority = Box::new(Arc::new( - InMemoryAuthority::new(origin, records, ZoneType::Primary, false) - .unwrap(), - )); - let mut catalog: Catalog = Catalog::new(); - catalog.upsert(Name::root().into(), authority); - - let mut server_fut = ServerFuture::new(catalog); - let socket_addr = SocketAddr::from(([127, 0, 0, 1], DNS_PORT)); - let tcp_listener = TcpListener::bind(socket_addr).await.unwrap(); - let udp_socket = UdpSocket::bind(socket_addr).await.unwrap(); - server_fut.register_socket(udp_socket); - server_fut.register_listener(tcp_listener, Duration::from_secs(2)); - - // Notifies that the DNS server is ready - tx.send(()).unwrap(); - - server_fut.block_until_done().await.unwrap(); - } - - let (ready_tx, ready_rx) = oneshot::channel(); - let dns_server_fut = run_dns_server(ready_tx); - let handle = tokio::spawn(dns_server_fut); - - // Waits for the DNS server to be ready - ready_rx.await.unwrap(); - - // Pass: `--allow-net` - { - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .env("NO_COLOR", "1") - .arg("run") - .arg("--check") - .arg("--allow-net") - .arg("resolve_dns.ts") - .stdout(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); - let err = String::from_utf8_lossy(&output.stderr); - let out = String::from_utf8_lossy(&output.stdout); - println!("{}", err); - assert!(output.status.success()); - assert!(err.starts_with("Check file")); - - let expected = - std::fs::read_to_string(util::testdata_path().join("resolve_dns.ts.out")) - .unwrap(); - assert_eq!(expected, out); - } - - // Pass: `--allow-net=127.0.0.1:4553` - { - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .env("NO_COLOR", "1") - .arg("run") - .arg("--check") - .arg("--allow-net=127.0.0.1:4553") - .arg("resolve_dns.ts") - .stdout(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); - let err = String::from_utf8_lossy(&output.stderr); - let out = String::from_utf8_lossy(&output.stdout); - assert!(output.status.success()); - assert!(err.starts_with("Check file")); - - let expected = - std::fs::read_to_string(util::testdata_path().join("resolve_dns.ts.out")) - .unwrap(); - assert_eq!(expected, out); - } - - // Permission error: `--allow-net=deno.land` - { - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .env("NO_COLOR", "1") - .arg("run") - .arg("--check") - .arg("--allow-net=deno.land") - .arg("resolve_dns.ts") - .stdout(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); - let err = String::from_utf8_lossy(&output.stderr); - let out = String::from_utf8_lossy(&output.stdout); - assert!(!output.status.success()); - assert!(err.starts_with("Check file")); - assert!(err.contains(r#"error: Uncaught PermissionDenied: Requires net access to "127.0.0.1:4553""#)); - assert!(out.is_empty()); - } - - // Permission error: no permission specified - { - let output = util::deno_cmd() - .current_dir(util::testdata_path()) - .env("NO_COLOR", "1") - .arg("run") - .arg("--check") - .arg("resolve_dns.ts") - .stdout(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); - let err = String::from_utf8_lossy(&output.stderr); - let out = String::from_utf8_lossy(&output.stdout); - assert!(!output.status.success()); - assert!(err.starts_with("Check file")); - assert!(err.contains(r#"error: Uncaught PermissionDenied: Requires net access to "127.0.0.1:4553""#)); - assert!(out.is_empty()); - } - - handle.abort(); -} - -#[test] -fn typecheck_declarations_ns() { - let output = util::deno_cmd() - .arg("test") - .arg("--doc") - .arg(util::root_path().join("cli/dts/lib.deno.ns.d.ts")) - .output() - .unwrap(); - println!("stdout: {}", String::from_utf8(output.stdout).unwrap()); - println!("stderr: {}", String::from_utf8(output.stderr).unwrap()); - assert!(output.status.success()); -} - -#[test] -fn typecheck_declarations_unstable() { - let output = util::deno_cmd() - .arg("test") - .arg("--doc") - .arg("--unstable") - .arg(util::root_path().join("cli/dts/lib.deno.unstable.d.ts")) - .output() - .unwrap(); - println!("stdout: {}", String::from_utf8(output.stdout).unwrap()); - println!("stderr: {}", String::from_utf8(output.stderr).unwrap()); - assert!(output.status.success()); -} - -#[test] -fn typecheck_core() { - let deno_dir = TempDir::new(); - let test_file = deno_dir.path().join("test_deno_core_types.ts"); - std::fs::write( - &test_file, - format!( - "import \"{}\";", - deno_core::resolve_path( - util::root_path() - .join("core/lib.deno_core.d.ts") - .to_str() - .unwrap() - ) - .unwrap() - ), - ) - .unwrap(); - let output = util::deno_cmd_with_deno_dir(&deno_dir) - .arg("run") - .arg(test_file.to_str().unwrap()) - .output() - .unwrap(); - println!("stdout: {}", String::from_utf8(output.stdout).unwrap()); - println!("stderr: {}", String::from_utf8(output.stderr).unwrap()); - assert!(output.status.success()); -} - #[test] fn js_unit_tests_lint() { let status = util::deno_cmd() @@ -1047,211 +124,3 @@ fn js_unit_tests() { assert_eq!(Some(0), status.code()); assert!(status.success()); } - -#[test] -fn basic_auth_tokens() { - let _g = util::http_server(); - - let output = util::deno_cmd() - .current_dir(util::root_path()) - .arg("run") - .arg("http://127.0.0.1:4554/001_hello.js") - .stdout(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); - - assert!(!output.status.success()); - - let stdout_str = std::str::from_utf8(&output.stdout).unwrap().trim(); - assert!(stdout_str.is_empty()); - - let stderr_str = std::str::from_utf8(&output.stderr).unwrap().trim(); - eprintln!("{}", stderr_str); - - assert!(stderr_str - .contains("Module not found \"http://127.0.0.1:4554/001_hello.js\".")); - - let output = util::deno_cmd() - .current_dir(util::root_path()) - .arg("run") - .arg("http://127.0.0.1:4554/001_hello.js") - .env("DENO_AUTH_TOKENS", "testuser123:testpassabc@127.0.0.1:4554") - .stdout(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); - - let stderr_str = std::str::from_utf8(&output.stderr).unwrap().trim(); - eprintln!("{}", stderr_str); - - assert!(output.status.success()); - - let stdout_str = std::str::from_utf8(&output.stdout).unwrap().trim(); - assert_eq!(util::strip_ansi_codes(stdout_str), "Hello World"); -} - -#[tokio::test] -async fn listen_tls_alpn() { - // TLS streams require the presence of an ambient local task set to gracefully - // close dropped connections in the background. - LocalSet::new() - .run_until(async { - let mut child = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg("--unstable") - .arg("--quiet") - .arg("--allow-net") - .arg("--allow-read") - .arg("./listen_tls_alpn.ts") - .arg("4504") - .stdout(std::process::Stdio::piped()) - .spawn() - .unwrap(); - let stdout = child.stdout.as_mut().unwrap(); - let mut msg = [0; 5]; - let read = stdout.read(&mut msg).unwrap(); - assert_eq!(read, 5); - assert_eq!(&msg, b"READY"); - - let mut reader = &mut BufReader::new(Cursor::new(include_bytes!( - "../testdata/tls/RootCA.crt" - ))); - let certs = rustls_pemfile::certs(&mut reader).unwrap(); - let mut root_store = rustls::RootCertStore::empty(); - root_store.add_parsable_certificates(&certs); - let mut cfg = rustls::ClientConfig::builder() - .with_safe_defaults() - .with_root_certificates(root_store) - .with_no_client_auth(); - cfg.alpn_protocols.push(b"foobar".to_vec()); - let cfg = Arc::new(cfg); - - let hostname = rustls::ServerName::try_from("localhost").unwrap(); - - let tcp_stream = tokio::net::TcpStream::connect("localhost:4504") - .await - .unwrap(); - let mut tls_stream = - TlsStream::new_client_side(tcp_stream, cfg, hostname); - - tls_stream.handshake().await.unwrap(); - - let (_, rustls_connection) = tls_stream.get_ref(); - let alpn = rustls_connection.alpn_protocol().unwrap(); - assert_eq!(alpn, b"foobar"); - - let status = child.wait().unwrap(); - assert!(status.success()); - }) - .await; -} - -#[tokio::test] -async fn listen_tls_alpn_fail() { - // TLS streams require the presence of an ambient local task set to gracefully - // close dropped connections in the background. - LocalSet::new() - .run_until(async { - let mut child = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg("--unstable") - .arg("--quiet") - .arg("--allow-net") - .arg("--allow-read") - .arg("./listen_tls_alpn_fail.ts") - .arg("4505") - .stdout(std::process::Stdio::piped()) - .spawn() - .unwrap(); - let stdout = child.stdout.as_mut().unwrap(); - let mut msg = [0; 5]; - let read = stdout.read(&mut msg).unwrap(); - assert_eq!(read, 5); - assert_eq!(&msg, b"READY"); - - let mut reader = &mut BufReader::new(Cursor::new(include_bytes!( - "../testdata/tls/RootCA.crt" - ))); - let certs = rustls_pemfile::certs(&mut reader).unwrap(); - let mut root_store = rustls::RootCertStore::empty(); - root_store.add_parsable_certificates(&certs); - let mut cfg = rustls::ClientConfig::builder() - .with_safe_defaults() - .with_root_certificates(root_store) - .with_no_client_auth(); - cfg.alpn_protocols.push(b"boofar".to_vec()); - let cfg = Arc::new(cfg); - - let hostname = rustls::ServerName::try_from("localhost").unwrap(); - - let tcp_stream = tokio::net::TcpStream::connect("localhost:4505") - .await - .unwrap(); - let mut tls_stream = - TlsStream::new_client_side(tcp_stream, cfg, hostname); - - tls_stream.handshake().await.unwrap_err(); - - let (_, rustls_connection) = tls_stream.get_ref(); - assert!(rustls_connection.alpn_protocol().is_none()); - - let status = child.wait().unwrap(); - assert!(status.success()); - }) - .await; -} - -#[tokio::test] -async fn http2_request_url() { - // TLS streams require the presence of an ambient local task set to gracefully - // close dropped connections in the background. - LocalSet::new() - .run_until(async { - let mut child = util::deno_cmd() - .current_dir(util::testdata_path()) - .arg("run") - .arg("--unstable") - .arg("--quiet") - .arg("--allow-net") - .arg("--allow-read") - .arg("./http2_request_url.ts") - .arg("4506") - .stdout(std::process::Stdio::piped()) - .spawn() - .unwrap(); - let stdout = child.stdout.as_mut().unwrap(); - let mut buffer = [0; 5]; - let read = stdout.read(&mut buffer).unwrap(); - assert_eq!(read, 5); - let msg = std::str::from_utf8(&buffer).unwrap(); - assert_eq!(msg, "READY"); - - let cert = reqwest::Certificate::from_pem(include_bytes!( - "../testdata/tls/RootCA.crt" - )) - .unwrap(); - - let client = reqwest::Client::builder() - .add_root_certificate(cert) - .http2_prior_knowledge() - .build() - .unwrap(); - - let res = client.get("http://127.0.0.1:4506").send().await.unwrap(); - assert_eq!(200, res.status()); - - let body = res.text().await.unwrap(); - assert_eq!(body, "http://127.0.0.1:4506/"); - - child.kill().unwrap(); - child.wait().unwrap(); - }) - .await; -} diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs index cdeb36c9cc..44c7ec08ff 100644 --- a/cli/tests/integration/repl_tests.rs +++ b/cli/tests/integration/repl_tests.rs @@ -160,9 +160,9 @@ fn pty_complete_expression() { fn pty_complete_imports() { util::with_pty(&["repl"], |mut console| { // single quotes - console.write_line("import './001_hel\t'"); + console.write_line("import './run/001_hel\t'"); // double quotes - console.write_line("import { output } from \"./045_out\t\""); + console.write_line("import { output } from \"./run/045_out\t\""); console.write_line("output('testing output');"); console.write_line("close();"); @@ -179,7 +179,7 @@ fn pty_complete_imports() { // ensure when the directory changes that the suggestions come from the cwd util::with_pty(&["repl"], |mut console| { console.write_line("Deno.chdir('./subdir');"); - console.write_line("import '../001_hel\t'"); + console.write_line("import '../run/001_hel\t'"); console.write_line("close();"); let output = console.read_all_output(); @@ -750,7 +750,7 @@ fn eval_flag_runtime_error() { fn eval_file_flag_valid_input() { let (out, err) = util::run_and_collect_output_with_args( true, - vec!["repl", "--eval-file=./001_hello.js"], + vec!["repl", "--eval-file=./run/001_hello.js"], None, None, false, @@ -789,7 +789,7 @@ fn eval_file_flag_http_input() { fn eval_file_flag_multiple_files() { let (out, err) = util::run_and_collect_output_with_args( true, - vec!["repl", "--eval-file=http://127.0.0.1:4545/import_type.ts,./tsc/d.ts,http://127.0.0.1:4545/type_definitions/foo.js"], + vec!["repl", "--eval-file=http://127.0.0.1:4545/repl/import_type.ts,./tsc/d.ts,http://127.0.0.1:4545/type_definitions/foo.js"], Some(vec!["b.method1=v4", "b.method1()+foo.toUpperCase()"]), None, true, diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index d4dfbb32bc..55dac8573f 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -1,10 +1,16 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. use deno_core::url; +use deno_runtime::deno_fetch::reqwest; +use std::io::Read; +use std::io::Write; use std::process::Command; use std::process::Stdio; use test_util as util; use test_util::TempDir; +use tokio::task::LocalSet; +use trust_dns_client::serialize::txt::Lexer; +use trust_dns_client::serialize::txt::Parser; use util::assert_contains; itest!(stdout_write_all { @@ -24,248 +30,251 @@ itest!(stdout_write_sync_async { }); itest!(_001_hello { - args: "run --reload 001_hello.js", - output: "001_hello.js.out", + args: "run --reload run/001_hello.js", + output: "run/001_hello.js.out", }); itest!(_002_hello { - args: "run --quiet --reload 002_hello.ts", - output: "002_hello.ts.out", + args: "run --quiet --reload run/002_hello.ts", + output: "run/002_hello.ts.out", }); itest!(_003_relative_import { - args: "run --quiet --reload 003_relative_import.ts", - output: "003_relative_import.ts.out", + args: "run --quiet --reload run/003_relative_import.ts", + output: "run/003_relative_import.ts.out", }); itest!(_004_set_timeout { - args: "run --quiet --reload 004_set_timeout.ts", - output: "004_set_timeout.ts.out", + args: "run --quiet --reload run/004_set_timeout.ts", + output: "run/004_set_timeout.ts.out", }); itest!(_005_more_imports { - args: "run --quiet --reload 005_more_imports.ts", - output: "005_more_imports.ts.out", + args: "run --quiet --reload run/005_more_imports.ts", + output: "run/005_more_imports.ts.out", }); itest!(_006_url_imports { - args: "run --quiet --reload 006_url_imports.ts", - output: "006_url_imports.ts.out", + args: "run --quiet --reload run/006_url_imports.ts", + output: "run/006_url_imports.ts.out", http_server: true, }); itest!(_012_async { - args: "run --quiet --reload 012_async.ts", - output: "012_async.ts.out", + args: "run --quiet --reload run/012_async.ts", + output: "run/012_async.ts.out", }); itest!(_013_dynamic_import { - args: "run --quiet --reload --allow-read 013_dynamic_import.ts", - output: "013_dynamic_import.ts.out", + args: "run --quiet --reload --allow-read run/013_dynamic_import.ts", + output: "run/013_dynamic_import.ts.out", }); itest!(_014_duplicate_import { - args: "run --quiet --reload --allow-read 014_duplicate_import.ts ", - output: "014_duplicate_import.ts.out", + args: "run --quiet --reload --allow-read run/014_duplicate_import.ts ", + output: "run/014_duplicate_import.ts.out", }); itest!(_015_duplicate_parallel_import { - args: "run --quiet --reload --allow-read 015_duplicate_parallel_import.js", - output: "015_duplicate_parallel_import.js.out", + args: + "run --quiet --reload --allow-read run/015_duplicate_parallel_import.js", + output: "run/015_duplicate_parallel_import.js.out", }); itest!(_016_double_await { - args: "run --quiet --allow-read --reload 016_double_await.ts", - output: "016_double_await.ts.out", + args: "run --quiet --allow-read --reload run/016_double_await.ts", + output: "run/016_double_await.ts.out", }); itest!(_017_import_redirect { - args: "run --quiet --reload 017_import_redirect.ts", - output: "017_import_redirect.ts.out", + args: "run --quiet --reload run/017_import_redirect.ts", + output: "run/017_import_redirect.ts.out", }); itest!(_017_import_redirect_nocheck { - args: "run --quiet --reload --no-check 017_import_redirect.ts", - output: "017_import_redirect.ts.out", + args: "run --quiet --reload --no-check run/017_import_redirect.ts", + output: "run/017_import_redirect.ts.out", }); itest!(_017_import_redirect_info { - args: "info --quiet --reload 017_import_redirect.ts", - output: "017_import_redirect_info.out", + args: "info --quiet --reload run/017_import_redirect.ts", + output: "run/017_import_redirect_info.out", }); itest!(_018_async_catch { - args: "run --quiet --reload 018_async_catch.ts", - output: "018_async_catch.ts.out", + args: "run --quiet --reload run/018_async_catch.ts", + output: "run/018_async_catch.ts.out", }); itest!(_019_media_types { - args: "run --reload 019_media_types.ts", - output: "019_media_types.ts.out", + args: "run --reload run/019_media_types.ts", + output: "run/019_media_types.ts.out", http_server: true, }); itest!(_020_json_modules { - args: "run --reload 020_json_modules.ts", - output: "020_json_modules.ts.out", + args: "run --reload run/020_json_modules.ts", + output: "run/020_json_modules.ts.out", exit_code: 1, }); itest!(_021_mjs_modules { - args: "run --quiet --reload 021_mjs_modules.ts", - output: "021_mjs_modules.ts.out", + args: "run --quiet --reload run/021_mjs_modules.ts", + output: "run/021_mjs_modules.ts.out", }); itest!(_023_no_ext { - args: "run --reload --check 023_no_ext", - output: "023_no_ext.out", + args: "run --reload --check run/023_no_ext", + output: "run/023_no_ext.out", }); // TODO(lucacasonato): remove --unstable when permissions goes stable itest!(_025_hrtime { - args: "run --quiet --allow-hrtime --unstable --reload 025_hrtime.ts", - output: "025_hrtime.ts.out", + args: "run --quiet --allow-hrtime --unstable --reload run/025_hrtime.ts", + output: "run/025_hrtime.ts.out", }); itest!(_025_reload_js_type_error { - args: "run --quiet --reload 025_reload_js_type_error.js", - output: "025_reload_js_type_error.js.out", + args: "run --quiet --reload run/025_reload_js_type_error.js", + output: "run/025_reload_js_type_error.js.out", }); itest!(_026_redirect_javascript { - args: "run --quiet --reload 026_redirect_javascript.js", - output: "026_redirect_javascript.js.out", + args: "run --quiet --reload run/026_redirect_javascript.js", + output: "run/026_redirect_javascript.js.out", http_server: true, }); itest!(_027_redirect_typescript { - args: "run --quiet --reload 027_redirect_typescript.ts", - output: "027_redirect_typescript.ts.out", + args: "run --quiet --reload run/027_redirect_typescript.ts", + output: "run/027_redirect_typescript.ts.out", http_server: true, }); itest!(_028_args { - args: "run --quiet --reload 028_args.ts --arg1 val1 --arg2=val2 -- arg3 arg4", - output: "028_args.ts.out", + args: + "run --quiet --reload run/028_args.ts --arg1 val1 --arg2=val2 -- arg3 arg4", + output: "run/028_args.ts.out", }); itest!(_033_import_map { args: "run --quiet --reload --import-map=import_maps/import_map.json import_maps/test.ts", - output: "033_import_map.out", + output: "run/033_import_map.out", }); itest!(_033_import_map_remote { args: "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", + output: "run/033_import_map_remote.out", http_server: true, }); -itest!(_034_onload { - args: "run --quiet --reload 034_onload/main.ts", - output: "034_onload.out", +itest!(onload { + args: "run --quiet --reload run/onload/main.ts", + output: "run/onload/main.out", }); itest!(_035_cached_only_flag { - args: "run --reload --check --cached-only http://127.0.0.1:4545/019_media_types.ts", - output: "035_cached_only_flag.out", + args: "run --reload --check --cached-only http://127.0.0.1:4545/run/019_media_types.ts", + output: "run/035_cached_only_flag.out", exit_code: 1, http_server: true, }); itest!(_038_checkjs { // checking if JS file is run through TS compiler - args: "run --reload --config checkjs.tsconfig.json --check 038_checkjs.js", + args: + "run --reload --config run/checkjs.tsconfig.json --check run/038_checkjs.js", exit_code: 1, - output: "038_checkjs.js.out", + output: "run/038_checkjs.js.out", }); itest!(_042_dyn_import_evalcontext { - args: "run --quiet --allow-read --reload 042_dyn_import_evalcontext.ts", - output: "042_dyn_import_evalcontext.ts.out", + args: "run --quiet --allow-read --reload run/042_dyn_import_evalcontext.ts", + output: "run/042_dyn_import_evalcontext.ts.out", }); itest!(_044_bad_resource { - args: "run --quiet --reload --allow-read 044_bad_resource.ts", - output: "044_bad_resource.ts.out", + args: "run --quiet --reload --allow-read run/044_bad_resource.ts", + output: "run/044_bad_resource.ts.out", exit_code: 1, }); // TODO(bartlomieju): remove --unstable once Deno.spawn is stabilized itest!(_045_proxy { - args: "run -L debug --unstable --allow-net --allow-env --allow-run --allow-read --reload --quiet 045_proxy_test.ts", - output: "045_proxy_test.ts.out", + args: "run -L debug --unstable --allow-net --allow-env --allow-run --allow-read --reload --quiet run/045_proxy_test.ts", + output: "run/045_proxy_test.ts.out", http_server: true, }); itest!(_046_tsx { - args: "run --quiet --reload 046_jsx_test.tsx", - output: "046_jsx_test.tsx.out", + args: "run --quiet --reload run/046_jsx_test.tsx", + output: "run/046_jsx_test.tsx.out", }); itest!(_047_jsx { - args: "run --quiet --reload 047_jsx_test.jsx", - output: "047_jsx_test.jsx.out", + args: "run --quiet --reload run/047_jsx_test.jsx", + output: "run/047_jsx_test.jsx.out", }); itest!(_048_media_types_jsx { - args: "run --reload 048_media_types_jsx.ts", - output: "048_media_types_jsx.ts.out", + args: "run --reload run/048_media_types_jsx.ts", + output: "run/048_media_types_jsx.ts.out", http_server: true, }); itest!(_052_no_remote_flag { args: - "run --reload --check --no-remote http://127.0.0.1:4545/019_media_types.ts", - output: "052_no_remote_flag.out", + "run --reload --check --no-remote http://127.0.0.1:4545/run/019_media_types.ts", + output: "run/052_no_remote_flag.out", exit_code: 1, http_server: true, }); itest!(_056_make_temp_file_write_perm { args: - "run --quiet --allow-read --allow-write=./subdir/ 056_make_temp_file_write_perm.ts", - output: "056_make_temp_file_write_perm.out", + "run --quiet --allow-read --allow-write=./subdir/ run/056_make_temp_file_write_perm.ts", + output: "run/056_make_temp_file_write_perm.out", }); itest!(_058_tasks_microtasks_close { - args: "run --quiet 058_tasks_microtasks_close.ts", - output: "058_tasks_microtasks_close.ts.out", + args: "run --quiet run/058_tasks_microtasks_close.ts", + output: "run/058_tasks_microtasks_close.ts.out", }); itest!(_059_fs_relative_path_perm { - args: "run 059_fs_relative_path_perm.ts", - output: "059_fs_relative_path_perm.ts.out", + args: "run run/059_fs_relative_path_perm.ts", + output: "run/059_fs_relative_path_perm.ts.out", exit_code: 1, }); itest!(_070_location { - args: "run --location https://foo/bar?baz#bat 070_location.ts", - output: "070_location.ts.out", + args: "run --location https://foo/bar?baz#bat run/070_location.ts", + output: "run/070_location.ts.out", }); itest!(_071_location_unset { - args: "run 071_location_unset.ts", - output: "071_location_unset.ts.out", + args: "run run/071_location_unset.ts", + output: "run/071_location_unset.ts.out", }); itest!(_072_location_relative_fetch { - args: "run --location http://127.0.0.1:4545/ --allow-net 072_location_relative_fetch.ts", - output: "072_location_relative_fetch.ts.out", + args: "run --location http://127.0.0.1:4545/ --allow-net run/072_location_relative_fetch.ts", + output: "run/072_location_relative_fetch.ts.out", http_server: true, }); -// tests the serialization of webstorage (both localStorage and sessionStorage) -itest!(webstorage_serialization { - args: "run webstorage/serialization.ts", - output: "webstorage/serialization.ts.out", -}); - // tests the beforeunload event itest!(beforeunload_event { - args: "run before_unload.js", - output: "before_unload.js.out", + args: "run run/before_unload.js", + output: "run/before_unload.js.out", +}); + +// tests the serialization of webstorage (both localStorage and sessionStorage) +itest!(webstorage_serialization { + args: "run run/webstorage/serialization.ts", + output: "run/webstorage/serialization.ts.out", }); // tests to ensure that when `--location` is set, all code shares the same @@ -280,7 +289,7 @@ fn webstorage_location_shares_origin() { .arg("run") .arg("--location") .arg("https://example.com/a.ts") - .arg("webstorage/fixture.ts") + .arg("run/webstorage/fixture.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -295,7 +304,7 @@ fn webstorage_location_shares_origin() { .arg("run") .arg("--location") .arg("https://example.com/b.ts") - .arg("webstorage/logger.ts") + .arg("run/webstorage/logger.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -316,8 +325,8 @@ fn webstorage_config_file() { .current_dir(util::testdata_path()) .arg("run") .arg("--config") - .arg("webstorage/config_a.jsonc") - .arg("webstorage/fixture.ts") + .arg("run/webstorage/config_a.jsonc") + .arg("run/webstorage/fixture.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -331,8 +340,8 @@ fn webstorage_config_file() { .current_dir(util::testdata_path()) .arg("run") .arg("--config") - .arg("webstorage/config_b.jsonc") - .arg("webstorage/logger.ts") + .arg("run/webstorage/config_b.jsonc") + .arg("run/webstorage/logger.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -346,8 +355,8 @@ fn webstorage_config_file() { .current_dir(util::testdata_path()) .arg("run") .arg("--config") - .arg("webstorage/config_a.jsonc") - .arg("webstorage/logger.ts") + .arg("run/webstorage/config_a.jsonc") + .arg("run/webstorage/logger.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -370,8 +379,8 @@ fn webstorage_location_precedes_config() { .arg("--location") .arg("https://example.com/a.ts") .arg("--config") - .arg("webstorage/config_a.jsonc") - .arg("webstorage/fixture.ts") + .arg("run/webstorage/config_a.jsonc") + .arg("run/webstorage/fixture.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -387,8 +396,8 @@ fn webstorage_location_precedes_config() { .arg("--location") .arg("https://example.com/b.ts") .arg("--config") - .arg("webstorage/config_b.jsonc") - .arg("webstorage/logger.ts") + .arg("run/webstorage/config_b.jsonc") + .arg("run/webstorage/logger.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -408,7 +417,7 @@ fn webstorage_main_module() { let output = deno_cmd .current_dir(util::testdata_path()) .arg("run") - .arg("webstorage/fixture.ts") + .arg("run/webstorage/fixture.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -421,7 +430,7 @@ fn webstorage_main_module() { let output = deno_cmd .current_dir(util::testdata_path()) .arg("run") - .arg("webstorage/logger.ts") + .arg("run/webstorage/logger.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -434,7 +443,7 @@ fn webstorage_main_module() { let output = deno_cmd .current_dir(util::testdata_path()) .arg("run") - .arg("webstorage/fixture.ts") + .arg("run/webstorage/fixture.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -445,36 +454,37 @@ fn webstorage_main_module() { } itest!(_075_import_local_query_hash { - args: "run 075_import_local_query_hash.ts", - output: "075_import_local_query_hash.ts.out", + args: "run run/075_import_local_query_hash.ts", + output: "run/075_import_local_query_hash.ts.out", }); itest!(_077_fetch_empty { - args: "run -A 077_fetch_empty.ts", - output: "077_fetch_empty.ts.out", + args: "run -A run/077_fetch_empty.ts", + output: "run/077_fetch_empty.ts.out", exit_code: 1, }); itest!(_078_unload_on_exit { - args: "run 078_unload_on_exit.ts", - output: "078_unload_on_exit.ts.out", + args: "run run/078_unload_on_exit.ts", + output: "run/078_unload_on_exit.ts.out", exit_code: 1, }); itest!(_079_location_authentication { - args: "run --location https://foo:bar@baz/qux 079_location_authentication.ts", - output: "079_location_authentication.ts.out", + args: + "run --location https://foo:bar@baz/qux run/079_location_authentication.ts", + output: "run/079_location_authentication.ts.out", }); itest!(_081_location_relative_fetch_redirect { - args: "run --location http://127.0.0.1:4546/ --allow-net 081_location_relative_fetch_redirect.ts", - output: "081_location_relative_fetch_redirect.ts.out", + args: "run --location http://127.0.0.1:4546/ --allow-net run/081_location_relative_fetch_redirect.ts", + output: "run/081_location_relative_fetch_redirect.ts.out", http_server: true, }); itest!(_082_prepare_stack_trace_throw { - args: "run 082_prepare_stack_trace_throw.js", - output: "082_prepare_stack_trace_throw.js.out", + args: "run run/082_prepare_stack_trace_throw.js", + output: "run/082_prepare_stack_trace_throw.js.out", exit_code: 1, }); @@ -482,9 +492,10 @@ itest!(_082_prepare_stack_trace_throw { fn _083_legacy_external_source_map() { let _g = util::http_server(); let deno_dir = TempDir::new(); - let module_url = - url::Url::parse("http://localhost:4545/083_legacy_external_source_map.ts") - .unwrap(); + let module_url = url::Url::parse( + "http://localhost:4545/run/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()).unwrap(); @@ -505,35 +516,35 @@ fn _083_legacy_external_source_map() { assert_eq!(out, ""); } -itest!(_085_dynamic_import_async_error { - args: "run --allow-read 085_dynamic_import_async_error.ts", - output: "085_dynamic_import_async_error.ts.out", +itest!(dynamic_import_async_error { + args: "run --allow-read run/dynamic_import_async_error/main.ts", + output: "run/dynamic_import_async_error/main.out", }); -itest!(_086_dynamic_import_already_rejected { - args: "run --allow-read 086_dynamic_import_already_rejected.ts", - output: "086_dynamic_import_already_rejected.ts.out", +itest!(dynamic_import_already_rejected { + args: "run --allow-read run/dynamic_import_already_rejected/main.ts", + output: "run/dynamic_import_already_rejected/main.out", }); -itest!(_087_no_check_imports_not_used_as_values { - args: "run --config preserve_imports.tsconfig.json --no-check 087_no_check_imports_not_used_as_values.ts", - output: "087_no_check_imports_not_used_as_values.ts.out", +itest!(no_check_imports_not_used_as_values { + args: "run --config run/no_check_imports_not_used_as_values/preserve_imports.tsconfig.json --no-check run/no_check_imports_not_used_as_values/main.ts", + output: "run/no_check_imports_not_used_as_values/main.out", }); itest!(_088_dynamic_import_already_evaluating { - args: "run --allow-read 088_dynamic_import_already_evaluating.ts", - output: "088_dynamic_import_already_evaluating.ts.out", + args: "run --allow-read run/088_dynamic_import_already_evaluating.ts", + output: "run/088_dynamic_import_already_evaluating.ts.out", }); // TODO(bartlomieju): remove --unstable once Deno.spawn is stabilized itest!(_089_run_allow_list { - args: "run --unstable --allow-run=curl 089_run_allow_list.ts", - output: "089_run_allow_list.ts.out", + args: "run --unstable --allow-run=curl run/089_run_allow_list.ts", + output: "run/089_run_allow_list.ts.out", }); #[test] fn _090_run_permissions_request() { - let args = "run --quiet 090_run_permissions_request.ts"; + let args = "run --quiet run/090_run_permissions_request.ts"; use util::PtyData::*; util::test_pty2(args, vec![ Output("⚠️ ️Deno requests run access to \"ls\". Run again with --allow-run to bypass this prompt.\r\n Allow? [y/n (y = yes allow, n = no deny)]"), @@ -547,159 +558,161 @@ fn _090_run_permissions_request() { } itest!(_091_use_define_for_class_fields { - args: "run --check 091_use_define_for_class_fields.ts", - output: "091_use_define_for_class_fields.ts.out", + args: "run --check run/091_use_define_for_class_fields.ts", + output: "run/091_use_define_for_class_fields.ts.out", exit_code: 1, }); itest!(_092_import_map_unmapped_bare_specifier { - args: "run --import-map import_maps/import_map.json 092_import_map_unmapped_bare_specifier.ts", - output: "092_import_map_unmapped_bare_specifier.ts.out", + args: "run --import-map import_maps/import_map.json run/092_import_map_unmapped_bare_specifier.ts", + output: "run/092_import_map_unmapped_bare_specifier.ts.out", exit_code: 1, }); itest!(js_import_detect { - args: "run --quiet --reload js_import_detect.ts", - output: "js_import_detect.ts.out", + args: "run --quiet --reload run/js_import_detect.ts", + output: "run/js_import_detect.ts.out", exit_code: 0, }); itest!(blob_gc_finalization { - args: "run blob_gc_finalization.js", - output: "blob_gc_finalization.js.out", + args: "run run/blob_gc_finalization.js", + output: "run/blob_gc_finalization.js.out", exit_code: 0, }); itest!(fetch_response_finalization { - args: "run --v8-flags=--expose-gc --allow-net fetch_response_finalization.js", - output: "fetch_response_finalization.js.out", + args: + "run --v8-flags=--expose-gc --allow-net run/fetch_response_finalization.js", + output: "run/fetch_response_finalization.js.out", http_server: true, exit_code: 0, }); itest!(import_type { - args: "run --reload import_type.ts", - output: "import_type.ts.out", + args: "run --reload run/import_type.ts", + output: "run/import_type.ts.out", }); itest!(import_type_no_check { - args: "run --reload --no-check import_type.ts", - output: "import_type.ts.out", + args: "run --reload --no-check run/import_type.ts", + output: "run/import_type.ts.out", }); itest!(private_field_presence { - args: "run --reload private_field_presence.ts", - output: "private_field_presence.ts.out", + args: "run --reload run/private_field_presence.ts", + output: "run/private_field_presence.ts.out", }); itest!(private_field_presence_no_check { - args: "run --reload --no-check private_field_presence.ts", - output: "private_field_presence.ts.out", + args: "run --reload --no-check run/private_field_presence.ts", + output: "run/private_field_presence.ts.out", }); itest!(lock_write_requires_lock { args: "run --lock-write some_file.ts", - output: "lock_write_requires_lock.out", + output: "run/lock_write_requires_lock.out", exit_code: 1, }); // TODO(bartlomieju): remove --unstable once Deno.spawn is stabilized itest!(lock_write_fetch { args: - "run --quiet --allow-read --allow-write --allow-env --allow-run --unstable lock_write_fetch.ts", - output: "lock_write_fetch.ts.out", + "run --quiet --allow-read --allow-write --allow-env --allow-run --unstable run/lock_write_fetch/main.ts", + output: "run/lock_write_fetch/main.out", http_server: true, exit_code: 0, }); itest!(lock_check_ok { args: - "run --lock=lock_check_ok.json http://127.0.0.1:4545/003_relative_import.ts", - output: "003_relative_import.ts.out", + "run --lock=run/lock_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", + output: "run/003_relative_import.ts.out", http_server: true, }); itest!(lock_check_ok2 { - args: "run --lock=lock_check_ok2.json 019_media_types.ts", - output: "019_media_types.ts.out", + args: "run --lock=run/lock_check_ok2.json run/019_media_types.ts", + output: "run/019_media_types.ts.out", http_server: true, }); itest!(lock_dynamic_imports { - 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", + args: "run --lock=run/lock_dynamic_imports.json --allow-read --allow-net http://127.0.0.1:4545/run/013_dynamic_import.ts", + output: "run/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/003_relative_import.ts", - output: "lock_check_err.out", + args: "run --lock=run/lock_check_err.json http://127.0.0.1:4545/run/003_relative_import.ts", + output: "run/lock_check_err.out", exit_code: 10, http_server: true, }); itest!(lock_check_err2 { - args: "run --lock=lock_check_err2.json 019_media_types.ts", - output: "lock_check_err2.out", + args: "run --lock=run/lock_check_err2.json run/019_media_types.ts", + output: "run/lock_check_err2.out", exit_code: 10, http_server: true, }); itest!(mts_dmts_mjs { args: "run subdir/import.mts", - output: "mts_dmts_mjs.out", + output: "run/mts_dmts_mjs.out", }); itest!(mts_dmts_mjs_no_check { args: "run --no-check subdir/import.mts", - output: "mts_dmts_mjs.out", + output: "run/mts_dmts_mjs.out", }); itest!(async_error { exit_code: 1, - args: "run --reload async_error.ts", - output: "async_error.ts.out", + args: "run --reload run/async_error.ts", + output: "run/async_error.ts.out", }); itest!(config { - args: "run --reload --config config.tsconfig.json --check config.ts", - output: "config.ts.out", + args: + "run --reload --config run/config/tsconfig.json --check run/config/main.ts", + output: "run/config/main.out", }); itest!(config_types { args: - "run --reload --quiet --config config_types.tsconfig.json config_types.ts", - output: "config_types.ts.out", + "run --reload --quiet --config run/config_types/tsconfig.json run/config_types/main.ts", + output: "run/config_types/main.out", }); itest!(config_types_remote { http_server: true, - args: "run --reload --quiet --config config_types_remote.tsconfig.json config_types.ts", - output: "config_types.ts.out", + args: "run --reload --quiet --config run/config_types/remote.tsconfig.json run/config_types/main.ts", + output: "run/config_types/main.out", }); itest!(empty_typescript { - args: "run --reload --check subdir/empty.ts", - output_str: Some("Check file:[WILDCARD]/subdir/empty.ts\n"), + args: "run --reload --check run/empty.ts", + output_str: Some("Check file:[WILDCARD]/run/empty.ts\n"), }); itest!(error_001 { - args: "run --reload error_001.ts", + args: "run --reload run/error_001.ts", exit_code: 1, - output: "error_001.ts.out", + output: "run/error_001.ts.out", }); itest!(error_002 { - args: "run --reload error_002.ts", + args: "run --reload run/error_002.ts", exit_code: 1, - output: "error_002.ts.out", + output: "run/error_002.ts.out", }); itest!(error_003_typescript { - args: "run --reload --check error_003_typescript.ts", + args: "run --reload --check run/error_003_typescript.ts", exit_code: 1, - output: "error_003_typescript.ts.out", + output: "run/error_003_typescript.ts.out", }); // Supposing that we've already attempted to run error_003_typescript.ts @@ -707,820 +720,816 @@ itest!(error_003_typescript { // should result in the same output. // https://github.com/denoland/deno/issues/2436 itest!(error_003_typescript2 { - args: "run --check error_003_typescript.ts", + args: "run --check run/error_003_typescript.ts", exit_code: 1, - output: "error_003_typescript.ts.out", + output: "run/error_003_typescript.ts.out", }); itest!(error_004_missing_module { - args: "run --reload error_004_missing_module.ts", + args: "run --reload run/error_004_missing_module.ts", exit_code: 1, - output: "error_004_missing_module.ts.out", + output: "run/error_004_missing_module.ts.out", }); itest!(error_005_missing_dynamic_import { - args: "run --reload --allow-read --quiet error_005_missing_dynamic_import.ts", + args: + "run --reload --allow-read --quiet run/error_005_missing_dynamic_import.ts", exit_code: 1, - output: "error_005_missing_dynamic_import.ts.out", + output: "run/error_005_missing_dynamic_import.ts.out", }); itest!(error_006_import_ext_failure { - args: "run --reload error_006_import_ext_failure.ts", + args: "run --reload run/error_006_import_ext_failure.ts", exit_code: 1, - output: "error_006_import_ext_failure.ts.out", + output: "run/error_006_import_ext_failure.ts.out", }); itest!(error_007_any { - args: "run --reload error_007_any.ts", + args: "run --reload run/error_007_any.ts", exit_code: 1, - output: "error_007_any.ts.out", + output: "run/error_007_any.ts.out", }); itest!(error_008_checkjs { - args: "run --reload error_008_checkjs.js", + args: "run --reload run/error_008_checkjs.js", exit_code: 1, - output: "error_008_checkjs.js.out", + output: "run/error_008_checkjs.js.out", }); itest!(error_009_extensions_error { - args: "run error_009_extensions_error.js", - output: "error_009_extensions_error.js.out", + args: "run run/error_009_extensions_error.js", + output: "run/error_009_extensions_error.js.out", exit_code: 1, }); itest!(error_011_bad_module_specifier { - args: "run --reload error_011_bad_module_specifier.ts", + args: "run --reload run/error_011_bad_module_specifier.ts", exit_code: 1, - output: "error_011_bad_module_specifier.ts.out", + output: "run/error_011_bad_module_specifier.ts.out", }); itest!(error_012_bad_dynamic_import_specifier { - args: "run --reload --check error_012_bad_dynamic_import_specifier.ts", + args: "run --reload --check run/error_012_bad_dynamic_import_specifier.ts", exit_code: 1, - output: "error_012_bad_dynamic_import_specifier.ts.out", + output: "run/error_012_bad_dynamic_import_specifier.ts.out", }); itest!(error_013_missing_script { args: "run --reload missing_file_name", exit_code: 1, - output: "error_013_missing_script.out", + output: "run/error_013_missing_script.out", }); itest!(error_014_catch_dynamic_import_error { - args: "run --reload --allow-read error_014_catch_dynamic_import_error.js", - output: "error_014_catch_dynamic_import_error.js.out", + args: + "run --reload --allow-read run/error_014_catch_dynamic_import_error.js", + output: "run/error_014_catch_dynamic_import_error.js.out", }); itest!(error_015_dynamic_import_permissions { - args: "run --reload --quiet error_015_dynamic_import_permissions.js", - output: "error_015_dynamic_import_permissions.out", + args: "run --reload --quiet run/error_015_dynamic_import_permissions.js", + output: "run/error_015_dynamic_import_permissions.out", exit_code: 1, http_server: true, }); // We have an allow-net flag but not allow-read, it should still result in error. itest!(error_016_dynamic_import_permissions2 { - args: "run --reload --allow-net error_016_dynamic_import_permissions2.js", - output: "error_016_dynamic_import_permissions2.out", + args: "run --reload --allow-net run/error_016_dynamic_import_permissions2.js", + output: "run/error_016_dynamic_import_permissions2.out", exit_code: 1, http_server: true, }); itest!(error_017_hide_long_source_ts { - args: "run --reload --check error_017_hide_long_source_ts.ts", - output: "error_017_hide_long_source_ts.ts.out", + args: "run --reload --check run/error_017_hide_long_source_ts.ts", + output: "run/error_017_hide_long_source_ts.ts.out", exit_code: 1, }); itest!(error_018_hide_long_source_js { - args: "run error_018_hide_long_source_js.js", - output: "error_018_hide_long_source_js.js.out", + args: "run run/error_018_hide_long_source_js.js", + output: "run/error_018_hide_long_source_js.js.out", exit_code: 1, }); itest!(error_019_stack_function { - args: "run error_019_stack_function.ts", - output: "error_019_stack_function.ts.out", + args: "run run/error_019_stack_function.ts", + output: "run/error_019_stack_function.ts.out", exit_code: 1, }); itest!(error_020_stack_constructor { - args: "run error_020_stack_constructor.ts", - output: "error_020_stack_constructor.ts.out", + args: "run run/error_020_stack_constructor.ts", + output: "run/error_020_stack_constructor.ts.out", exit_code: 1, }); itest!(error_021_stack_method { - args: "run error_021_stack_method.ts", - output: "error_021_stack_method.ts.out", + args: "run run/error_021_stack_method.ts", + output: "run/error_021_stack_method.ts.out", exit_code: 1, }); itest!(error_022_stack_custom_error { - args: "run error_022_stack_custom_error.ts", - output: "error_022_stack_custom_error.ts.out", + args: "run run/error_022_stack_custom_error.ts", + output: "run/error_022_stack_custom_error.ts.out", exit_code: 1, }); itest!(error_023_stack_async { - args: "run error_023_stack_async.ts", - output: "error_023_stack_async.ts.out", + args: "run run/error_023_stack_async.ts", + output: "run/error_023_stack_async.ts.out", exit_code: 1, }); itest!(error_024_stack_promise_all { - args: "run error_024_stack_promise_all.ts", - output: "error_024_stack_promise_all.ts.out", + args: "run run/error_024_stack_promise_all.ts", + output: "run/error_024_stack_promise_all.ts.out", exit_code: 1, }); itest!(error_025_tab_indent { - args: "run error_025_tab_indent", - output: "error_025_tab_indent.out", + args: "run run/error_025_tab_indent", + output: "run/error_025_tab_indent.out", exit_code: 1, }); itest!(error_026_remote_import_error { - args: "run error_026_remote_import_error.ts", - output: "error_026_remote_import_error.ts.out", + args: "run run/error_026_remote_import_error.ts", + output: "run/error_026_remote_import_error.ts.out", exit_code: 1, http_server: true, }); itest!(error_for_await { - args: "run --reload --check error_for_await.ts", - output: "error_for_await.ts.out", + args: "run --reload --check run/error_for_await.ts", + output: "run/error_for_await.ts.out", exit_code: 1, }); itest!(error_missing_module_named_import { - args: "run --reload error_missing_module_named_import.ts", - output: "error_missing_module_named_import.ts.out", + args: "run --reload run/error_missing_module_named_import.ts", + output: "run/error_missing_module_named_import.ts.out", exit_code: 1, }); itest!(error_no_check { - args: "run --reload --no-check error_no_check.ts", - output: "error_no_check.ts.out", + args: "run --reload --no-check run/error_no_check.ts", + output: "run/error_no_check.ts.out", exit_code: 1, }); itest!(error_syntax { - args: "run --reload error_syntax.js", + args: "run --reload run/error_syntax.js", exit_code: 1, - output: "error_syntax.js.out", + output: "run/error_syntax.js.out", }); itest!(error_syntax_empty_trailing_line { - args: "run --reload error_syntax_empty_trailing_line.mjs", + args: "run --reload run/error_syntax_empty_trailing_line.mjs", exit_code: 1, - output: "error_syntax_empty_trailing_line.mjs.out", + output: "run/error_syntax_empty_trailing_line.mjs.out", }); itest!(error_type_definitions { - args: "run --reload --check error_type_definitions.ts", + args: "run --reload --check run/error_type_definitions.ts", exit_code: 1, - output: "error_type_definitions.ts.out", + output: "run/error_type_definitions.ts.out", }); itest!(error_local_static_import_from_remote_ts { - args: "run --reload http://localhost:4545/error_local_static_import_from_remote.ts", + args: "run --reload http://localhost:4545/run/error_local_static_import_from_remote.ts", exit_code: 1, http_server: true, - output: "error_local_static_import_from_remote.ts.out", + output: "run/error_local_static_import_from_remote.ts.out", }); itest!(error_local_static_import_from_remote_js { - args: "run --reload http://localhost:4545/error_local_static_import_from_remote.js", + args: "run --reload http://localhost:4545/run/error_local_static_import_from_remote.js", exit_code: 1, http_server: true, - output: "error_local_static_import_from_remote.js.out", + output: "run/error_local_static_import_from_remote.js.out", }); itest!(exit_error42 { exit_code: 42, - args: "run --quiet --reload exit_error42.ts", - output: "exit_error42.ts.out", + args: "run --quiet --reload run/exit_error42.ts", + output: "run/exit_error42.ts.out", }); itest!(set_exit_code_0 { - args: "run --no-check --unstable set_exit_code_0.ts", - output: "empty.out", + args: "run --no-check --unstable run/set_exit_code_0.ts", + output_str: Some(""), exit_code: 0, }); itest!(set_exit_code_1 { - args: "run --no-check --unstable set_exit_code_1.ts", - output: "empty.out", + args: "run --no-check --unstable run/set_exit_code_1.ts", + output_str: Some(""), exit_code: 42, }); itest!(set_exit_code_2 { - args: "run --no-check --unstable set_exit_code_2.ts", - output: "empty.out", + args: "run --no-check --unstable run/set_exit_code_2.ts", + output_str: Some(""), exit_code: 42, }); itest!(op_exit_op_set_exit_code_in_worker { - args: "run --no-check --unstable --allow-read op_exit_op_set_exit_code_in_worker.ts", + args: "run --no-check --unstable --allow-read run/op_exit_op_set_exit_code_in_worker.ts", exit_code: 21, - output: "empty.out", + output_str: Some(""), }); itest!(deno_exit_tampering { - args: "run --no-check --unstable deno_exit_tampering.ts", - output: "empty.out", + args: "run --no-check --unstable run/deno_exit_tampering.ts", + output_str: Some(""), exit_code: 42, }); itest!(heapstats { - args: "run --quiet --unstable --v8-flags=--expose-gc heapstats.js", - output: "heapstats.js.out", + args: "run --quiet --unstable --v8-flags=--expose-gc run/heapstats.js", + output: "run/heapstats.js.out", }); itest!(finalization_registry { args: - "run --quiet --unstable --v8-flags=--expose-gc finalization_registry.js", - output: "finalization_registry.js.out", + "run --quiet --unstable --v8-flags=--expose-gc run/finalization_registry.js", + output: "run/finalization_registry.js.out", }); itest!(https_import { - args: "run --quiet --reload --cert tls/RootCA.pem https_import.ts", - output: "https_import.ts.out", + args: "run --quiet --reload --cert tls/RootCA.pem run/https_import.ts", + output: "run/https_import.ts.out", http_server: true, }); itest!(if_main { - args: "run --quiet --reload if_main.ts", - output: "if_main.ts.out", + args: "run --quiet --reload run/if_main.ts", + output: "run/if_main.ts.out", }); itest!(import_meta { - args: "run --quiet --reload --import-map=import_meta.importmap.json import_meta.ts", - output: "import_meta.ts.out", + args: "run --quiet --reload --import-map=run/import_meta/importmap.json run/import_meta/main.ts", + output: "run/import_meta/main.out", }); itest!(main_module { - args: "run --quiet --allow-read --reload main_module.ts", - output: "main_module.ts.out", + args: "run --quiet --allow-read --reload run/main_module/main.ts", + output: "run/main_module/main.out", }); itest!(no_check { - args: "run --quiet --reload --no-check 006_url_imports.ts", - output: "006_url_imports.ts.out", + args: "run --quiet --reload --no-check run/006_url_imports.ts", + output: "run/006_url_imports.ts.out", http_server: true, }); itest!(no_check_decorators { - args: "run --quiet --reload --no-check no_check_decorators.ts", - output: "no_check_decorators.ts.out", + args: "run --quiet --reload --no-check run/no_check_decorators.ts", + output: "run/no_check_decorators.ts.out", }); itest!(check_remote { - args: "run --quiet --reload --check=all no_check_remote.ts", - output: "no_check_remote.ts.disabled.out", + args: "run --quiet --reload --check=all run/no_check_remote.ts", + output: "run/no_check_remote.ts.disabled.out", exit_code: 1, http_server: true, }); itest!(no_check_remote { - args: "run --quiet --reload --no-check=remote no_check_remote.ts", - output: "no_check_remote.ts.enabled.out", + args: "run --quiet --reload --no-check=remote run/no_check_remote.ts", + output: "run/no_check_remote.ts.enabled.out", http_server: true, }); itest!(runtime_decorators { - args: "run --quiet --reload --no-check runtime_decorators.ts", - output: "runtime_decorators.ts.out", + args: "run --quiet --reload --no-check run/runtime_decorators.ts", + output: "run/runtime_decorators.ts.out", }); itest!(seed_random { - args: "run --seed=100 seed_random.js", - output: "seed_random.js.out", + args: "run --seed=100 run/seed_random.js", + output: "run/seed_random.js.out", }); itest!(type_definitions { - args: "run --reload type_definitions.ts", - output: "type_definitions.ts.out", + args: "run --reload run/type_definitions.ts", + output: "run/type_definitions.ts.out", }); itest!(type_definitions_for_export { - args: "run --reload --check type_definitions_for_export.ts", - output: "type_definitions_for_export.ts.out", + args: "run --reload --check run/type_definitions_for_export.ts", + output: "run/type_definitions_for_export.ts.out", exit_code: 1, }); itest!(type_directives_01 { - args: "run --reload --check=all -L debug type_directives_01.ts", - output: "type_directives_01.ts.out", + args: "run --reload --check=all -L debug run/type_directives_01.ts", + output: "run/type_directives_01.ts.out", http_server: true, }); itest!(type_directives_02 { - args: "run --reload --check=all -L debug type_directives_02.ts", - output: "type_directives_02.ts.out", + args: "run --reload --check=all -L debug run/type_directives_02.ts", + output: "run/type_directives_02.ts.out", }); itest!(type_directives_js_main { - args: "run --reload -L debug type_directives_js_main.js", - output: "type_directives_js_main.js.out", + args: "run --reload -L debug run/type_directives_js_main.js", + output: "run/type_directives_js_main.js.out", exit_code: 0, }); itest!(type_directives_redirect { - args: "run --reload --check type_directives_redirect.ts", - output: "type_directives_redirect.ts.out", + args: "run --reload --check run/type_directives_redirect.ts", + output: "run/type_directives_redirect.ts.out", http_server: true, }); itest!(type_headers_deno_types { - args: "run --reload --check type_headers_deno_types.ts", - output: "type_headers_deno_types.ts.out", + args: "run --reload --check run/type_headers_deno_types.ts", + output: "run/type_headers_deno_types.ts.out", http_server: true, }); itest!(ts_type_imports { - args: "run --reload --check ts_type_imports.ts", - output: "ts_type_imports.ts.out", + args: "run --reload --check run/ts_type_imports.ts", + output: "run/ts_type_imports.ts.out", exit_code: 1, }); itest!(ts_decorators { - args: "run --reload --check ts_decorators.ts", - output: "ts_decorators.ts.out", + args: "run --reload --check run/ts_decorators.ts", + output: "run/ts_decorators.ts.out", }); itest!(ts_type_only_import { - args: "run --reload --check ts_type_only_import.ts", - output: "ts_type_only_import.ts.out", + args: "run --reload --check run/ts_type_only_import.ts", + output: "run/ts_type_only_import.ts.out", }); itest!(swc_syntax_error { - args: "run --reload --check swc_syntax_error.ts", - output: "swc_syntax_error.ts.out", + args: "run --reload --check run/swc_syntax_error.ts", + output: "run/swc_syntax_error.ts.out", exit_code: 1, }); itest!(unbuffered_stderr { - args: "run --reload unbuffered_stderr.ts", - output: "unbuffered_stderr.ts.out", + args: "run --reload run/unbuffered_stderr.ts", + output: "run/unbuffered_stderr.ts.out", }); itest!(unbuffered_stdout { - args: "run --quiet --reload unbuffered_stdout.ts", - output: "unbuffered_stdout.ts.out", + args: "run --quiet --reload run/unbuffered_stdout.ts", + output: "run/unbuffered_stdout.ts.out", }); itest!(v8_flags_run { - args: "run --v8-flags=--expose-gc v8_flags.js", - output: "v8_flags.js.out", + args: "run --v8-flags=--expose-gc run/v8_flags.js", + output: "run/v8_flags.js.out", }); itest!(v8_flags_unrecognized { args: "repl --v8-flags=--foo,bar,--trace-gc,-baz", - output: "v8_flags_unrecognized.out", + output: "run/v8_flags_unrecognized.out", exit_code: 1, }); itest!(v8_help { args: "repl --v8-flags=--help", - output: "v8_help.out", + output: "run/v8_help.out", }); itest!(unsupported_dynamic_import_scheme { args: "eval import('xxx:')", - output: "unsupported_dynamic_import_scheme.out", + output: "run/unsupported_dynamic_import_scheme.out", exit_code: 1, }); itest!(wasm { - args: "run --quiet wasm.ts", - output: "wasm.ts.out", + args: "run --quiet run/wasm.ts", + output: "run/wasm.ts.out", }); itest!(wasm_shared { - args: "run --quiet wasm_shared.ts", - output: "wasm_shared.out", + args: "run --quiet run/wasm_shared.ts", + output: "run/wasm_shared.out", }); itest!(wasm_async { - args: "run wasm_async.js", - output: "wasm_async.out", + args: "run run/wasm_async.js", + output: "run/wasm_async.out", }); itest!(wasm_unreachable { - args: "run --allow-read wasm_unreachable.js", - output: "wasm_unreachable.out", + args: "run --allow-read run/wasm_unreachable.js", + output: "run/wasm_unreachable.out", exit_code: 1, }); itest!(wasm_url { - args: "run --quiet --allow-net=localhost:4545 wasm_url.js", - output: "wasm_url.out", + args: "run --quiet --allow-net=localhost:4545 run/wasm_url.js", + output: "run/wasm_url.out", exit_code: 1, http_server: true, }); itest!(weakref { - args: "run --quiet --reload weakref.ts", - output: "weakref.ts.out", + args: "run --quiet --reload run/weakref.ts", + output: "run/weakref.ts.out", }); itest!(top_level_await_order { - args: "run --allow-read top_level_await_order.js", - output: "top_level_await_order.out", + args: "run --allow-read run/top_level_await/order.js", + output: "run/top_level_await/order.out", }); itest!(top_level_await_loop { - args: "run --allow-read top_level_await_loop.js", - output: "top_level_await_loop.out", + args: "run --allow-read run/top_level_await/loop.js", + output: "run/top_level_await/loop.out", }); itest!(top_level_await_circular { - args: "run --allow-read top_level_await_circular.js", - output: "top_level_await_circular.out", + args: "run --allow-read run/top_level_await/circular.js", + output: "run/top_level_await/circular.out", exit_code: 1, }); // Regression test for https://github.com/denoland/deno/issues/11238. itest!(top_level_await_nested { - args: "run --allow-read top_level_await_nested/main.js", - output: "top_level_await_nested.out", + args: "run --allow-read run/top_level_await/nested/main.js", + output: "run/top_level_await/nested.out", }); itest!(top_level_await_unresolved { - args: "run top_level_await_unresolved.js", - output: "top_level_await_unresolved.out", + args: "run run/top_level_await/unresolved.js", + output: "run/top_level_await/unresolved.out", exit_code: 1, }); itest!(top_level_await { - args: "run --allow-read top_level_await.js", - output: "top_level_await.out", + args: "run --allow-read run/top_level_await/top_level_await.js", + output: "run/top_level_await/top_level_await.out", }); itest!(top_level_await_ts { - args: "run --quiet --allow-read top_level_await.ts", - output: "top_level_await.out", + args: "run --quiet --allow-read run/top_level_await/top_level_await.ts", + output: "run/top_level_await/top_level_await.out", }); itest!(top_level_for_await { - args: "run --quiet top_level_for_await.js", - output: "top_level_for_await.out", + args: "run --quiet run/top_level_await/top_level_for_await.js", + output: "run/top_level_await/top_level_for_await.out", }); itest!(top_level_for_await_ts { - args: "run --quiet top_level_for_await.ts", - output: "top_level_for_await.out", + args: "run --quiet run/top_level_await/top_level_for_await.ts", + output: "run/top_level_await/top_level_for_await.out", }); itest!(unstable_disabled { - args: "run --reload --check unstable.ts", + args: "run --reload --check run/unstable.ts", exit_code: 1, - output: "unstable_disabled.out", + output: "run/unstable_disabled.out", }); itest!(unstable_enabled { - args: "run --quiet --reload --unstable unstable.ts", - output: "unstable_enabled.out", + args: "run --quiet --reload --unstable run/unstable.ts", + output: "run/unstable_enabled.out", }); itest!(unstable_disabled_js { - args: "run --reload unstable.js", - output: "unstable_disabled_js.out", + args: "run --reload run/unstable.js", + output: "run/unstable_disabled_js.out", }); itest!(unstable_enabled_js { - args: "run --quiet --reload --unstable unstable.ts", - output: "unstable_enabled_js.out", + args: "run --quiet --reload --unstable run/unstable.ts", + output: "run/unstable_enabled_js.out", }); itest!(unstable_worker { - args: "run --reload --unstable --quiet --allow-read unstable_worker.ts", - output: "unstable_worker.ts.out", + args: "run --reload --unstable --quiet --allow-read run/unstable_worker.ts", + output: "run/unstable_worker.ts.out", }); -itest!(_053_import_compression { - args: "run --quiet --reload --allow-net 053_import_compression/main.ts", - output: "053_import_compression.out", +itest!(import_compression { + args: "run --quiet --reload --allow-net run/import_compression/main.ts", + output: "run/import_compression/main.out", http_server: true, }); itest!(disallow_http_from_https_js { - args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/disallow_http_from_https.js", - output: "disallow_http_from_https_js.out", + args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.js", + output: "run/disallow_http_from_https_js.out", http_server: true, exit_code: 1, }); itest!(disallow_http_from_https_ts { - args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/disallow_http_from_https.ts", - output: "disallow_http_from_https_ts.out", + args: "run --quiet --reload --cert tls/RootCA.pem https://localhost:5545/run/disallow_http_from_https.ts", + output: "run/disallow_http_from_https_ts.out", http_server: true, exit_code: 1, }); itest!(dynamic_import_conditional { - args: "run --quiet --reload dynamic_import_conditional.js", - output: "dynamic_import_conditional.js.out", + args: "run --quiet --reload run/dynamic_import_conditional.js", + output: "run/dynamic_import_conditional.js.out", }); itest!(tsx_imports { - args: "run --reload --check tsx_imports.ts", - output: "tsx_imports.ts.out", + args: "run --reload --check run/tsx_imports/tsx_imports.ts", + output: "run/tsx_imports/tsx_imports.ts.out", }); itest!(fix_dynamic_import_errors { - args: "run --reload fix_dynamic_import_errors.js", - output: "fix_dynamic_import_errors.js.out", + args: "run --reload run/fix_dynamic_import_errors.js", + output: "run/fix_dynamic_import_errors.js.out", }); itest!(fix_emittable_skipped { - args: "run --reload fix_emittable_skipped.js", - output: "fix_emittable_skipped.ts.out", + args: "run --reload run/fix_emittable_skipped.js", + output: "run/fix_emittable_skipped.ts.out", }); itest!(fix_exotic_specifiers { - args: "run --quiet --reload fix_exotic_specifiers.ts", - output: "fix_exotic_specifiers.ts.out", + args: "run --quiet --reload run/fix_exotic_specifiers.ts", + output: "run/fix_exotic_specifiers.ts.out", }); itest!(fix_js_import_js { - args: "run --quiet --reload fix_js_import_js.ts", - output: "fix_js_import_js.ts.out", + args: "run --quiet --reload run/fix_js_import_js.ts", + output: "run/fix_js_import_js.ts.out", }); itest!(fix_js_imports { - args: "run --quiet --reload fix_js_imports.ts", - output: "fix_js_imports.ts.out", + args: "run --quiet --reload run/fix_js_imports.ts", + output: "run/fix_js_imports.ts.out", }); itest!(fix_tsc_file_exists { args: "run --quiet --reload tsc/test.js", - output: "fix_tsc_file_exists.out", + output: "run/fix_tsc_file_exists.out", }); itest!(fix_worker_dispatchevent { - args: "run --quiet --reload fix_worker_dispatchevent.ts", - output: "fix_worker_dispatchevent.ts.out", + args: "run --quiet --reload run/fix_worker_dispatchevent.ts", + output: "run/fix_worker_dispatchevent.ts.out", }); itest!(es_private_fields { - args: "run --quiet --reload es_private_fields.js", - output: "es_private_fields.js.out", + args: "run --quiet --reload run/es_private_fields.js", + output: "run/es_private_fields.js.out", }); itest!(cjs_imports { - args: "run --quiet --reload cjs_imports.ts", - output: "cjs_imports.ts.out", + args: "run --quiet --reload run/cjs_imports/main.ts", + output: "run/cjs_imports/main.out", }); itest!(ts_import_from_js { - args: "run --quiet --reload ts_import_from_js.js", - output: "ts_import_from_js.js.out", + args: "run --quiet --reload run/ts_import_from_js/main.js", + output: "run/ts_import_from_js/main.out", http_server: true, }); itest!(jsx_import_from_ts { - args: "run --quiet --reload jsx_import_from_ts.ts", - output: "jsx_import_from_ts.ts.out", + args: "run --quiet --reload run/jsx_import_from_ts.ts", + output: "run/jsx_import_from_ts.ts.out", }); itest!(jsx_import_source_pragma { - args: "run --reload jsx_import_source_pragma.tsx", - output: "jsx_import_source.out", + args: "run --reload run/jsx_import_source_pragma.tsx", + output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_config { - args: "run --reload --config jsx/deno-jsx.jsonc jsx_import_source_pragma.tsx", - output: "jsx_import_source.out", + args: + "run --reload --config jsx/deno-jsx.jsonc run/jsx_import_source_pragma.tsx", + output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_dev_config { args: - "run --reload --config jsx/deno-jsxdev.jsonc jsx_import_source_pragma.tsx", - output: "jsx_import_source_dev.out", + "run --reload --config jsx/deno-jsxdev.jsonc run/jsx_import_source_pragma.tsx", + output: "run/jsx_import_source_dev.out", http_server: true, }); itest!(jsx_import_source_no_pragma { args: - "run --reload --config jsx/deno-jsx.jsonc jsx_import_source_no_pragma.tsx", - output: "jsx_import_source.out", + "run --reload --config jsx/deno-jsx.jsonc run/jsx_import_source_no_pragma.tsx", + output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_no_pragma_dev { - args: "run --reload --config jsx/deno-jsxdev.jsonc jsx_import_source_no_pragma.tsx", - output: "jsx_import_source_dev.out", + args: "run --reload --config jsx/deno-jsxdev.jsonc run/jsx_import_source_no_pragma.tsx", + output: "run/jsx_import_source_dev.out", http_server: true, }); itest!(jsx_import_source_pragma_import_map { - args: "run --reload --import-map jsx/import-map.json jsx_import_source_pragma_import_map.tsx", - output: "jsx_import_source_import_map.out", + args: "run --reload --import-map jsx/import-map.json run/jsx_import_source_pragma_import_map.tsx", + output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_pragma_import_map_dev { - args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc jsx_import_source_pragma_import_map.tsx", - output: "jsx_import_source_import_map_dev.out", + args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_pragma_import_map.tsx", + output: "run/jsx_import_source_import_map_dev.out", http_server: true, }); itest!(jsx_import_source_import_map { - args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsx-import-map.jsonc jsx_import_source_no_pragma.tsx", - output: "jsx_import_source_import_map.out", + args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsx-import-map.jsonc run/jsx_import_source_no_pragma.tsx", + output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_import_map_dev { - args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc jsx_import_source_no_pragma.tsx", - output: "jsx_import_source_import_map_dev.out", + args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc run/jsx_import_source_no_pragma.tsx", + output: "run/jsx_import_source_import_map_dev.out", http_server: true, }); itest!(jsx_import_source_import_map_scoped { args: "run --reload --import-map jsx/import-map-scoped.json --config jsx/deno-jsx-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", - output: "jsx_import_source_import_map.out", + output: "run/jsx_import_source_import_map.out", http_server: true, }); itest!(jsx_import_source_import_map_scoped_dev { args: "run --reload --import-map jsx/import-map-scoped.json --config jsx/deno-jsxdev-import-map.jsonc subdir/jsx_import_source_no_pragma.tsx", - output: "jsx_import_source_import_map_dev.out", + output: "run/jsx_import_source_import_map_dev.out", http_server: true, }); itest!(jsx_import_source_pragma_no_check { - args: "run --reload --no-check jsx_import_source_pragma.tsx", - output: "jsx_import_source.out", + args: "run --reload --no-check run/jsx_import_source_pragma.tsx", + output: "run/jsx_import_source.out", http_server: true, }); itest!(jsx_import_source_pragma_with_config_no_check { - args: "run --reload --config jsx/deno-jsx.jsonc --no-check jsx_import_source_pragma.tsx", - output: "jsx_import_source.out", + args: "run --reload --config jsx/deno-jsx.jsonc --no-check run/jsx_import_source_pragma.tsx", + output: "run/jsx_import_source.out", http_server: true, }); -// itest!(jsx_import_source_pragma_with_dev_config_no_check { -// args: -// "run --reload --config jsx/deno-jsxdev.jsonc --no-check jsx_import_source_pragma.tsx", -// output: "jsx_import_source_dev.out", -// http_server: true, -// }); - itest!(jsx_import_source_no_pragma_no_check { args: - "run --reload --config jsx/deno-jsx.jsonc --no-check jsx_import_source_no_pragma.tsx", - output: "jsx_import_source.out", + "run --reload --config jsx/deno-jsx.jsonc --no-check run/jsx_import_source_no_pragma.tsx", + output: "run/jsx_import_source.out", http_server: true, }); -// itest!(jsx_import_source_no_pragma_dev_no_check { -// args: "run --reload --config jsx/deno-jsxdev.jsonc --no-check jsx_import_source_no_pragma.tsx", -// output: "jsx_import_source_dev.out", -// http_server: true, -// }); - itest!(jsx_import_source_pragma_import_map_no_check { - args: "run --reload --import-map jsx/import-map.json --no-check jsx_import_source_pragma_import_map.tsx", - output: "jsx_import_source_import_map.out", + args: "run --reload --import-map jsx/import-map.json --no-check run/jsx_import_source_pragma_import_map.tsx", + output: "run/jsx_import_source_import_map.out", http_server: true, }); -// itest!(jsx_import_source_pragma_import_map_dev_no_check { -// args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc --no-check jsx_import_source_pragma_import_map.tsx", -// output: "jsx_import_source_import_map_dev.out", -// http_server: true, -// }); - itest!(jsx_import_source_import_map_no_check { - args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsx-import-map.jsonc --no-check jsx_import_source_no_pragma.tsx", - output: "jsx_import_source_import_map.out", + args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsx-import-map.jsonc --no-check run/jsx_import_source_no_pragma.tsx", + output: "run/jsx_import_source_import_map.out", http_server: true, }); -// itest!(jsx_import_source_import_map_dev_no_check { -// args: "run --reload --import-map jsx/import-map.json --config jsx/deno-jsxdev-import-map.jsonc --no-check jsx_import_source_no_pragma.tsx", -// output: "jsx_import_source_import_map_dev.out", -// http_server: true, -// }); +itest!(jsx_import_source_error { + args: "run --config jsx/deno-jsx-error.jsonc --check run/jsx_import_source_no_pragma.tsx", + output: "run/jsx_import_source_error.out", + exit_code: 1, +}); // TODO(#11128): Flaky. Re-enable later. // itest!(single_compile_with_reload { -// args: "run --reload --allow-read single_compile_with_reload.ts", -// output: "single_compile_with_reload.ts.out", +// args: "run --relcert/oad --allow-read run/single_compile_with_reload.ts", +// output: "run/single_compile_with_reload.ts.out", // }); itest!(proto_exploit { - args: "run proto_exploit.js", - output: "proto_exploit.js.out", + args: "run run/proto_exploit.js", + output: "run/proto_exploit.js.out", }); itest!(reference_types { - args: "run --reload --quiet reference_types.ts", - output: "reference_types.ts.out", + args: "run --reload --quiet run/reference_types.ts", + output: "run/reference_types.ts.out", }); itest!(references_types_remote { http_server: true, - args: "run --reload --quiet reference_types_remote.ts", - output: "reference_types_remote.ts.out", + args: "run --reload --quiet run/reference_types_remote.ts", + output: "run/reference_types_remote.ts.out", +}); + +itest!(reference_types_error { + args: + "run --config run/checkjs.tsconfig.json --check run/reference_types_error.js", + output: "run/reference_types_error.js.out", + exit_code: 1, +}); + +itest!(reference_types_error_no_check { + args: "run --no-check run/reference_types_error.js", + output_str: Some(""), }); itest!(import_data_url_error_stack { - args: "run --quiet --reload import_data_url_error_stack.ts", - output: "import_data_url_error_stack.ts.out", + args: "run --quiet --reload run/import_data_url_error_stack.ts", + output: "run/import_data_url_error_stack.ts.out", exit_code: 1, }); itest!(import_data_url_import_relative { - args: "run --quiet --reload import_data_url_import_relative.ts", - output: "import_data_url_import_relative.ts.out", + args: "run --quiet --reload run/import_data_url_import_relative.ts", + output: "run/import_data_url_import_relative.ts.out", exit_code: 1, }); itest!(import_data_url_import_map { - args: "run --quiet --reload --import-map import_maps/import_map.json import_data_url.ts", - output: "import_data_url.ts.out", + args: "run --quiet --reload --import-map import_maps/import_map.json run/import_data_url.ts", + output: "run/import_data_url.ts.out", }); itest!(import_data_url_imports { - args: "run --quiet --reload import_data_url_imports.ts", - output: "import_data_url_imports.ts.out", + args: "run --quiet --reload run/import_data_url_imports.ts", + output: "run/import_data_url_imports.ts.out", http_server: true, }); itest!(import_data_url_jsx { - args: "run --quiet --reload import_data_url_jsx.ts", - output: "import_data_url_jsx.ts.out", + args: "run --quiet --reload run/import_data_url_jsx.ts", + output: "run/import_data_url_jsx.ts.out", }); itest!(import_data_url { - args: "run --quiet --reload import_data_url.ts", - output: "import_data_url.ts.out", + args: "run --quiet --reload run/import_data_url.ts", + output: "run/import_data_url.ts.out", }); itest!(import_dynamic_data_url { - args: "run --quiet --reload import_dynamic_data_url.ts", - output: "import_dynamic_data_url.ts.out", + args: "run --quiet --reload run/import_dynamic_data_url.ts", + output: "run/import_dynamic_data_url.ts.out", }); itest!(import_blob_url_error_stack { - args: "run --quiet --reload import_blob_url_error_stack.ts", - output: "import_blob_url_error_stack.ts.out", + args: "run --quiet --reload run/import_blob_url_error_stack.ts", + output: "run/import_blob_url_error_stack.ts.out", exit_code: 1, }); itest!(import_blob_url_import_relative { - args: "run --quiet --reload import_blob_url_import_relative.ts", - output: "import_blob_url_import_relative.ts.out", + args: "run --quiet --reload run/import_blob_url_import_relative.ts", + output: "run/import_blob_url_import_relative.ts.out", exit_code: 1, }); itest!(import_blob_url_imports { args: - "run --quiet --reload --allow-net=localhost:4545 import_blob_url_imports.ts", - output: "import_blob_url_imports.ts.out", + "run --quiet --reload --allow-net=localhost:4545 run/import_blob_url_imports.ts", + output: "run/import_blob_url_imports.ts.out", http_server: true, }); itest!(import_blob_url_jsx { - args: "run --quiet --reload import_blob_url_jsx.ts", - output: "import_blob_url_jsx.ts.out", + args: "run --quiet --reload run/import_blob_url_jsx.ts", + output: "run/import_blob_url_jsx.ts.out", }); itest!(import_blob_url { - args: "run --quiet --reload import_blob_url.ts", - output: "import_blob_url.ts.out", + args: "run --quiet --reload run/import_blob_url.ts", + output: "run/import_blob_url.ts.out", }); itest!(import_file_with_colon { - args: "run --quiet --reload import_file_with_colon.ts", - output: "import_file_with_colon.ts.out", + args: "run --quiet --reload run/import_file_with_colon.ts", + output: "run/import_file_with_colon.ts.out", http_server: true, }); itest!(import_extensionless { - args: "run --quiet --reload import_extensionless.ts", - output: "import_extensionless.ts.out", + args: "run --quiet --reload run/import_extensionless.ts", + output: "run/import_extensionless.ts.out", http_server: true, }); itest!(classic_workers_event_loop { args: - "run --enable-testing-features-do-not-use classic_workers_event_loop.js", - output: "classic_workers_event_loop.js.out", + "run --enable-testing-features-do-not-use run/classic_workers_event_loop.js", + output: "run/classic_workers_event_loop.js.out", }); // FIXME(bartlomieju): disabled, because this test is very flaky on CI // itest!(local_sources_not_cached_in_memory { -// args: "run --allow-read --allow-write no_mem_cache.js", -// output: "no_mem_cache.js.out", +// args: "run --allow-read --allow-write run/no_mem_cache.js", +// output: "run/no_mem_cache.js.out", // }); // This test checks that inline source map data is used. It uses a hand crafted @@ -1529,8 +1538,8 @@ itest!(classic_workers_event_loop { // Source line is not remapped because no inline source contents are included in // the sourcemap and the file is not present in the dependency graph. itest!(inline_js_source_map_2 { - args: "run --quiet inline_js_source_map_2.js", - output: "inline_js_source_map_2.js.out", + args: "run --quiet run/inline_js_source_map_2.js", + output: "run/inline_js_source_map_2.js.out", exit_code: 1, }); @@ -1540,8 +1549,8 @@ itest!(inline_js_source_map_2 { // Source line remapped using th inline source contents that are included in the // inline source map. itest!(inline_js_source_map_2_with_inline_contents { - args: "run --quiet inline_js_source_map_2_with_inline_contents.js", - output: "inline_js_source_map_2_with_inline_contents.js.out", + args: "run --quiet run/inline_js_source_map_2_with_inline_contents.js", + output: "run/inline_js_source_map_2_with_inline_contents.js.out", exit_code: 1, }); @@ -1552,8 +1561,8 @@ itest!(inline_js_source_map_2_with_inline_contents { // was not commented out. The source line is remapped using source contents that // from the module graph. itest!(inline_js_source_map_with_contents_from_graph { - args: "run --quiet inline_js_source_map_with_contents_from_graph.js", - output: "inline_js_source_map_with_contents_from_graph.js.out", + args: "run --quiet run/inline_js_source_map_with_contents_from_graph.js", + output: "run/inline_js_source_map_with_contents_from_graph.js.out", exit_code: 1, http_server: true, }); @@ -1564,78 +1573,62 @@ itest!(inline_js_source_map_with_contents_from_graph { // `program_state.maybe_import_map` to access the import map underneath. itest!(error_import_map_unable_to_load { args: "run --import-map=import_maps/does_not_exist.json import_maps/test.ts", - output: "error_import_map_unable_to_load.out", + output: "run/error_import_map_unable_to_load.out", exit_code: 1, }); // Test that setting `self` in the main thread to some other value doesn't break // the world. itest!(replace_self { - args: "run replace_self.js", - output: "replace_self.js.out", + args: "run run/replace_self.js", + output: "run/replace_self.js.out", }); itest!(worker_event_handler_test { - args: "run --quiet --reload --allow-read worker_event_handler_test.js", - output: "worker_event_handler_test.js.out", + args: "run --quiet --reload --allow-read run/worker_event_handler_test.js", + output: "run/worker_event_handler_test.js.out", }); itest!(worker_close_race { - args: "run --quiet --reload --allow-read worker_close_race.js", - output: "worker_close_race.js.out", + args: "run --quiet --reload --allow-read run/worker_close_race.js", + output: "run/worker_close_race.js.out", }); itest!(worker_drop_handle_race { - args: "run --quiet --reload --allow-read worker_drop_handle_race.js", - output: "worker_drop_handle_race.js.out", + args: "run --quiet --reload --allow-read run/worker_drop_handle_race.js", + output: "run/worker_drop_handle_race.js.out", exit_code: 1, }); itest!(worker_drop_handle_race_terminate { - args: "run --unstable worker_drop_handle_race_terminate.js", - output: "worker_drop_handle_race_terminate.js.out", + args: "run --unstable run/worker_drop_handle_race_terminate.js", + output: "run/worker_drop_handle_race_terminate.js.out", }); itest!(worker_close_nested { - args: "run --quiet --reload --allow-read worker_close_nested.js", - output: "worker_close_nested.js.out", + args: "run --quiet --reload --allow-read run/worker_close_nested.js", + output: "run/worker_close_nested.js.out", }); itest!(worker_message_before_close { - args: "run --quiet --reload --allow-read worker_message_before_close.js", - output: "worker_message_before_close.js.out", + args: "run --quiet --reload --allow-read run/worker_message_before_close.js", + output: "run/worker_message_before_close.js.out", }); itest!(worker_close_in_wasm_reactions { - args: "run --quiet --reload --allow-read worker_close_in_wasm_reactions.js", - output: "worker_close_in_wasm_reactions.js.out", -}); - -itest!(reference_types_error { - args: "run --config checkjs.tsconfig.json --check reference_types_error.js", - output: "reference_types_error.js.out", - exit_code: 1, -}); - -itest!(reference_types_error_no_check { - args: "run --no-check reference_types_error.js", - output_str: Some(""), -}); - -itest!(jsx_import_source_error { - args: "run --config jsx/deno-jsx-error.jsonc --check jsx_import_source_no_pragma.tsx", - output: "jsx_import_source_error.out", - exit_code: 1, + args: + "run --quiet --reload --allow-read run/worker_close_in_wasm_reactions.js", + output: "run/worker_close_in_wasm_reactions.js.out", }); itest!(shebang_tsc { - args: "run --quiet shebang.ts", - output: "shebang.ts.out", + args: "run --quiet --check run/shebang.ts", + output: "run/shebang.ts.out", }); itest!(shebang_swc { - args: "run --quiet --no-check shebang.ts", - output: "shebang.ts.out", + args: "run --quiet run/shebang.ts", + output: "run/shebang.ts.out", }); itest!(shebang_with_json_imports_tsc { @@ -1655,7 +1648,7 @@ fn no_validate_asm() { let output = util::deno_cmd() .current_dir(util::testdata_path()) .arg("run") - .arg("no_validate_asm.js") + .arg("run/no_validate_asm.js") .stderr(Stdio::piped()) .stdout(Stdio::piped()) .spawn() @@ -1673,7 +1666,7 @@ fn exec_path() { .current_dir(util::testdata_path()) .arg("run") .arg("--allow-read") - .arg("exec_path.ts") + .arg("run/exec_path.ts") .stdout(Stdio::piped()) .spawn() .unwrap() @@ -1701,7 +1694,7 @@ fn run_deno_script_constrained( script_path: std::path::PathBuf, constraints: WinProcConstraints, ) -> Result<(), i64> { - let file_path = "DenoWinRunner.ps1"; + let file_path = "assets/DenoWinRunner.ps1"; let constraints = match constraints { WinProcConstraints::NoStdIn => "1", WinProcConstraints::NoStdOut => "2", @@ -1799,7 +1792,7 @@ fn rust_log() { let output = util::deno_cmd() .current_dir(util::testdata_path()) .arg("run") - .arg("001_hello.js") + .arg("run/001_hello.js") .stderr(Stdio::piped()) .spawn() .unwrap() @@ -1812,7 +1805,7 @@ fn rust_log() { let output = util::deno_cmd() .current_dir(util::testdata_path()) .arg("run") - .arg("001_hello.js") + .arg("run/001_hello.js") .env("RUST_LOG", "debug") .stderr(Stdio::piped()) .spawn() @@ -1833,7 +1826,7 @@ fn dont_cache_on_check_fail() { .arg("run") .arg("--check=all") .arg("--reload") - .arg("error_003_typescript.ts") + .arg("run/error_003_typescript.ts") .stderr(Stdio::piped()) .spawn() .unwrap() @@ -1847,7 +1840,7 @@ fn dont_cache_on_check_fail() { .current_dir(util::testdata_path()) .arg("run") .arg("--check=all") - .arg("error_003_typescript.ts") + .arg("run/error_003_typescript.ts") .stderr(Stdio::piped()) .spawn() .unwrap() @@ -1869,7 +1862,7 @@ mod permissions { .arg("run") .arg("--unstable") .arg(format!("--allow-{0}", permission)) - .arg("permission_test.ts") + .arg("run/permission_test.ts") .arg(format!("{0}Required", permission)) .spawn() .unwrap() @@ -1885,7 +1878,10 @@ mod permissions { for permission in &util::PERMISSION_VARIANTS { let (_, err) = util::run_and_collect_output( false, - &format!("run --unstable permission_test.ts {0}Required", permission), + &format!( + "run --unstable run/permission_test.ts {0}Required", + permission + ), None, None, false, @@ -1909,9 +1905,9 @@ mod permissions { .into_string() .unwrap() )) - .arg("complex_permissions_test.ts") + .arg("run/complex_permissions_test.ts") .arg(permission) - .arg("complex_permissions_test.ts") + .arg("run/complex_permissions_test.ts") .spawn() .unwrap() .wait() @@ -1927,7 +1923,7 @@ mod permissions { let (_, err) = util::run_and_collect_output( false, &format!( - "run --allow-{0}={1} complex_permissions_test.ts {0} {2}", + "run --allow-{0}={1} run/complex_permissions_test.ts {0} {2}", permission, util::testdata_path() .into_os_string() @@ -1962,9 +1958,9 @@ mod permissions { .into_string() .unwrap() )) - .arg("complex_permissions_test.ts") + .arg("run/complex_permissions_test.ts") .arg(permission) - .arg("complex_permissions_test.ts") + .arg("run/complex_permissions_test.ts") .spawn() .unwrap() .wait() @@ -1989,7 +1985,7 @@ mod permissions { let (_, err) = util::run_and_collect_output( false, &format!( - "run --allow-{0}={1},{2} complex_permissions_test.ts {0} {3}", + "run --allow-{0}={1},{2} run/complex_permissions_test.ts {0} {3}", permission, test_dir, js_dir, @@ -2024,9 +2020,9 @@ mod permissions { .current_dir(&util::testdata_path()) .arg("run") .arg(format!("--allow-{0}={1},{2}", permission, test_dir, js_dir)) - .arg("complex_permissions_test.ts") + .arg("run/complex_permissions_test.ts") .arg(permission) - .arg("complex_permissions_test.ts") + .arg("run/complex_permissions_test.ts") .spawn() .unwrap() .wait() @@ -2043,9 +2039,9 @@ mod permissions { .current_dir(&util::testdata_path()) .arg("run") .arg(format!("--allow-{0}=.", permission)) - .arg("complex_permissions_test.ts") + .arg("run/complex_permissions_test.ts") .arg(permission) - .arg("complex_permissions_test.ts") + .arg("run/complex_permissions_test.ts") .spawn() .unwrap() .wait() @@ -2062,9 +2058,9 @@ mod permissions { .current_dir(&util::testdata_path()) .arg("run") .arg(format!("--allow-{0}=tls/../", permission)) - .arg("complex_permissions_test.ts") + .arg("run/complex_permissions_test.ts") .arg(permission) - .arg("complex_permissions_test.ts") + .arg("run/complex_permissions_test.ts") .spawn() .unwrap() .wait() @@ -2077,7 +2073,7 @@ mod permissions { fn net_fetch_allow_localhost_4545() { let (_, err) = util::run_and_collect_output( true, - "run --allow-net=localhost:4545 complex_permissions_test.ts netFetch http://localhost:4545/", + "run --allow-net=localhost:4545 run/complex_permissions_test.ts netFetch http://localhost:4545/", None, None, true, @@ -2089,7 +2085,7 @@ mod permissions { fn net_fetch_allow_deno_land() { let (_, err) = util::run_and_collect_output( false, - "run --allow-net=deno.land complex_permissions_test.ts netFetch http://localhost:4545/", + "run --allow-net=deno.land run/complex_permissions_test.ts netFetch http://localhost:4545/", None, None, true, @@ -2101,7 +2097,7 @@ mod permissions { fn net_fetch_localhost_4545_fail() { let (_, err) = util::run_and_collect_output( false, - "run --allow-net=localhost:4545 complex_permissions_test.ts netFetch http://localhost:4546/", + "run --allow-net=localhost:4545 run/complex_permissions_test.ts netFetch http://localhost:4546/", None, None, true, @@ -2113,7 +2109,7 @@ mod permissions { fn net_fetch_localhost() { let (_, err) = util::run_and_collect_output( true, - "run --allow-net=localhost complex_permissions_test.ts netFetch http://localhost:4545/ http://localhost:4546/ http://localhost:4547/", + "run --allow-net=localhost run/complex_permissions_test.ts netFetch http://localhost:4545/ http://localhost:4546/ http://localhost:4547/", None, None, true, @@ -2125,7 +2121,7 @@ mod permissions { fn net_connect_allow_localhost_ip_4555() { let (_, err) = util::run_and_collect_output( true, - "run --allow-net=127.0.0.1:4545 complex_permissions_test.ts netConnect 127.0.0.1:4545", + "run --allow-net=127.0.0.1:4545 run/complex_permissions_test.ts netConnect 127.0.0.1:4545", None, None, true, @@ -2137,7 +2133,7 @@ mod permissions { fn net_connect_allow_deno_land() { let (_, err) = util::run_and_collect_output( false, - "run --allow-net=deno.land complex_permissions_test.ts netConnect 127.0.0.1:4546", + "run --allow-net=deno.land run/complex_permissions_test.ts netConnect 127.0.0.1:4546", None, None, true, @@ -2149,7 +2145,7 @@ mod permissions { fn net_connect_allow_localhost_ip_4545_fail() { let (_, err) = util::run_and_collect_output( false, - "run --allow-net=127.0.0.1:4545 complex_permissions_test.ts netConnect 127.0.0.1:4546", + "run --allow-net=127.0.0.1:4545 run/complex_permissions_test.ts netConnect 127.0.0.1:4546", None, None, true, @@ -2161,7 +2157,7 @@ mod permissions { fn net_connect_allow_localhost_ip() { let (_, err) = util::run_and_collect_output( true, - "run --allow-net=127.0.0.1 complex_permissions_test.ts netConnect 127.0.0.1:4545 127.0.0.1:4546 127.0.0.1:4547", + "run --allow-net=127.0.0.1 run/complex_permissions_test.ts netConnect 127.0.0.1:4545 127.0.0.1:4546 127.0.0.1:4547", None, None, true, @@ -2173,7 +2169,7 @@ mod permissions { fn net_listen_allow_localhost_4555() { let (_, err) = util::run_and_collect_output( true, - "run --allow-net=localhost:4558 complex_permissions_test.ts netListen localhost:4558", + "run --allow-net=localhost:4558 run/complex_permissions_test.ts netListen localhost:4558", None, None, false, @@ -2185,7 +2181,7 @@ mod permissions { fn net_listen_allow_deno_land() { let (_, err) = util::run_and_collect_output( false, - "run --allow-net=deno.land complex_permissions_test.ts netListen localhost:4545", + "run --allow-net=deno.land run/complex_permissions_test.ts netListen localhost:4545", None, None, false, @@ -2197,7 +2193,7 @@ mod permissions { fn net_listen_allow_localhost_4555_fail() { let (_, err) = util::run_and_collect_output( false, - "run --allow-net=localhost:4555 complex_permissions_test.ts netListen localhost:4556", + "run --allow-net=localhost:4555 run/complex_permissions_test.ts netListen localhost:4556", None, None, false, @@ -2211,7 +2207,7 @@ mod permissions { // target/debug/test_server let (_, err) = util::run_and_collect_output( true, - "run --allow-net=localhost complex_permissions_test.ts netListen localhost:4600", + "run --allow-net=localhost run/complex_permissions_test.ts netListen localhost:4600", None, None, false, @@ -2221,7 +2217,7 @@ mod permissions { #[test] fn _061_permissions_request() { - let args = "run --quiet 061_permissions_request.ts"; + let args = "run --quiet run/061_permissions_request.ts"; use util::PtyData::*; util::test_pty2(args, vec![ Output("⚠️ ️Deno requests read access to \"foo\". Run again with --allow-read to bypass this prompt.\r\n Allow? [y/n (y = yes allow, n = no deny)] "), @@ -2236,7 +2232,7 @@ mod permissions { #[test] fn _062_permissions_request_global() { - let args = "run --quiet 062_permissions_request_global.ts"; + let args = "run --quiet run/062_permissions_request_global.ts"; use util::PtyData::*; util::test_pty2(args, vec![ Output("⚠️ ️Deno requests read access. Run again with --allow-read to bypass this prompt.\r\n Allow? [y/n (y = yes allow, n = no deny)] "), @@ -2248,18 +2244,18 @@ mod permissions { } itest!(_063_permissions_revoke { - args: "run --allow-read=foo,bar 063_permissions_revoke.ts", - output: "063_permissions_revoke.ts.out", + args: "run --allow-read=foo,bar run/063_permissions_revoke.ts", + output: "run/063_permissions_revoke.ts.out", }); itest!(_064_permissions_revoke_global { - args: "run --allow-read=foo,bar 064_permissions_revoke_global.ts", - output: "064_permissions_revoke_global.ts.out", + args: "run --allow-read=foo,bar run/064_permissions_revoke_global.ts", + output: "run/064_permissions_revoke_global.ts.out", }); #[test] fn _066_prompt() { - let args = "run --quiet --unstable 066_prompt.ts"; + let args = "run --quiet --unstable run/066_prompt.ts"; use util::PtyData::*; util::test_pty2( args, @@ -2337,25 +2333,25 @@ mod permissions { } itest!(tls_starttls { - args: "run --quiet --reload --allow-net --allow-read --unstable --cert tls/RootCA.pem tls_starttls.js", - output: "tls.out", + args: "run --quiet --reload --allow-net --allow-read --unstable --cert tls/RootCA.pem run/tls_starttls.js", + output: "run/tls.out", }); itest!(tls_connecttls { - args: "run --quiet --reload --allow-net --allow-read --cert tls/RootCA.pem tls_connecttls.js", - output: "tls.out", + args: "run --quiet --reload --allow-net --allow-read --cert tls/RootCA.pem run/tls_connecttls.js", + output: "run/tls.out", }); itest!(byte_order_mark { - args: "run --no-check byte_order_mark.ts", - output: "byte_order_mark.out", + args: "run --no-check run/byte_order_mark.ts", + output: "run/byte_order_mark.out", }); #[test] fn issue9750() { use util::PtyData::*; util::test_pty2( - "run --prompt issue9750.js", + "run --prompt run/issue9750.js", vec![ Output("Enter 'yy':\r\n"), Input("yy\n"), @@ -2370,20 +2366,20 @@ fn issue9750() { // Regression test for https://github.com/denoland/deno/issues/11451. itest!(dom_exception_formatting { - args: "run dom_exception_formatting.ts", - output: "dom_exception_formatting.ts.out", + args: "run run/dom_exception_formatting.ts", + output: "run/dom_exception_formatting.ts.out", exit_code: 1, }); itest!(long_data_url_formatting { - args: "run long_data_url_formatting.ts", - output: "long_data_url_formatting.ts.out", + args: "run run/long_data_url_formatting.ts", + output: "run/long_data_url_formatting.ts.out", exit_code: 1, }); itest!(eval_context_throw_dom_exception { - args: "run eval_context_throw_dom_exception.js", - output: "eval_context_throw_dom_exception.js.out", + args: "run run/eval_context_throw_dom_exception.js", + output: "run/eval_context_throw_dom_exception.js.out", }); /// Regression test for https://github.com/denoland/deno/issues/12740. @@ -2459,8 +2455,8 @@ fn issue12807() { } itest!(issue_13562 { - args: "run issue13562.ts", - output: "issue13562.ts.out", + args: "run run/issue13562.ts", + output: "run/issue13562.ts.out", }); itest!(import_assertions_static_import { @@ -2497,12 +2493,12 @@ itest!(import_assertions_type_check { }); itest!(delete_window { - args: "run delete_window.js", + args: "run run/delete_window.js", output_str: Some("true\n"), }); itest!(colors_without_global_this { - args: "run colors_without_globalThis.js", + args: "run run/colors_without_globalThis.js", output_str: Some("true\n"), }); @@ -2524,166 +2520,166 @@ itest!(config_not_auto_discovered_for_remote_script { }); itest!(wasm_streaming_panic_test { - args: "run wasm_streaming_panic_test.js", - output: "wasm_streaming_panic_test.js.out", + args: "run run/wasm_streaming_panic_test.js", + output: "run/wasm_streaming_panic_test.js.out", exit_code: 1, }); // Regression test for https://github.com/denoland/deno/issues/13897. itest!(fetch_async_error_stack { - args: "run --quiet -A fetch_async_error_stack.ts", - output: "fetch_async_error_stack.ts.out", + args: "run --quiet -A run/fetch_async_error_stack.ts", + output: "run/fetch_async_error_stack.ts.out", exit_code: 1, }); itest!(unstable_ffi_1 { - args: "run unstable_ffi_1.js", - output: "unstable_ffi_1.js.out", + args: "run run/ffi/unstable_ffi_1.js", + output: "run/ffi/unstable_ffi_1.js.out", exit_code: 70, }); itest!(unstable_ffi_2 { - args: "run unstable_ffi_2.js", - output: "unstable_ffi_2.js.out", + args: "run run/ffi/unstable_ffi_2.js", + output: "run/ffi/unstable_ffi_2.js.out", exit_code: 70, }); itest!(unstable_ffi_3 { - args: "run unstable_ffi_3.js", - output: "unstable_ffi_3.js.out", + args: "run run/ffi/unstable_ffi_3.js", + output: "run/ffi/unstable_ffi_3.js.out", exit_code: 70, }); itest!(unstable_ffi_4 { - args: "run unstable_ffi_4.js", - output: "unstable_ffi_4.js.out", + args: "run run/ffi/unstable_ffi_4.js", + output: "run/ffi/unstable_ffi_4.js.out", exit_code: 70, }); itest!(unstable_ffi_5 { - args: "run unstable_ffi_5.js", - output: "unstable_ffi_5.js.out", + args: "run run/ffi/unstable_ffi_5.js", + output: "run/ffi/unstable_ffi_5.js.out", exit_code: 70, }); itest!(unstable_ffi_6 { - args: "run unstable_ffi_6.js", - output: "unstable_ffi_6.js.out", + args: "run run/ffi/unstable_ffi_6.js", + output: "run/ffi/unstable_ffi_6.js.out", exit_code: 70, }); itest!(unstable_ffi_7 { - args: "run unstable_ffi_7.js", - output: "unstable_ffi_7.js.out", + args: "run run/ffi/unstable_ffi_7.js", + output: "run/ffi/unstable_ffi_7.js.out", exit_code: 70, }); itest!(unstable_ffi_8 { - args: "run unstable_ffi_8.js", - output: "unstable_ffi_8.js.out", + args: "run run/ffi/unstable_ffi_8.js", + output: "run/ffi/unstable_ffi_8.js.out", exit_code: 70, }); itest!(unstable_ffi_9 { - args: "run unstable_ffi_9.js", - output: "unstable_ffi_9.js.out", + args: "run run/ffi/unstable_ffi_9.js", + output: "run/ffi/unstable_ffi_9.js.out", exit_code: 70, }); itest!(unstable_ffi_10 { - args: "run unstable_ffi_10.js", - output: "unstable_ffi_10.js.out", + args: "run run/ffi/unstable_ffi_10.js", + output: "run/ffi/unstable_ffi_10.js.out", exit_code: 70, }); itest!(unstable_ffi_11 { - args: "run unstable_ffi_11.js", - output: "unstable_ffi_11.js.out", + args: "run run/ffi/unstable_ffi_11.js", + output: "run/ffi/unstable_ffi_11.js.out", exit_code: 70, }); itest!(unstable_ffi_12 { - args: "run unstable_ffi_12.js", - output: "unstable_ffi_12.js.out", + args: "run run/ffi/unstable_ffi_12.js", + output: "run/ffi/unstable_ffi_12.js.out", exit_code: 70, }); itest!(unstable_ffi_13 { - args: "run unstable_ffi_13.js", - output: "unstable_ffi_13.js.out", + args: "run run/ffi/unstable_ffi_13.js", + output: "run/ffi/unstable_ffi_13.js.out", exit_code: 70, }); itest!(unstable_ffi_14 { - args: "run unstable_ffi_14.js", - output: "unstable_ffi_14.js.out", + args: "run run/ffi/unstable_ffi_14.js", + output: "run/ffi/unstable_ffi_14.js.out", exit_code: 70, }); itest!(unstable_ffi_15 { - args: "run unstable_ffi_15.js", - output: "unstable_ffi_15.js.out", + args: "run run/ffi/unstable_ffi_15.js", + output: "run/ffi/unstable_ffi_15.js.out", exit_code: 70, }); itest!(future_check2 { - args: "run --check future_check.ts", - output: "future_check2.out", + args: "run --check run/future_check.ts", + output: "run/future_check2.out", }); itest!(event_listener_error { - args: "run --quiet event_listener_error.ts", - output: "event_listener_error.ts.out", + args: "run --quiet run/event_listener_error.ts", + output: "run/event_listener_error.ts.out", exit_code: 1, }); itest!(event_listener_error_handled { - args: "run --quiet event_listener_error_handled.ts", - output: "event_listener_error_handled.ts.out", + args: "run --quiet run/event_listener_error_handled.ts", + output: "run/event_listener_error_handled.ts.out", }); // https://github.com/denoland/deno/pull/14159#issuecomment-1092285446 itest!(event_listener_error_immediate_exit { - args: "run --quiet event_listener_error_immediate_exit.ts", - output: "event_listener_error_immediate_exit.ts.out", + args: "run --quiet run/event_listener_error_immediate_exit.ts", + output: "run/event_listener_error_immediate_exit.ts.out", exit_code: 1, }); // https://github.com/denoland/deno/pull/14159#issuecomment-1092285446 itest!(event_listener_error_immediate_exit_worker { args: - "run --quiet --unstable -A event_listener_error_immediate_exit_worker.ts", - output: "event_listener_error_immediate_exit_worker.ts.out", + "run --quiet --unstable -A run/event_listener_error_immediate_exit_worker.ts", + output: "run/event_listener_error_immediate_exit_worker.ts.out", exit_code: 1, }); itest!(set_timeout_error { - args: "run --quiet set_timeout_error.ts", - output: "set_timeout_error.ts.out", + args: "run --quiet run/set_timeout_error.ts", + output: "run/set_timeout_error.ts.out", exit_code: 1, }); itest!(set_timeout_error_handled { - args: "run --quiet set_timeout_error_handled.ts", - output: "set_timeout_error_handled.ts.out", + args: "run --quiet run/set_timeout_error_handled.ts", + output: "run/set_timeout_error_handled.ts.out", }); itest!(aggregate_error { - args: "run --quiet aggregate_error.ts", - output: "aggregate_error.out", + args: "run --quiet run/aggregate_error.ts", + output: "run/aggregate_error.out", exit_code: 1, }); itest!(complex_error { - args: "run --quiet complex_error.ts", - output: "complex_error.ts.out", + args: "run --quiet run/complex_error.ts", + output: "run/complex_error.ts.out", exit_code: 1, }); // Regression test for https://github.com/denoland/deno/issues/12143. itest!(js_root_with_ts_check { - args: "run --quiet --check js_root_with_ts_check.js", - output: "js_root_with_ts_check.js.out", + args: "run --quiet --check run/js_root_with_ts_check.js", + output: "run/js_root_with_ts_check.js.out", exit_code: 1, }); @@ -2719,13 +2715,13 @@ fn check_local_then_remote() { // Regression test for https://github.com/denoland/deno/issues/15163 itest!(check_js_points_to_ts { - args: "run --quiet --check --config checkjs.tsconfig.json run/check_js_points_to_ts/test.js", + args: "run --quiet --check --config run/checkjs.tsconfig.json run/check_js_points_to_ts/test.js", output: "run/check_js_points_to_ts/test.js.out", exit_code: 1, }); itest!(no_prompt_flag { - args: "run --quiet --unstable --no-prompt no_prompt.ts", + args: "run --quiet --unstable --no-prompt run/no_prompt.ts", output_str: Some(""), }); @@ -2735,7 +2731,7 @@ fn deno_no_prompt_environment_variable() { .current_dir(util::testdata_path()) .arg("run") .arg("--unstable") - .arg("no_prompt.ts") + .arg("run/no_prompt.ts") .env("DENO_NO_PROMPT", "1") .spawn() .unwrap() @@ -2745,53 +2741,53 @@ fn deno_no_prompt_environment_variable() { } itest!(report_error { - args: "run --quiet report_error.ts", - output: "report_error.ts.out", + args: "run --quiet run/report_error.ts", + output: "run/report_error.ts.out", exit_code: 1, }); itest!(report_error_handled { - args: "run --quiet report_error_handled.ts", - output: "report_error_handled.ts.out", + args: "run --quiet run/report_error_handled.ts", + output: "run/report_error_handled.ts.out", }); // Regression test for https://github.com/denoland/deno/issues/15513. itest!(report_error_end_of_program { - args: "run --quiet report_error_end_of_program.ts", - output: "report_error_end_of_program.ts.out", + args: "run --quiet run/report_error_end_of_program.ts", + output: "run/report_error_end_of_program.ts.out", exit_code: 1, }); itest!(queue_microtask_error { - args: "run --quiet queue_microtask_error.ts", - output: "queue_microtask_error.ts.out", + args: "run --quiet run/queue_microtask_error.ts", + output: "run/queue_microtask_error.ts.out", exit_code: 1, }); itest!(queue_microtask_error_handled { - args: "run --quiet queue_microtask_error_handled.ts", - output: "queue_microtask_error_handled.ts.out", + args: "run --quiet run/queue_microtask_error_handled.ts", + output: "run/queue_microtask_error_handled.ts.out", }); itest!(spawn_stdout_inherit { - args: "run --quiet --unstable -A spawn_stdout_inherit.ts", - output: "spawn_stdout_inherit.ts.out", + args: "run --quiet --unstable -A run/spawn_stdout_inherit.ts", + output: "run/spawn_stdout_inherit.ts.out", }); itest!(error_name_non_string { - args: "run --quiet error_name_non_string.js", - output: "error_name_non_string.js.out", + args: "run --quiet run/error_name_non_string.js", + output: "run/error_name_non_string.js.out", exit_code: 1, }); itest!(custom_inspect_url { - args: "run custom_inspect_url.js", - output: "custom_inspect_url.js.out", + args: "run run/custom_inspect_url.js", + output: "run/custom_inspect_url.js.out", }); itest!(config_json_import { - args: "run --quiet -c jsx/deno-jsx.json config_json_import.ts", - output: "config_json_import.ts.out", + args: "run --quiet -c jsx/deno-jsx.json run/config_json_import.ts", + output: "run/config_json_import.ts.out", http_server: true, }); @@ -2815,39 +2811,732 @@ fn running_declaration_files() { } itest!(test_and_bench_are_noops_in_run { - args: "run test_and_bench_in_run.js", + args: "run run/test_and_bench_in_run.js", output_str: Some(""), }); itest!(followup_dyn_import_resolved { - args: "run --unstable --allow-read followup_dyn_import_resolves/main.ts", - output: "followup_dyn_import_resolves/main.ts.out", + args: "run --unstable --allow-read run/followup_dyn_import_resolves/main.ts", + output: "run/followup_dyn_import_resolves/main.ts.out", }); itest!(unhandled_rejection { - args: "run --check unhandled_rejection.ts", - output: "unhandled_rejection.ts.out", + args: "run --check run/unhandled_rejection.ts", + output: "run/unhandled_rejection.ts.out", }); itest!(unhandled_rejection_sync_error { - args: "run --check unhandled_rejection_sync_error.ts", - output: "unhandled_rejection_sync_error.ts.out", + args: "run --check run/unhandled_rejection_sync_error.ts", + output: "run/unhandled_rejection_sync_error.ts.out", }); itest!(nested_error { - args: "run nested_error.ts", - output: "nested_error.ts.out", + args: "run run/nested_error.ts", + output: "run/nested_error.ts.out", exit_code: 1, }); itest!(node_env_var_allowlist_with_unstable_flag { - args: "run --unstable --no-prompt node_env_var_allowlist.ts", - output: "node_env_var_allowlist_with_unstable_flag.ts.out", + args: "run --unstable --no-prompt run/node_env_var_allowlist.ts", + output: "run/node_env_var_allowlist_with_unstable_flag.ts.out", exit_code: 1, }); itest!(node_env_var_allowlist_without_unstable_flag { - args: "run --no-prompt node_env_var_allowlist.ts", - output: "node_env_var_allowlist_without_unstable_flag.ts.out", + args: "run --no-prompt run/node_env_var_allowlist.ts", + output: "run/node_env_var_allowlist_without_unstable_flag.ts.out", exit_code: 1, }); + +#[test] +fn cache_test() { + let _g = util::http_server(); + let deno_dir = TempDir::new(); + let module_url = + url::Url::parse("http://localhost:4545/run/006_url_imports.ts").unwrap(); + let output = Command::new(util::deno_exe_path()) + .env("DENO_DIR", deno_dir.path()) + .current_dir(util::testdata_path()) + .arg("cache") + .arg("--check=all") + .arg("-L") + .arg("debug") + .arg(module_url.to_string()) + .output() + .expect("Failed to spawn script"); + assert!(output.status.success()); + + let prg = util::deno_exe_path(); + let output = Command::new(&prg) + .env("DENO_DIR", deno_dir.path()) + .env("HTTP_PROXY", "http://nil") + .env("NO_COLOR", "1") + .current_dir(util::testdata_path()) + .arg("run") + .arg(module_url.to_string()) + .output() + .expect("Failed to spawn script"); + + let str_output = std::str::from_utf8(&output.stdout).unwrap(); + + let module_output_path = + util::testdata_path().join("run/006_url_imports.ts.out"); + let mut module_output = String::new(); + let mut module_output_file = std::fs::File::open(module_output_path).unwrap(); + module_output_file + .read_to_string(&mut module_output) + .unwrap(); + + assert_eq!(module_output, str_output); +} + +#[test] +fn cache_invalidation_test() { + let deno_dir = TempDir::new(); + let fixture_path = deno_dir.path().join("fixture.ts"); + { + let mut file = std::fs::File::create(fixture_path.clone()) + .expect("could not create fixture"); + file + .write_all(b"console.log(\"42\");") + .expect("could not write fixture"); + } + let output = Command::new(util::deno_exe_path()) + .env("DENO_DIR", deno_dir.path()) + .current_dir(util::testdata_path()) + .arg("run") + .arg(fixture_path.to_str().unwrap()) + .output() + .expect("Failed to spawn script"); + assert!(output.status.success()); + let actual = std::str::from_utf8(&output.stdout).unwrap(); + assert_eq!(actual, "42\n"); + { + let mut file = std::fs::File::create(fixture_path.clone()) + .expect("could not create fixture"); + file + .write_all(b"console.log(\"43\");") + .expect("could not write fixture"); + } + let output = Command::new(util::deno_exe_path()) + .env("DENO_DIR", deno_dir.path()) + .current_dir(util::testdata_path()) + .arg("run") + .arg(fixture_path.to_str().unwrap()) + .output() + .expect("Failed to spawn script"); + assert!(output.status.success()); + let actual = std::str::from_utf8(&output.stdout).unwrap(); + assert_eq!(actual, "43\n"); +} + +#[test] +fn cache_invalidation_test_no_check() { + let deno_dir = TempDir::new(); + let fixture_path = deno_dir.path().join("fixture.ts"); + { + let mut file = std::fs::File::create(fixture_path.clone()) + .expect("could not create fixture"); + file + .write_all(b"console.log(\"42\");") + .expect("could not write fixture"); + } + let output = Command::new(util::deno_exe_path()) + .env("DENO_DIR", deno_dir.path()) + .current_dir(util::testdata_path()) + .arg("run") + .arg("--no-check") + .arg(fixture_path.to_str().unwrap()) + .output() + .expect("Failed to spawn script"); + assert!(output.status.success()); + let actual = std::str::from_utf8(&output.stdout).unwrap(); + assert_eq!(actual, "42\n"); + { + let mut file = std::fs::File::create(fixture_path.clone()) + .expect("could not create fixture"); + file + .write_all(b"console.log(\"43\");") + .expect("could not write fixture"); + } + let output = Command::new(util::deno_exe_path()) + .env("DENO_DIR", deno_dir.path()) + .current_dir(util::testdata_path()) + .arg("run") + .arg("--no-check") + .arg(fixture_path.to_str().unwrap()) + .output() + .expect("Failed to spawn script"); + assert!(output.status.success()); + let actual = std::str::from_utf8(&output.stdout).unwrap(); + assert_eq!(actual, "43\n"); +} + +#[test] +fn ts_dependency_recompilation() { + let t = TempDir::new(); + let ats = t.path().join("a.ts"); + + std::fs::write( + &ats, + " + import { foo } from \"./b.ts\"; + + function print(str: string): void { + console.log(str); + } + + print(foo);", + ) + .unwrap(); + + let bts = t.path().join("b.ts"); + std::fs::write( + &bts, + " + export const foo = \"foo\";", + ) + .unwrap(); + + let output = util::deno_cmd() + .current_dir(util::testdata_path()) + .env("NO_COLOR", "1") + .arg("run") + .arg("--check") + .arg(&ats) + .output() + .expect("failed to spawn script"); + + let stdout_output = std::str::from_utf8(&output.stdout).unwrap().trim(); + let stderr_output = std::str::from_utf8(&output.stderr).unwrap().trim(); + + assert!(stdout_output.ends_with("foo")); + assert!(stderr_output.starts_with("Check")); + + // Overwrite contents of b.ts and run again + std::fs::write( + &bts, + " + export const foo = 5;", + ) + .expect("error writing file"); + + let output = util::deno_cmd() + .current_dir(util::testdata_path()) + .env("NO_COLOR", "1") + .arg("run") + .arg("--check") + .arg(&ats) + .output() + .expect("failed to spawn script"); + + let stdout_output = std::str::from_utf8(&output.stdout).unwrap().trim(); + let stderr_output = std::str::from_utf8(&output.stderr).unwrap().trim(); + + // error: TS2345 [ERROR]: Argument of type '5' is not assignable to parameter of type 'string'. + assert!(stderr_output.contains("TS2345")); + assert!(!output.status.success()); + assert!(stdout_output.is_empty()); +} + +#[test] +fn basic_auth_tokens() { + let _g = util::http_server(); + + let output = util::deno_cmd() + .current_dir(util::root_path()) + .arg("run") + .arg("http://127.0.0.1:4554/run/001_hello.js") + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + + assert!(!output.status.success()); + + let stdout_str = std::str::from_utf8(&output.stdout).unwrap().trim(); + assert!(stdout_str.is_empty()); + + let stderr_str = std::str::from_utf8(&output.stderr).unwrap().trim(); + eprintln!("{}", stderr_str); + + assert!(stderr_str + .contains("Module not found \"http://127.0.0.1:4554/run/001_hello.js\".")); + + let output = util::deno_cmd() + .current_dir(util::root_path()) + .arg("run") + .arg("http://127.0.0.1:4554/run/001_hello.js") + .env("DENO_AUTH_TOKENS", "testuser123:testpassabc@127.0.0.1:4554") + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + + let stderr_str = std::str::from_utf8(&output.stderr).unwrap().trim(); + eprintln!("{}", stderr_str); + + assert!(output.status.success()); + + let stdout_str = std::str::from_utf8(&output.stdout).unwrap().trim(); + assert_eq!(util::strip_ansi_codes(stdout_str), "Hello World"); +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn test_resolve_dns() { + use std::net::SocketAddr; + use std::str::FromStr; + use std::sync::Arc; + use std::time::Duration; + use tokio::net::TcpListener; + use tokio::net::UdpSocket; + use tokio::sync::oneshot; + use trust_dns_server::authority::Catalog; + use trust_dns_server::authority::ZoneType; + use trust_dns_server::proto::rr::Name; + use trust_dns_server::store::in_memory::InMemoryAuthority; + use trust_dns_server::ServerFuture; + + const DNS_PORT: u16 = 4553; + + // Setup DNS server for testing + async fn run_dns_server(tx: oneshot::Sender<()>) { + let zone_file = std::fs::read_to_string( + util::testdata_path().join("run/resolve_dns.zone.in"), + ) + .unwrap(); + let lexer = Lexer::new(&zone_file); + let records = Parser::new().parse( + lexer, + Some(Name::from_str("example.com").unwrap()), + None, + ); + if records.is_err() { + panic!("failed to parse: {:?}", records.err()) + } + let (origin, records) = records.unwrap(); + let authority = Box::new(Arc::new( + InMemoryAuthority::new(origin, records, ZoneType::Primary, false) + .unwrap(), + )); + let mut catalog: Catalog = Catalog::new(); + catalog.upsert(Name::root().into(), authority); + + let mut server_fut = ServerFuture::new(catalog); + let socket_addr = SocketAddr::from(([127, 0, 0, 1], DNS_PORT)); + let tcp_listener = TcpListener::bind(socket_addr).await.unwrap(); + let udp_socket = UdpSocket::bind(socket_addr).await.unwrap(); + server_fut.register_socket(udp_socket); + server_fut.register_listener(tcp_listener, Duration::from_secs(2)); + + // Notifies that the DNS server is ready + tx.send(()).unwrap(); + + server_fut.block_until_done().await.unwrap(); + } + + let (ready_tx, ready_rx) = oneshot::channel(); + let dns_server_fut = run_dns_server(ready_tx); + let handle = tokio::spawn(dns_server_fut); + + // Waits for the DNS server to be ready + ready_rx.await.unwrap(); + + // Pass: `--allow-net` + { + let output = util::deno_cmd() + .current_dir(util::testdata_path()) + .env("NO_COLOR", "1") + .arg("run") + .arg("--check") + .arg("--allow-net") + .arg("run/resolve_dns.ts") + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + let err = String::from_utf8_lossy(&output.stderr); + let out = String::from_utf8_lossy(&output.stdout); + println!("{}", err); + assert!(output.status.success()); + assert!(err.starts_with("Check file")); + + let expected = std::fs::read_to_string( + util::testdata_path().join("run/resolve_dns.ts.out"), + ) + .unwrap(); + assert_eq!(expected, out); + } + + // Pass: `--allow-net=127.0.0.1:4553` + { + let output = util::deno_cmd() + .current_dir(util::testdata_path()) + .env("NO_COLOR", "1") + .arg("run") + .arg("--check") + .arg("--allow-net=127.0.0.1:4553") + .arg("run/resolve_dns.ts") + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + let err = String::from_utf8_lossy(&output.stderr); + let out = String::from_utf8_lossy(&output.stdout); + assert!(output.status.success()); + assert!(err.starts_with("Check file")); + + let expected = std::fs::read_to_string( + util::testdata_path().join("run/resolve_dns.ts.out"), + ) + .unwrap(); + assert_eq!(expected, out); + } + + // Permission error: `--allow-net=deno.land` + { + let output = util::deno_cmd() + .current_dir(util::testdata_path()) + .env("NO_COLOR", "1") + .arg("run") + .arg("--check") + .arg("--allow-net=deno.land") + .arg("run/resolve_dns.ts") + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + let err = String::from_utf8_lossy(&output.stderr); + let out = String::from_utf8_lossy(&output.stdout); + assert!(!output.status.success()); + assert!(err.starts_with("Check file")); + assert!(err.contains(r#"error: Uncaught PermissionDenied: Requires net access to "127.0.0.1:4553""#)); + assert!(out.is_empty()); + } + + // Permission error: no permission specified + { + let output = util::deno_cmd() + .current_dir(util::testdata_path()) + .env("NO_COLOR", "1") + .arg("run") + .arg("--check") + .arg("run/resolve_dns.ts") + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + let err = String::from_utf8_lossy(&output.stderr); + let out = String::from_utf8_lossy(&output.stdout); + assert!(!output.status.success()); + assert!(err.starts_with("Check file")); + assert!(err.contains(r#"error: Uncaught PermissionDenied: Requires net access to "127.0.0.1:4553""#)); + assert!(out.is_empty()); + } + + handle.abort(); +} + +#[tokio::test] +async fn http2_request_url() { + // TLS streams require the presence of an ambient local task set to gracefully + // close dropped connections in the background. + LocalSet::new() + .run_until(async { + let mut child = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("run") + .arg("--unstable") + .arg("--quiet") + .arg("--allow-net") + .arg("--allow-read") + .arg("./run/http2_request_url.ts") + .arg("4506") + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap(); + let stdout = child.stdout.as_mut().unwrap(); + let mut buffer = [0; 5]; + let read = stdout.read(&mut buffer).unwrap(); + assert_eq!(read, 5); + let msg = std::str::from_utf8(&buffer).unwrap(); + assert_eq!(msg, "READY"); + + let cert = reqwest::Certificate::from_pem(include_bytes!( + "../testdata/tls/RootCA.crt" + )) + .unwrap(); + + let client = reqwest::Client::builder() + .add_root_certificate(cert) + .http2_prior_knowledge() + .build() + .unwrap(); + + let res = client.get("http://127.0.0.1:4506").send().await.unwrap(); + assert_eq!(200, res.status()); + + let body = res.text().await.unwrap(); + assert_eq!(body, "http://127.0.0.1:4506/"); + + child.kill().unwrap(); + child.wait().unwrap(); + }) + .await; +} + +#[cfg(not(windows))] +#[test] +fn set_raw_should_not_panic_on_no_tty() { + let output = util::deno_cmd() + .arg("eval") + .arg("--unstable") + .arg("Deno.setRaw(Deno.stdin.rid, true)") + // stdin set to piped so it certainly does not refer to TTY + .stdin(std::process::Stdio::piped()) + // stderr is piped so we can capture output. + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(!output.status.success()); + let stderr = std::str::from_utf8(&output.stderr).unwrap().trim(); + assert!(stderr.contains("BadResource")); +} + +#[test] +fn timeout_clear() { + // https://github.com/denoland/deno/issues/7599 + + use std::time::Duration; + use std::time::Instant; + + let source_code = r#" +const handle = setTimeout(() => { + console.log("timeout finish"); +}, 10000); +clearTimeout(handle); +console.log("finish"); +"#; + + let mut p = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("run") + .arg("-") + .stdin(std::process::Stdio::piped()) + .spawn() + .unwrap(); + let stdin = p.stdin.as_mut().unwrap(); + stdin.write_all(source_code.as_bytes()).unwrap(); + let start = Instant::now(); + let status = p.wait().unwrap(); + let end = Instant::now(); + assert!(status.success()); + // check that program did not run for 10 seconds + // for timeout to clear + assert!(end - start < Duration::new(10, 0)); +} + +#[test] +fn broken_stdout() { + let (reader, writer) = os_pipe::pipe().unwrap(); + // drop the reader to create a broken pipe + drop(reader); + + let output = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("eval") + .arg("console.log(3.14)") + .stdout(writer) + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + + assert!(!output.status.success()); + let stderr = std::str::from_utf8(output.stderr.as_ref()).unwrap().trim(); + assert!(stderr.contains("Uncaught BrokenPipe")); + assert!(!stderr.contains("panic")); +} + +itest!(error_cause { + args: "run run/error_cause.ts", + output: "run/error_cause.ts.out", + exit_code: 1, +}); + +itest!(error_cause_recursive { + args: "run run/error_cause_recursive.ts", + output: "run/error_cause_recursive.ts.out", + exit_code: 1, +}); + +#[test] +fn websocket() { + let _g = util::http_server(); + + let script = util::testdata_path().join("run/websocket_test.ts"); + let root_ca = util::testdata_path().join("tls/RootCA.pem"); + let status = util::deno_cmd() + .arg("test") + .arg("--unstable") + .arg("--allow-net") + .arg("--cert") + .arg(root_ca) + .arg(script) + .spawn() + .unwrap() + .wait() + .unwrap(); + + assert!(status.success()); +} + +#[test] +fn websocketstream() { + let _g = util::http_server(); + + let script = util::testdata_path().join("run/websocketstream_test.ts"); + let root_ca = util::testdata_path().join("tls/RootCA.pem"); + let status = util::deno_cmd() + .arg("test") + .arg("--unstable") + .arg("--allow-net") + .arg("--cert") + .arg(root_ca) + .arg(script) + .spawn() + .unwrap() + .wait() + .unwrap(); + + assert!(status.success()); +} + +#[test] +fn websocketstream_ping() { + use deno_runtime::deno_websocket::tokio_tungstenite::tungstenite; + let _g = util::http_server(); + + let script = util::testdata_path().join("run/websocketstream_ping_test.ts"); + let root_ca = util::testdata_path().join("tls/RootCA.pem"); + let mut child = util::deno_cmd() + .arg("test") + .arg("--unstable") + .arg("--allow-net") + .arg("--cert") + .arg(root_ca) + .arg(script) + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap(); + + let server = std::net::TcpListener::bind("127.0.0.1:4513").unwrap(); + let (stream, _) = server.accept().unwrap(); + let mut socket = tungstenite::accept(stream).unwrap(); + socket + .write_message(tungstenite::Message::Text(String::from("A"))) + .unwrap(); + socket + .write_message(tungstenite::Message::Ping(vec![])) + .unwrap(); + socket + .write_message(tungstenite::Message::Text(String::from("B"))) + .unwrap(); + let message = socket.read_message().unwrap(); + assert_eq!(message, tungstenite::Message::Pong(vec![])); + socket + .write_message(tungstenite::Message::Text(String::from("C"))) + .unwrap(); + socket.close(None).unwrap(); + + assert!(child.wait().unwrap().success()); +} + +#[test] +fn websocket_server_multi_field_connection_header() { + let script = util::testdata_path() + .join("run/websocket_server_multi_field_connection_header_test.ts"); + let root_ca = util::testdata_path().join("tls/RootCA.pem"); + let mut child = util::deno_cmd() + .arg("run") + .arg("--unstable") + .arg("--allow-net") + .arg("--cert") + .arg(root_ca) + .arg(script) + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap(); + + let stdout = child.stdout.as_mut().unwrap(); + let mut buffer = [0; 5]; + let read = stdout.read(&mut buffer).unwrap(); + assert_eq!(read, 5); + let msg = std::str::from_utf8(&buffer).unwrap(); + assert_eq!(msg, "READY"); + + let req = http::request::Builder::new() + .header(http::header::CONNECTION, "keep-alive, Upgrade") + .uri("ws://localhost:4319") + .body(()) + .unwrap(); + let (mut socket, _) = + deno_runtime::deno_websocket::tokio_tungstenite::tungstenite::connect(req) + .unwrap(); + let message = socket.read_message().unwrap(); + assert_eq!(message, deno_runtime::deno_websocket::tokio_tungstenite::tungstenite::Message::Close(None)); + socket.close(None).unwrap(); + assert!(child.wait().unwrap().success()); +} + +// TODO(bartlomieju): this should use `deno run`, not `deno test`; but the +// test hangs then. https://github.com/denoland/deno/issues/14283 +#[test] +#[ignore] +fn websocket_server_idletimeout() { + let script = + util::testdata_path().join("run/websocket_server_idletimeout.ts"); + let root_ca = util::testdata_path().join("tls/RootCA.pem"); + let mut child = util::deno_cmd() + .arg("test") + .arg("--unstable") + .arg("--allow-net") + .arg("--cert") + .arg(root_ca) + .arg(script) + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap(); + + let stdout = child.stdout.as_mut().unwrap(); + let mut buffer = [0; 5]; + let read = stdout.read(&mut buffer).unwrap(); + assert_eq!(read, 5); + let msg = std::str::from_utf8(&buffer).unwrap(); + assert_eq!(msg, "READY"); + + let req = http::request::Builder::new() + .uri("ws://localhost:4509") + .body(()) + .unwrap(); + let (_ws, _request) = + deno_runtime::deno_websocket::tokio_tungstenite::tungstenite::connect(req) + .unwrap(); + + assert!(child.wait().unwrap().success()); +} diff --git a/cli/tests/integration/vendor_tests.rs b/cli/tests/integration/vendor_tests.rs index 54809dacf6..b3a3f441fd 100644 --- a/cli/tests/integration/vendor_tests.rs +++ b/cli/tests/integration/vendor_tests.rs @@ -347,6 +347,7 @@ fn existing_import_map_mixed_with_remote() { .arg("--output") .arg("vendor2") .stderr(Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap(); let output = deno.wait_with_output().unwrap(); diff --git a/cli/tests/integration/watcher_tests.rs b/cli/tests/integration/watcher_tests.rs index b69379427e..efc1b186b4 100644 --- a/cli/tests/integration/watcher_tests.rs +++ b/cli/tests/integration/watcher_tests.rs @@ -242,15 +242,15 @@ fn lint_all_files_on_each_change_test() { #[test] fn fmt_watch_test() { + let fmt_testdata_path = util::testdata_path().join("fmt"); let t = TempDir::new(); - let fixed = util::testdata_path().join("badly_formatted_fixed.js"); - let badly_formatted_original = - util::testdata_path().join("badly_formatted.mjs"); + let fixed = fmt_testdata_path.join("badly_formatted_fixed.js"); + let badly_formatted_original = fmt_testdata_path.join("badly_formatted.mjs"); let badly_formatted = t.path().join("badly_formatted.js"); std::fs::copy(&badly_formatted_original, &badly_formatted).unwrap(); let mut child = util::deno_cmd() - .current_dir(util::testdata_path()) + .current_dir(&fmt_testdata_path) .arg("fmt") .arg(&badly_formatted) .arg("--watch") @@ -291,10 +291,10 @@ fn fmt_watch_test() { #[test] fn fmt_watch_without_args_test() { + let fmt_testdata_path = util::testdata_path().join("fmt"); let t = TempDir::new(); - let fixed = util::testdata_path().join("badly_formatted_fixed.js"); - let badly_formatted_original = - util::testdata_path().join("badly_formatted.mjs"); + let fixed = fmt_testdata_path.join("badly_formatted_fixed.js"); + let badly_formatted_original = fmt_testdata_path.join("badly_formatted.mjs"); let badly_formatted = t.path().join("badly_formatted.js"); std::fs::copy(&badly_formatted_original, &badly_formatted).unwrap(); @@ -339,15 +339,15 @@ fn fmt_watch_without_args_test() { #[test] fn fmt_check_all_files_on_each_change_test() { let t = TempDir::new(); - let badly_formatted_original = - util::testdata_path().join("badly_formatted.mjs"); + let fmt_testdata_path = util::testdata_path().join("fmt"); + let badly_formatted_original = fmt_testdata_path.join("badly_formatted.mjs"); let badly_formatted_1 = t.path().join("badly_formatted_1.js"); let badly_formatted_2 = t.path().join("badly_formatted_2.js"); std::fs::copy(&badly_formatted_original, &badly_formatted_1).unwrap(); std::fs::copy(&badly_formatted_original, &badly_formatted_2).unwrap(); let mut child = util::deno_cmd() - .current_dir(util::testdata_path()) + .current_dir(&fmt_testdata_path) .arg("fmt") .arg(&t.path()) .arg("--watch") diff --git a/cli/tests/integration/worker_tests.rs b/cli/tests/integration/worker_tests.rs index 63d5ccbd3c..b864c15da5 100644 --- a/cli/tests/integration/worker_tests.rs +++ b/cli/tests/integration/worker_tests.rs @@ -41,20 +41,20 @@ itest!(nonexistent_worker { }); itest!(_084_worker_custom_inspect { - args: "run --allow-read 084_worker_custom_inspect.ts", - output: "084_worker_custom_inspect.ts.out", + args: "run --allow-read workers/custom_inspect/main.ts", + output: "workers/custom_inspect/main.out", }); itest!(error_worker_permissions_local { - args: "run --reload error_worker_permissions_local.ts", - output: "error_worker_permissions_local.ts.out", + args: "run --reload workers/error_worker_permissions_local.ts", + output: "workers/error_worker_permissions_local.ts.out", exit_code: 1, }); itest!(error_worker_permissions_remote { - args: "run --reload error_worker_permissions_remote.ts", + args: "run --reload workers/error_worker_permissions_remote.ts", http_server: true, - output: "error_worker_permissions_remote.ts.out", + output: "workers/error_worker_permissions_remote.ts.out", exit_code: 1, }); diff --git a/cli/tests/testdata/003_relative_import.ts b/cli/tests/testdata/003_relative_import.ts deleted file mode 100644 index 01d5d7faac..0000000000 --- a/cli/tests/testdata/003_relative_import.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello } from "./subdir/print_hello.ts"; - -printHello(); diff --git a/cli/tests/testdata/014_duplicate_import.ts b/cli/tests/testdata/014_duplicate_import.ts deleted file mode 100644 index 88f9345269..0000000000 --- a/cli/tests/testdata/014_duplicate_import.ts +++ /dev/null @@ -1,9 +0,0 @@ -// with all the imports of the same module, the module should only be -// instantiated once -import "./subdir/auto_print_hello.ts"; - -import "./subdir/auto_print_hello.ts"; - -(async () => { - await import("./subdir/auto_print_hello.ts"); -})(); diff --git a/cli/tests/testdata/020_json_modules.ts b/cli/tests/testdata/020_json_modules.ts deleted file mode 100644 index fdc85c4409..0000000000 --- a/cli/tests/testdata/020_json_modules.ts +++ /dev/null @@ -1,2 +0,0 @@ -import config from "./subdir/config.json"; -console.log(JSON.stringify(config)); diff --git a/cli/tests/testdata/021_mjs_modules.ts b/cli/tests/testdata/021_mjs_modules.ts deleted file mode 100644 index 6052b90816..0000000000 --- a/cli/tests/testdata/021_mjs_modules.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { isMod5 } from "./subdir/mod5.mjs"; -console.log(isMod5); diff --git a/cli/tests/testdata/023_no_ext b/cli/tests/testdata/023_no_ext deleted file mode 100644 index 0dcfb62092..0000000000 --- a/cli/tests/testdata/023_no_ext +++ /dev/null @@ -1,2 +0,0 @@ -import * as mod4 from "./subdir/mod4.js"; -console.log(mod4.isMod4); diff --git a/cli/tests/testdata/024_import_no_ext_with_headers.ts b/cli/tests/testdata/024_import_no_ext_with_headers.ts deleted file mode 100644 index c8621d0e66..0000000000 --- a/cli/tests/testdata/024_import_no_ext_with_headers.ts +++ /dev/null @@ -1 +0,0 @@ -import "./023_no_ext_with_headers"; diff --git a/cli/tests/testdata/024_import_no_ext_with_headers.ts.out b/cli/tests/testdata/024_import_no_ext_with_headers.ts.out deleted file mode 100644 index e427984d4a..0000000000 --- a/cli/tests/testdata/024_import_no_ext_with_headers.ts.out +++ /dev/null @@ -1 +0,0 @@ -HELLO diff --git a/cli/tests/testdata/029_eval.out b/cli/tests/testdata/029_eval.out deleted file mode 100644 index ce01362503..0000000000 --- a/cli/tests/testdata/029_eval.out +++ /dev/null @@ -1 +0,0 @@ -hello diff --git a/cli/tests/testdata/030_eval_ts.out b/cli/tests/testdata/030_eval_ts.out deleted file mode 100644 index 190a18037c..0000000000 --- a/cli/tests/testdata/030_eval_ts.out +++ /dev/null @@ -1 +0,0 @@ -123 diff --git a/cli/tests/testdata/035_cached_only_flag.out b/cli/tests/testdata/035_cached_only_flag.out deleted file mode 100644 index 10c8611faf..0000000000 --- a/cli/tests/testdata/035_cached_only_flag.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Specifier not found in cache: "http://127.0.0.1:4545/019_media_types.ts", --cached-only is specified. - -Caused by: - Specifier not found in cache: "http://127.0.0.1:4545/019_media_types.ts", --cached-only is specified. diff --git a/cli/tests/testdata/044_bad_resource.ts b/cli/tests/testdata/044_bad_resource.ts deleted file mode 100644 index 05e1354dcd..0000000000 --- a/cli/tests/testdata/044_bad_resource.ts +++ /dev/null @@ -1,3 +0,0 @@ -const file = await Deno.open("044_bad_resource.ts", { read: true }); -file.close(); -await file.seek(10, 0); diff --git a/cli/tests/testdata/045_proxy_test.ts.out b/cli/tests/testdata/045_proxy_test.ts.out deleted file mode 100644 index 4ebf97dee4..0000000000 --- a/cli/tests/testdata/045_proxy_test.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -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/testdata/052_no_remote_flag.out b/cli/tests/testdata/052_no_remote_flag.out deleted file mode 100644 index 712fcf3d6e..0000000000 --- a/cli/tests/testdata/052_no_remote_flag.out +++ /dev/null @@ -1,4 +0,0 @@ -error: A remote specifier was requested: "http://127.0.0.1:4545/019_media_types.ts", but --no-remote is specified. - -Caused by: - 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/testdata/053_import_compression/main.ts b/cli/tests/testdata/053_import_compression/main.ts deleted file mode 100644 index 1ff1b0c831..0000000000 --- a/cli/tests/testdata/053_import_compression/main.ts +++ /dev/null @@ -1,13 +0,0 @@ -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/testdata/072_location_relative_fetch.ts b/cli/tests/testdata/072_location_relative_fetch.ts deleted file mode 100644 index d4764bf7f1..0000000000 --- a/cli/tests/testdata/072_location_relative_fetch.ts +++ /dev/null @@ -1,2 +0,0 @@ -const response = await fetch("fetch/hello.txt"); -console.log(await response.text()); diff --git a/cli/tests/testdata/084_worker_custom_inspect.ts b/cli/tests/testdata/084_worker_custom_inspect.ts deleted file mode 100644 index 27e27e51fa..0000000000 --- a/cli/tests/testdata/084_worker_custom_inspect.ts +++ /dev/null @@ -1,4 +0,0 @@ -new Worker( - import.meta.resolve("./084_worker_custom_inspect_worker.ts"), - { type: "module" }, -); diff --git a/cli/tests/testdata/Component.tsx b/cli/tests/testdata/Component.tsx deleted file mode 100644 index 81dfd69579..0000000000 --- a/cli/tests/testdata/Component.tsx +++ /dev/null @@ -1 +0,0 @@ -import "./046_jsx_test.tsx"; diff --git a/cli/tests/testdata/DenoWinRunner.cs b/cli/tests/testdata/assets/DenoWinRunner.cs similarity index 100% rename from cli/tests/testdata/DenoWinRunner.cs rename to cli/tests/testdata/assets/DenoWinRunner.cs diff --git a/cli/tests/testdata/DenoWinRunner.ps1 b/cli/tests/testdata/assets/DenoWinRunner.ps1 similarity index 100% rename from cli/tests/testdata/DenoWinRunner.ps1 rename to cli/tests/testdata/assets/DenoWinRunner.ps1 diff --git a/cli/tests/testdata/deno_dom_0.1.3-alpha2.wasm b/cli/tests/testdata/assets/deno_dom_0.1.3-alpha2.wasm similarity index 100% rename from cli/tests/testdata/deno_dom_0.1.3-alpha2.wasm rename to cli/tests/testdata/assets/deno_dom_0.1.3-alpha2.wasm diff --git a/cli/tests/testdata/fixture.json b/cli/tests/testdata/assets/fixture.json similarity index 100% rename from cli/tests/testdata/fixture.json rename to cli/tests/testdata/assets/fixture.json diff --git a/cli/tests/testdata/hello.txt b/cli/tests/testdata/assets/hello.txt similarity index 100% rename from cli/tests/testdata/hello.txt rename to cli/tests/testdata/assets/hello.txt diff --git a/cli/tests/testdata/unreachable.wasm b/cli/tests/testdata/assets/unreachable.wasm similarity index 100% rename from cli/tests/testdata/unreachable.wasm rename to cli/tests/testdata/assets/unreachable.wasm diff --git a/cli/tests/testdata/response_string_perf.js b/cli/tests/testdata/benches/response_string_perf.js similarity index 100% rename from cli/tests/testdata/response_string_perf.js rename to cli/tests/testdata/benches/response_string_perf.js diff --git a/cli/tests/testdata/text_decoder_perf.js b/cli/tests/testdata/benches/text_decoder_perf.js similarity index 100% rename from cli/tests/testdata/text_decoder_perf.js rename to cli/tests/testdata/benches/text_decoder_perf.js diff --git a/cli/tests/testdata/text_encoder_into_perf.js b/cli/tests/testdata/benches/text_encoder_into_perf.js similarity index 100% rename from cli/tests/testdata/text_encoder_into_perf.js rename to cli/tests/testdata/benches/text_encoder_into_perf.js diff --git a/cli/tests/testdata/text_encoder_perf.js b/cli/tests/testdata/benches/text_encoder_perf.js similarity index 100% rename from cli/tests/testdata/text_encoder_perf.js rename to cli/tests/testdata/benches/text_encoder_perf.js diff --git a/cli/tests/testdata/095_cache_with_bare_import.ts b/cli/tests/testdata/bundle/bare_imports/error_with_bare_import.ts similarity index 100% rename from cli/tests/testdata/095_cache_with_bare_import.ts rename to cli/tests/testdata/bundle/bare_imports/error_with_bare_import.ts diff --git a/cli/tests/testdata/error_027_bundle_with_bare_import.ts.out b/cli/tests/testdata/bundle/bare_imports/error_with_bare_import.ts.out similarity index 50% rename from cli/tests/testdata/error_027_bundle_with_bare_import.ts.out rename to cli/tests/testdata/bundle/bare_imports/error_with_bare_import.ts.out index e2edd118a1..44d063a5ee 100644 --- a/cli/tests/testdata/error_027_bundle_with_bare_import.ts.out +++ b/cli/tests/testdata/bundle/bare_imports/error_with_bare_import.ts.out @@ -1,2 +1,2 @@ [WILDCARD]error: Relative import path "foo" not prefixed with / or ./ or ../ - at file:///[WILDCARD]/error_027_bundle_with_bare_import.ts:[WILDCARD] + at file:///[WILDCARD]/error_with_bare_import.ts:[WILDCARD] diff --git a/cli/tests/testdata/bundle.test.out b/cli/tests/testdata/bundle/bundle.test.out similarity index 100% rename from cli/tests/testdata/bundle.test.out rename to cli/tests/testdata/bundle/bundle.test.out diff --git a/cli/tests/testdata/bundle/check_local_by_default.out b/cli/tests/testdata/bundle/check_local_by_default/no_errors.out similarity index 100% rename from cli/tests/testdata/bundle/check_local_by_default.out rename to cli/tests/testdata/bundle/check_local_by_default/no_errors.out diff --git a/cli/tests/testdata/bundle/check_local_by_default.ts b/cli/tests/testdata/bundle/check_local_by_default/no_errors.ts similarity index 100% rename from cli/tests/testdata/bundle/check_local_by_default.ts rename to cli/tests/testdata/bundle/check_local_by_default/no_errors.ts diff --git a/cli/tests/testdata/bundle/check_local_by_default2.out b/cli/tests/testdata/bundle/check_local_by_default/type_error.out similarity index 58% rename from cli/tests/testdata/bundle/check_local_by_default2.out rename to cli/tests/testdata/bundle/check_local_by_default/type_error.out index 60f5760f8b..6d53e94980 100644 --- a/cli/tests/testdata/bundle/check_local_by_default2.out +++ b/cli/tests/testdata/bundle/check_local_by_default/type_error.out @@ -1,4 +1,4 @@ error: TS2322 [ERROR]: Type '12' is not assignable to type '"b"'. const b: "b" = 12; ^ - at [WILDCARD]bundle/check_local_by_default2.ts:3:7 + at [WILDCARD]bundle/check_local_by_default/type_error.ts:3:7 diff --git a/cli/tests/testdata/bundle/check_local_by_default2.ts b/cli/tests/testdata/bundle/check_local_by_default/type_error.ts similarity index 100% rename from cli/tests/testdata/bundle/check_local_by_default2.ts rename to cli/tests/testdata/bundle/check_local_by_default/type_error.ts diff --git a/cli/tests/testdata/ts_decorators_bundle.out b/cli/tests/testdata/bundle/decorators/ts_decorators.out similarity index 100% rename from cli/tests/testdata/ts_decorators_bundle.out rename to cli/tests/testdata/bundle/decorators/ts_decorators.out diff --git a/cli/tests/testdata/ts_decorators_bundle.ts b/cli/tests/testdata/bundle/decorators/ts_decorators.ts similarity index 90% rename from cli/tests/testdata/ts_decorators_bundle.ts rename to cli/tests/testdata/bundle/decorators/ts_decorators.ts index 72120b2ec3..61299bccf2 100644 --- a/cli/tests/testdata/ts_decorators_bundle.ts +++ b/cli/tests/testdata/bundle/decorators/ts_decorators.ts @@ -1,6 +1,6 @@ // deno-lint-ignore-file -import { B } from "./subdir/more_decorators.ts"; +import { B } from "../../subdir/more_decorators.ts"; function Decorator() { return function ( diff --git a/cli/tests/testdata/bundle_dynamic_import.ts b/cli/tests/testdata/bundle/dynamic_import.ts similarity index 100% rename from cli/tests/testdata/bundle_dynamic_import.ts rename to cli/tests/testdata/bundle/dynamic_import.ts diff --git a/cli/tests/testdata/bundle_ignore_directives.test.out b/cli/tests/testdata/bundle/ignore_directives.test.out similarity index 100% rename from cli/tests/testdata/bundle_ignore_directives.test.out rename to cli/tests/testdata/bundle/ignore_directives.test.out diff --git a/cli/tests/testdata/bundle/import_map/import_map.json b/cli/tests/testdata/bundle/import_map/import_map.json new file mode 100644 index 0000000000..c02f72718c --- /dev/null +++ b/cli/tests/testdata/bundle/import_map/import_map.json @@ -0,0 +1,5 @@ +{ + "imports": { + "mod2": "../../subdir/subdir2/mod2.ts" + } +} diff --git a/cli/tests/testdata/bundle_im.ts b/cli/tests/testdata/bundle/import_map/main.ts similarity index 100% rename from cli/tests/testdata/bundle_im.ts rename to cli/tests/testdata/bundle/import_map/main.ts diff --git a/cli/tests/testdata/bundle_jsx.out b/cli/tests/testdata/bundle/jsx.out similarity index 100% rename from cli/tests/testdata/bundle_jsx.out rename to cli/tests/testdata/bundle/jsx.out diff --git a/cli/tests/testdata/lock_check_err_with_bundle.json b/cli/tests/testdata/bundle/lockfile/check_error.json similarity index 100% rename from cli/tests/testdata/lock_check_err_with_bundle.json rename to cli/tests/testdata/bundle/lockfile/check_error.json diff --git a/cli/tests/testdata/lock_check_err_with_bundle.out b/cli/tests/testdata/bundle/lockfile/check_error.out similarity index 77% rename from cli/tests/testdata/lock_check_err_with_bundle.out rename to cli/tests/testdata/bundle/lockfile/check_error.out index a20e9b3afc..9299bc27e1 100644 --- a/cli/tests/testdata/lock_check_err_with_bundle.out +++ b/cli/tests/testdata/bundle/lockfile/check_error.out @@ -1,4 +1,4 @@ [WILDCARD] error: The source code is invalid, as it does not match the expected hash in the lock file. Specifier: http://127.0.0.1:4545/subdir/subdir2/mod2.ts - Lock file: lock_check_err_with_bundle.json + Lock file: bundle/lockfile/check_error.json diff --git a/cli/tests/testdata/bundle_im.json b/cli/tests/testdata/bundle_im.json deleted file mode 100644 index 8ebc00c5ba..0000000000 --- a/cli/tests/testdata/bundle_im.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "mod2": "./subdir/subdir2/mod2.ts" - } -} diff --git a/cli/tests/testdata/036_import_map_fetch.out b/cli/tests/testdata/cache/036_import_map_fetch.out similarity index 100% rename from cli/tests/testdata/036_import_map_fetch.out rename to cli/tests/testdata/cache/036_import_map_fetch.out diff --git a/cli/tests/testdata/037_fetch_multiple.out b/cli/tests/testdata/cache/037_fetch_multiple.out similarity index 100% rename from cli/tests/testdata/037_fetch_multiple.out rename to cli/tests/testdata/cache/037_fetch_multiple.out diff --git a/cli/tests/testdata/error_027_bundle_with_bare_import.ts b/cli/tests/testdata/cache/095_cache_with_bare_import.ts similarity index 100% rename from cli/tests/testdata/error_027_bundle_with_bare_import.ts rename to cli/tests/testdata/cache/095_cache_with_bare_import.ts diff --git a/cli/tests/testdata/095_cache_with_bare_import.ts.out b/cli/tests/testdata/cache/095_cache_with_bare_import.ts.out similarity index 100% rename from cli/tests/testdata/095_cache_with_bare_import.ts.out rename to cli/tests/testdata/cache/095_cache_with_bare_import.ts.out diff --git a/cli/tests/testdata/cache_extensionless.out b/cli/tests/testdata/cache/cache_extensionless.out similarity index 100% rename from cli/tests/testdata/cache_extensionless.out rename to cli/tests/testdata/cache/cache_extensionless.out diff --git a/cli/tests/testdata/cache_random_extension.out b/cli/tests/testdata/cache/cache_random_extension.out similarity index 100% rename from cli/tests/testdata/cache_random_extension.out rename to cli/tests/testdata/cache/cache_random_extension.out diff --git a/cli/tests/testdata/ignore_require.js b/cli/tests/testdata/cache/ignore_require.js similarity index 100% rename from cli/tests/testdata/ignore_require.js rename to cli/tests/testdata/cache/ignore_require.js diff --git a/cli/tests/testdata/performance_stats.out b/cli/tests/testdata/cache/performance_stats.out similarity index 100% rename from cli/tests/testdata/performance_stats.out rename to cli/tests/testdata/cache/performance_stats.out diff --git a/cli/tests/testdata/redirect_cache.out b/cli/tests/testdata/cache/redirect_cache.out similarity index 100% rename from cli/tests/testdata/redirect_cache.out rename to cli/tests/testdata/cache/redirect_cache.out diff --git a/cli/tests/testdata/cafile_info.ts b/cli/tests/testdata/cert/cafile_info.ts similarity index 100% rename from cli/tests/testdata/cafile_info.ts rename to cli/tests/testdata/cert/cafile_info.ts diff --git a/cli/tests/testdata/cafile_info.ts.out b/cli/tests/testdata/cert/cafile_info.ts.out similarity index 93% rename from cli/tests/testdata/cafile_info.ts.out rename to cli/tests/testdata/cert/cafile_info.ts.out index 3ce03961da..4c7e6c6c7c 100644 --- a/cli/tests/testdata/cafile_info.ts.out +++ b/cli/tests/testdata/cert/cafile_info.ts.out @@ -2,7 +2,7 @@ local: [WILDCARD]https[WILDCARD]localhost_PORT5545[WILDCARD] type: TypeScript dependencies: 8 unique (total [WILDCARD]) -https://localhost:5545/cafile_info.ts ([WILDCARD]) +https://localhost:5545/cert/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]) diff --git a/cli/tests/testdata/cafile_ts_fetch.ts b/cli/tests/testdata/cert/cafile_ts_fetch.ts similarity index 52% rename from cli/tests/testdata/cafile_ts_fetch.ts rename to cli/tests/testdata/cert/cafile_ts_fetch.ts index 03afb6d2f9..12fcda007b 100644 --- a/cli/tests/testdata/cafile_ts_fetch.ts +++ b/cli/tests/testdata/cert/cafile_ts_fetch.ts @@ -1,3 +1,3 @@ -fetch("https://localhost:5545/cafile_ts_fetch.ts.out") +fetch("https://localhost:5545/cert/cafile_ts_fetch.ts.out") .then((r) => r.text()) .then((t) => console.log(t.trimEnd())); diff --git a/cli/tests/testdata/cafile_ts_fetch.ts.out b/cli/tests/testdata/cert/cafile_ts_fetch.ts.out similarity index 100% rename from cli/tests/testdata/cafile_ts_fetch.ts.out rename to cli/tests/testdata/cert/cafile_ts_fetch.ts.out diff --git a/cli/tests/testdata/cafile_ts_fetch_unsafe_ssl.ts.out b/cli/tests/testdata/cert/cafile_ts_fetch_unsafe_ssl.ts.out similarity index 100% rename from cli/tests/testdata/cafile_ts_fetch_unsafe_ssl.ts.out rename to cli/tests/testdata/cert/cafile_ts_fetch_unsafe_ssl.ts.out diff --git a/cli/tests/testdata/cafile_url_imports.ts b/cli/tests/testdata/cert/cafile_url_imports.ts similarity index 100% rename from cli/tests/testdata/cafile_url_imports.ts rename to cli/tests/testdata/cert/cafile_url_imports.ts diff --git a/cli/tests/testdata/cafile_url_imports.ts.out b/cli/tests/testdata/cert/cafile_url_imports.ts.out similarity index 100% rename from cli/tests/testdata/cafile_url_imports.ts.out rename to cli/tests/testdata/cert/cafile_url_imports.ts.out diff --git a/cli/tests/testdata/cafile_url_imports_unsafe_ssl.ts.out b/cli/tests/testdata/cert/cafile_url_imports_unsafe_ssl.ts.out similarity index 100% rename from cli/tests/testdata/cafile_url_imports_unsafe_ssl.ts.out rename to cli/tests/testdata/cert/cafile_url_imports_unsafe_ssl.ts.out diff --git a/cli/tests/testdata/deno_land_unsafe_ssl.ts b/cli/tests/testdata/cert/deno_land_unsafe_ssl.ts similarity index 100% rename from cli/tests/testdata/deno_land_unsafe_ssl.ts rename to cli/tests/testdata/cert/deno_land_unsafe_ssl.ts diff --git a/cli/tests/testdata/deno_land_unsafe_ssl.ts.out b/cli/tests/testdata/cert/deno_land_unsafe_ssl.ts.out similarity index 100% rename from cli/tests/testdata/deno_land_unsafe_ssl.ts.out rename to cli/tests/testdata/cert/deno_land_unsafe_ssl.ts.out diff --git a/cli/tests/testdata/ip_address_unsafe_ssl.ts b/cli/tests/testdata/cert/ip_address_unsafe_ssl.ts similarity index 100% rename from cli/tests/testdata/ip_address_unsafe_ssl.ts rename to cli/tests/testdata/cert/ip_address_unsafe_ssl.ts diff --git a/cli/tests/testdata/ip_address_unsafe_ssl.ts.out b/cli/tests/testdata/cert/ip_address_unsafe_ssl.ts.out similarity index 100% rename from cli/tests/testdata/ip_address_unsafe_ssl.ts.out rename to cli/tests/testdata/cert/ip_address_unsafe_ssl.ts.out diff --git a/cli/tests/testdata/listen_tls_alpn.ts b/cli/tests/testdata/cert/listen_tls_alpn.ts similarity index 100% rename from cli/tests/testdata/listen_tls_alpn.ts rename to cli/tests/testdata/cert/listen_tls_alpn.ts diff --git a/cli/tests/testdata/listen_tls_alpn_fail.ts b/cli/tests/testdata/cert/listen_tls_alpn_fail.ts similarity index 84% rename from cli/tests/testdata/listen_tls_alpn_fail.ts rename to cli/tests/testdata/cert/listen_tls_alpn_fail.ts index 04f9ec11f5..da60383f0a 100644 --- a/cli/tests/testdata/listen_tls_alpn_fail.ts +++ b/cli/tests/testdata/cert/listen_tls_alpn_fail.ts @@ -1,4 +1,4 @@ -import { assertRejects } from "../../../test_util/std/testing/asserts.ts"; +import { assertRejects } from "../../../../test_util/std/testing/asserts.ts"; const listener = Deno.listenTls({ port: Number(Deno.args[0]), diff --git a/cli/tests/testdata/localhost_unsafe_ssl.ts.out b/cli/tests/testdata/cert/localhost_unsafe_ssl.ts.out similarity index 100% rename from cli/tests/testdata/localhost_unsafe_ssl.ts.out rename to cli/tests/testdata/cert/localhost_unsafe_ssl.ts.out diff --git a/cli/tests/testdata/check_all.out b/cli/tests/testdata/check/check_all.out similarity index 100% rename from cli/tests/testdata/check_all.out rename to cli/tests/testdata/check/check_all.out diff --git a/cli/tests/testdata/check_all.ts b/cli/tests/testdata/check/check_all.ts similarity index 100% rename from cli/tests/testdata/check_all.ts rename to cli/tests/testdata/check/check_all.ts diff --git a/cli/tests/testdata/declaration_header_file_with_no_exports.ts b/cli/tests/testdata/check/declaration_header_file_with_no_exports.ts similarity index 100% rename from cli/tests/testdata/declaration_header_file_with_no_exports.ts rename to cli/tests/testdata/check/declaration_header_file_with_no_exports.ts diff --git a/cli/tests/testdata/declaration_header_file_with_no_exports_js.d.ts b/cli/tests/testdata/check/declaration_header_file_with_no_exports_js.d.ts similarity index 100% rename from cli/tests/testdata/declaration_header_file_with_no_exports_js.d.ts rename to cli/tests/testdata/check/declaration_header_file_with_no_exports_js.d.ts diff --git a/cli/tests/testdata/declaration_header_file_with_no_exports_js.js b/cli/tests/testdata/check/declaration_header_file_with_no_exports_js.js similarity index 100% rename from cli/tests/testdata/declaration_header_file_with_no_exports_js.js rename to cli/tests/testdata/check/declaration_header_file_with_no_exports_js.js diff --git a/cli/tests/testdata/check/module_detection_force.ts b/cli/tests/testdata/check/module_detection_force.ts new file mode 100644 index 0000000000..185ceb8168 --- /dev/null +++ b/cli/tests/testdata/check/module_detection_force.ts @@ -0,0 +1,3 @@ +const a = 1; +await import("./module_detection_force/import.ts"); +console.log(a); diff --git a/cli/tests/testdata/module_detection_force_import.ts b/cli/tests/testdata/check/module_detection_force/import.ts similarity index 100% rename from cli/tests/testdata/module_detection_force_import.ts rename to cli/tests/testdata/check/module_detection_force/import.ts diff --git a/cli/tests/testdata/check/module_detection_force/main.ts b/cli/tests/testdata/check/module_detection_force/main.ts new file mode 100644 index 0000000000..a55c9962be --- /dev/null +++ b/cli/tests/testdata/check/module_detection_force/main.ts @@ -0,0 +1,3 @@ +const a = 1; +await import("./import.ts"); +console.log(a); diff --git a/cli/tests/testdata/circular1.js b/cli/tests/testdata/circular1.js deleted file mode 100644 index 8b2cc4960f..0000000000 --- a/cli/tests/testdata/circular1.js +++ /dev/null @@ -1,2 +0,0 @@ -import "./circular2.js"; -console.log("circular1"); diff --git a/cli/tests/testdata/circular1.js.out b/cli/tests/testdata/circular1.js.out deleted file mode 100644 index 21f7fd5857..0000000000 --- a/cli/tests/testdata/circular1.js.out +++ /dev/null @@ -1,2 +0,0 @@ -circular2 -circular1 diff --git a/cli/tests/testdata/circular2.js b/cli/tests/testdata/circular2.js deleted file mode 100644 index 62127e04d0..0000000000 --- a/cli/tests/testdata/circular2.js +++ /dev/null @@ -1,2 +0,0 @@ -import "./circular1.js"; -console.log("circular2"); diff --git a/cli/tests/testdata/028_args.ts b/cli/tests/testdata/compile/args.ts similarity index 100% rename from cli/tests/testdata/028_args.ts rename to cli/tests/testdata/compile/args.ts diff --git a/cli/tests/testdata/standalone_error.ts b/cli/tests/testdata/compile/standalone_error.ts similarity index 100% rename from cli/tests/testdata/standalone_error.ts rename to cli/tests/testdata/compile/standalone_error.ts diff --git a/cli/tests/testdata/standalone_error_module_with_imports_1.ts b/cli/tests/testdata/compile/standalone_error_module_with_imports_1.ts similarity index 100% rename from cli/tests/testdata/standalone_error_module_with_imports_1.ts rename to cli/tests/testdata/compile/standalone_error_module_with_imports_1.ts diff --git a/cli/tests/testdata/standalone_error_module_with_imports_2.ts b/cli/tests/testdata/compile/standalone_error_module_with_imports_2.ts similarity index 100% rename from cli/tests/testdata/standalone_error_module_with_imports_2.ts rename to cli/tests/testdata/compile/standalone_error_module_with_imports_2.ts diff --git a/cli/tests/testdata/standalone_follow_redirects.ts b/cli/tests/testdata/compile/standalone_follow_redirects.ts similarity index 100% rename from cli/tests/testdata/standalone_follow_redirects.ts rename to cli/tests/testdata/compile/standalone_follow_redirects.ts diff --git a/cli/tests/testdata/standalone_follow_redirects_2.js b/cli/tests/testdata/compile/standalone_follow_redirects_2.js similarity index 100% rename from cli/tests/testdata/standalone_follow_redirects_2.js rename to cli/tests/testdata/compile/standalone_follow_redirects_2.js diff --git a/cli/tests/testdata/standalone_import_datauri.ts b/cli/tests/testdata/compile/standalone_import_datauri.ts similarity index 100% rename from cli/tests/testdata/standalone_import_datauri.ts rename to cli/tests/testdata/compile/standalone_import_datauri.ts diff --git a/cli/tests/testdata/compile/standalone_import_map.json b/cli/tests/testdata/compile/standalone_import_map.json new file mode 100644 index 0000000000..9e5b90bd7f --- /dev/null +++ b/cli/tests/testdata/compile/standalone_import_map.json @@ -0,0 +1,5 @@ +{ + "imports": { + "hello": "../run/001_hello.js" + } +} diff --git a/cli/tests/testdata/standalone_import_map.ts b/cli/tests/testdata/compile/standalone_import_map.ts similarity index 100% rename from cli/tests/testdata/standalone_import_map.ts rename to cli/tests/testdata/compile/standalone_import_map.ts diff --git a/cli/tests/testdata/standalone_runtime_flags.ts b/cli/tests/testdata/compile/standalone_runtime_flags.ts similarity index 100% rename from cli/tests/testdata/standalone_runtime_flags.ts rename to cli/tests/testdata/compile/standalone_runtime_flags.ts diff --git a/cli/tests/testdata/config.ts.out b/cli/tests/testdata/config.ts.out deleted file mode 100644 index 44b123f976..0000000000 --- a/cli/tests/testdata/config.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -[WILDCARD]Unsupported compiler options in "[WILDCARD]config.tsconfig.json". - The following options were ignored: - module, target -Check [WILDCARD]/config.ts diff --git a/cli/tests/testdata/config_json_import.ts b/cli/tests/testdata/config_json_import.ts deleted file mode 100644 index d344c0fb75..0000000000 --- a/cli/tests/testdata/config_json_import.ts +++ /dev/null @@ -1,2 +0,0 @@ -import config from "./jsx/deno-jsx.json" assert { type: "json" }; -console.log(config); diff --git a/cli/tests/testdata/config_types_remote.tsconfig.json b/cli/tests/testdata/config_types_remote.tsconfig.json deleted file mode 100644 index f40d5b1c46..0000000000 --- a/cli/tests/testdata/config_types_remote.tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "types": [ - "http://localhost:4545/subdir/types.d.ts" - ] - } -} diff --git a/cli/tests/testdata/disallow_http_from_https_js.out b/cli/tests/testdata/disallow_http_from_https_js.out deleted file mode 100644 index e4f9e8d593..0000000000 --- a/cli/tests/testdata/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/001_hello.js - at https://localhost:5545/disallow_http_from_https.js:2:8 diff --git a/cli/tests/testdata/disallow_http_from_https_ts.out b/cli/tests/testdata/disallow_http_from_https_ts.out deleted file mode 100644 index 3f885001f5..0000000000 --- a/cli/tests/testdata/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/001_hello.js - at https://localhost:5545/disallow_http_from_https.ts:2:8 diff --git a/cli/tests/testdata/060_deno_doc_displays_all_overloads_in_details_view.ts b/cli/tests/testdata/doc/060_deno_doc_displays_all_overloads_in_details_view.ts similarity index 100% rename from cli/tests/testdata/060_deno_doc_displays_all_overloads_in_details_view.ts rename to cli/tests/testdata/doc/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/doc/060_deno_doc_displays_all_overloads_in_details_view.ts.out similarity index 100% rename from cli/tests/testdata/060_deno_doc_displays_all_overloads_in_details_view.ts.out rename to cli/tests/testdata/doc/060_deno_doc_displays_all_overloads_in_details_view.ts.out diff --git a/cli/tests/testdata/deno_doc.ts b/cli/tests/testdata/doc/deno_doc.ts similarity index 100% rename from cli/tests/testdata/deno_doc.ts rename to cli/tests/testdata/doc/deno_doc.ts diff --git a/cli/tests/testdata/deno_doc_builtin.out b/cli/tests/testdata/doc/deno_doc_builtin.out similarity index 100% rename from cli/tests/testdata/deno_doc_builtin.out rename to cli/tests/testdata/doc/deno_doc_builtin.out diff --git a/cli/tests/testdata/empty.out b/cli/tests/testdata/empty.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cli/tests/testdata/error_002.ts b/cli/tests/testdata/error_002.ts deleted file mode 100644 index 6aa0fcc3b6..0000000000 --- a/cli/tests/testdata/error_002.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { throwsError } from "./subdir/mod1.ts"; - -function foo() { - throwsError(); -} - -foo(); diff --git a/cli/tests/testdata/error_010_nonexistent_arg.disabled b/cli/tests/testdata/error_010_nonexistent_arg.disabled deleted file mode 100644 index 9d183107c3..0000000000 --- a/cli/tests/testdata/error_010_nonexistent_arg.disabled +++ /dev/null @@ -1,4 +0,0 @@ -args: not-a-valid-filename.ts -output: tests/error_010_nonexistent_arg.out -exit_code: 1 -check_stderr: true diff --git a/cli/tests/testdata/error_010_nonexistent_arg.out b/cli/tests/testdata/error_010_nonexistent_arg.out deleted file mode 100644 index ef4f7b0412..0000000000 --- a/cli/tests/testdata/error_010_nonexistent_arg.out +++ /dev/null @@ -1 +0,0 @@ -[WILDCARD]Cannot resolve module "file:[WILDCARD]not-a-valid-filename.ts" from "." diff --git a/cli/tests/testdata/error_026_remote_import_error.ts b/cli/tests/testdata/error_026_remote_import_error.ts deleted file mode 100644 index 2718e768af..0000000000 --- a/cli/tests/testdata/error_026_remote_import_error.ts +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index bec0cf1c56..0000000000 --- a/cli/tests/testdata/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/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/testdata/error_no_check.ts b/cli/tests/testdata/error_no_check.ts deleted file mode 100644 index db9257a1d3..0000000000 --- a/cli/tests/testdata/error_no_check.ts +++ /dev/null @@ -1 +0,0 @@ -export { AnInterface, isAnInterface } from "./subdir/type_and_code.ts"; diff --git a/cli/tests/testdata/error_no_check.ts.out b/cli/tests/testdata/error_no_check.ts.out deleted file mode 100644 index cac1367ba2..0000000000 --- a/cli/tests/testdata/error_no_check.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Uncaught SyntaxError: The requested module './subdir/type_and_code.ts' does not provide an export named 'AnInterface' -[WILDCARD] \ No newline at end of file diff --git a/cli/tests/testdata/error_type_definitions.ts b/cli/tests/testdata/error_type_definitions.ts deleted file mode 100644 index ceb11787e5..0000000000 --- a/cli/tests/testdata/error_type_definitions.ts +++ /dev/null @@ -1,5 +0,0 @@ -// @deno-types="./type_definitions/bar.d.ts" -import { Bar } from "./type_definitions/bar.js"; - -const bar = new Bar(); -console.log(bar); diff --git a/cli/tests/testdata/error_worker_permissions_local.ts b/cli/tests/testdata/error_worker_permissions_local.ts deleted file mode 100644 index ed938a025e..0000000000 --- a/cli/tests/testdata/error_worker_permissions_local.ts +++ /dev/null @@ -1,4 +0,0 @@ -new Worker( - import.meta.resolve("./subdeb/worker_types.ts"), - { type: "module" }, -); diff --git a/cli/tests/testdata/041_dyn_import_eval.out b/cli/tests/testdata/eval/dyn_import_eval.out similarity index 100% rename from cli/tests/testdata/041_dyn_import_eval.out rename to cli/tests/testdata/eval/dyn_import_eval.out diff --git a/cli/tests/testdata/export_type_def.ts b/cli/tests/testdata/export_type_def.ts deleted file mode 100644 index e33b70a644..0000000000 --- a/cli/tests/testdata/export_type_def.ts +++ /dev/null @@ -1,2 +0,0 @@ -// @deno-types="./type_definitions/foo.d.ts" -export { foo } from "./type_definitions/foo.js"; diff --git a/cli/tests/testdata/fix_emittable_skipped.js b/cli/tests/testdata/fix_emittable_skipped.js deleted file mode 100644 index f61907b064..0000000000 --- a/cli/tests/testdata/fix_emittable_skipped.js +++ /dev/null @@ -1,7 +0,0 @@ -/// - -import "./subdir/polyfill.ts"; - -export const a = "a"; - -console.log(globalThis.polyfill); diff --git a/cli/tests/testdata/fix_js_import_js.ts b/cli/tests/testdata/fix_js_import_js.ts deleted file mode 100644 index c9f341748c..0000000000 --- a/cli/tests/testdata/fix_js_import_js.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { isMod4 } from "./subdir/mod6.js"; - -console.log(isMod4); diff --git a/cli/tests/testdata/fix_js_imports.ts b/cli/tests/testdata/fix_js_imports.ts deleted file mode 100644 index 4770b1ab65..0000000000 --- a/cli/tests/testdata/fix_js_imports.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as amdLike from "./subdir/amd_like.js"; - -console.log(amdLike); diff --git a/cli/tests/testdata/badly_formatted.json b/cli/tests/testdata/fmt/badly_formatted.json similarity index 100% rename from cli/tests/testdata/badly_formatted.json rename to cli/tests/testdata/fmt/badly_formatted.json diff --git a/cli/tests/testdata/badly_formatted.md b/cli/tests/testdata/fmt/badly_formatted.md similarity index 100% rename from cli/tests/testdata/badly_formatted.md rename to cli/tests/testdata/fmt/badly_formatted.md diff --git a/cli/tests/testdata/badly_formatted.mjs b/cli/tests/testdata/fmt/badly_formatted.mjs similarity index 100% rename from cli/tests/testdata/badly_formatted.mjs rename to cli/tests/testdata/fmt/badly_formatted.mjs diff --git a/cli/tests/testdata/badly_formatted_fixed.js b/cli/tests/testdata/fmt/badly_formatted_fixed.js similarity index 100% rename from cli/tests/testdata/badly_formatted_fixed.js rename to cli/tests/testdata/fmt/badly_formatted_fixed.js diff --git a/cli/tests/testdata/badly_formatted_fixed.json b/cli/tests/testdata/fmt/badly_formatted_fixed.json similarity index 100% rename from cli/tests/testdata/badly_formatted_fixed.json rename to cli/tests/testdata/fmt/badly_formatted_fixed.json diff --git a/cli/tests/testdata/badly_formatted_fixed.md b/cli/tests/testdata/fmt/badly_formatted_fixed.md similarity index 100% rename from cli/tests/testdata/badly_formatted_fixed.md rename to cli/tests/testdata/fmt/badly_formatted_fixed.md diff --git a/cli/tests/testdata/fmt/with_config/subdir/a.ts b/cli/tests/testdata/fmt/with_config/subdir/a.ts index 50db0d2e10..4baf8d485d 100644 --- a/cli/tests/testdata/fmt/with_config/subdir/a.ts +++ b/cli/tests/testdata/fmt/with_config/subdir/a.ts @@ -3,7 +3,7 @@ Deno.test( async function responseClone() { const response = await fetch( - 'http://localhost:4545/fixture.json', + 'http://localhost:4545/assets/fixture.json', ); const response1 = response.clone(); diff --git a/cli/tests/testdata/fmt/with_config/subdir/b.ts b/cli/tests/testdata/fmt/with_config/subdir/b.ts index 840198d898..d7eb08b094 100644 --- a/cli/tests/testdata/fmt/with_config/subdir/b.ts +++ b/cli/tests/testdata/fmt/with_config/subdir/b.ts @@ -3,10 +3,10 @@ Deno.test( { perms: { net: true } }, async function fetchBodyUsedCancelStream() { const response = await fetch( - "http://localhost:4545/fixture.json", + "http://localhost:4545/assets/fixture.json", ); assert(response.body !== null); - + assertEquals(response.bodyUsed, false); const promise = response.body.cancel(); assertEquals(response.bodyUsed, true); diff --git a/cli/tests/testdata/import_meta2.ts b/cli/tests/testdata/import_meta2.ts deleted file mode 100644 index 7f59a5a462..0000000000 --- a/cli/tests/testdata/import_meta2.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("import_meta2", import.meta.url, import.meta.main); diff --git a/cli/tests/testdata/031_info_ts_error.out b/cli/tests/testdata/info/031_info_ts_error.out similarity index 100% rename from cli/tests/testdata/031_info_ts_error.out rename to cli/tests/testdata/info/031_info_ts_error.out diff --git a/cli/tests/testdata/031_info_ts_error.ts b/cli/tests/testdata/info/031_info_ts_error.ts similarity index 100% rename from cli/tests/testdata/031_info_ts_error.ts rename to cli/tests/testdata/info/031_info_ts_error.ts diff --git a/cli/tests/testdata/041_info_flag.out b/cli/tests/testdata/info/041_info_flag.out similarity index 100% rename from cli/tests/testdata/041_info_flag.out rename to cli/tests/testdata/info/041_info_flag.out diff --git a/cli/tests/testdata/041_info_flag_location.out b/cli/tests/testdata/info/041_info_flag_location.out similarity index 100% rename from cli/tests/testdata/041_info_flag_location.out rename to cli/tests/testdata/info/041_info_flag_location.out diff --git a/cli/tests/testdata/049_info_flag_script_jsx.out b/cli/tests/testdata/info/049_info_flag_script_jsx.out similarity index 92% rename from cli/tests/testdata/049_info_flag_script_jsx.out rename to cli/tests/testdata/info/049_info_flag_script_jsx.out index 860d127fe6..16736c8933 100644 --- a/cli/tests/testdata/049_info_flag_script_jsx.out +++ b/cli/tests/testdata/info/049_info_flag_script_jsx.out @@ -3,7 +3,7 @@ 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://127.0.0.1:4545/run/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]) diff --git a/cli/tests/testdata/054_info_local_imports.out b/cli/tests/testdata/info/054_info_local_imports.out similarity index 100% rename from cli/tests/testdata/054_info_local_imports.out rename to cli/tests/testdata/info/054_info_local_imports.out diff --git a/cli/tests/testdata/065_import_map_info.out b/cli/tests/testdata/info/065_import_map_info.out similarity index 100% rename from cli/tests/testdata/065_import_map_info.out rename to cli/tests/testdata/info/065_import_map_info.out diff --git a/cli/tests/testdata/076_info_json_deps_order.out b/cli/tests/testdata/info/076_info_json_deps_order.out similarity index 100% rename from cli/tests/testdata/076_info_json_deps_order.out rename to cli/tests/testdata/info/076_info_json_deps_order.out diff --git a/cli/tests/testdata/076_info_json_deps_order.ts b/cli/tests/testdata/info/076_info_json_deps_order.ts similarity index 100% rename from cli/tests/testdata/076_info_json_deps_order.ts rename to cli/tests/testdata/info/076_info_json_deps_order.ts diff --git a/cli/tests/testdata/error_009_missing_js_module.js b/cli/tests/testdata/info/error_009_missing_js_module.js similarity index 100% rename from cli/tests/testdata/error_009_missing_js_module.js rename to cli/tests/testdata/info/error_009_missing_js_module.js diff --git a/cli/tests/testdata/error_009_missing_js_module.js.out b/cli/tests/testdata/info/error_009_missing_js_module.js.out similarity index 100% rename from cli/tests/testdata/error_009_missing_js_module.js.out rename to cli/tests/testdata/info/error_009_missing_js_module.js.out diff --git a/cli/tests/testdata/info_json.out b/cli/tests/testdata/info/info_json.out similarity index 100% rename from cli/tests/testdata/info_json.out rename to cli/tests/testdata/info/info_json.out diff --git a/cli/tests/testdata/info_json_location.out b/cli/tests/testdata/info/info_json_location.out similarity index 100% rename from cli/tests/testdata/info_json_location.out rename to cli/tests/testdata/info/info_json_location.out diff --git a/cli/tests/testdata/info_missing_module.out b/cli/tests/testdata/info/info_missing_module.out similarity index 100% rename from cli/tests/testdata/info_missing_module.out rename to cli/tests/testdata/info/info_missing_module.out diff --git a/cli/tests/testdata/info_recursive_imports_test.out b/cli/tests/testdata/info/info_recursive_imports_test.out similarity index 100% rename from cli/tests/testdata/info_recursive_imports_test.out rename to cli/tests/testdata/info/info_recursive_imports_test.out diff --git a/cli/tests/testdata/info_recursive_imports_test.ts b/cli/tests/testdata/info/info_recursive_imports_test.ts similarity index 100% rename from cli/tests/testdata/info_recursive_imports_test.ts rename to cli/tests/testdata/info/info_recursive_imports_test.ts diff --git a/cli/tests/testdata/info_type_import.out b/cli/tests/testdata/info/info_type_import.out similarity index 100% rename from cli/tests/testdata/info_type_import.out rename to cli/tests/testdata/info/info_type_import.out diff --git a/cli/tests/testdata/info/info_type_import.ts b/cli/tests/testdata/info/info_type_import.ts new file mode 100644 index 0000000000..4db9f33871 --- /dev/null +++ b/cli/tests/testdata/info/info_type_import.ts @@ -0,0 +1,3 @@ +import { AnInterface as _, isAnInterface } from "../subdir/type_and_code.ts"; + +isAnInterface({}); diff --git a/cli/tests/testdata/055_info_file_json.out b/cli/tests/testdata/info/json_output/main.out similarity index 89% rename from cli/tests/testdata/055_info_file_json.out rename to cli/tests/testdata/info/json_output/main.out index 2dc10a0c2c..124fc7351e 100644 --- a/cli/tests/testdata/055_info_file_json.out +++ b/cli/tests/testdata/info/json_output/main.out @@ -1,12 +1,12 @@ { "roots": [ - "file://[WILDCARD]/005_more_imports.ts" + "file://[WILDCARD]/info/json_output/main.ts" ], "modules": [ { "dependencies": [ { - "specifier": "./subdir/mod1.ts", + "specifier": "../../subdir/mod1.ts", "code": { "specifier": "file://[WILDCARD]/subdir/mod1.ts", "span": { @@ -16,17 +16,17 @@ }, "end": { "line": 0, - "character": 70 + "character": 74 } } } } ], "kind": "esm", - "local": "[WILDCARD]005_more_imports.ts", + "local": "[WILDCARD]main.ts", [WILDCARD] "mediaType": "TypeScript", - "specifier": "file://[WILDCARD]/005_more_imports.ts" + "specifier": "file://[WILDCARD]/json_output/main.ts" }, { "dependencies": [ diff --git a/cli/tests/testdata/info/json_output/main.ts b/cli/tests/testdata/info/json_output/main.ts new file mode 100644 index 0000000000..927bc55ed0 --- /dev/null +++ b/cli/tests/testdata/info/json_output/main.ts @@ -0,0 +1,11 @@ +import { printHello3, returnsFoo2, returnsHi } from "../../subdir/mod1.ts"; + +printHello3(); + +if (returnsHi() !== "Hi") { + throw Error("Unexpected"); +} + +if (returnsFoo2() !== "Foo") { + throw Error("Unexpected"); +} diff --git a/cli/tests/testdata/022_info_flag_script.out b/cli/tests/testdata/info/multiple_imports.out similarity index 92% rename from cli/tests/testdata/022_info_flag_script.out rename to cli/tests/testdata/info/multiple_imports.out index e86b7dda4e..d4e3153970 100644 --- a/cli/tests/testdata/022_info_flag_script.out +++ b/cli/tests/testdata/info/multiple_imports.out @@ -3,7 +3,7 @@ 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://127.0.0.1:4545/run/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]) diff --git a/cli/tests/testdata/recursive_imports/A.ts b/cli/tests/testdata/info/recursive_imports/A.ts similarity index 100% rename from cli/tests/testdata/recursive_imports/A.ts rename to cli/tests/testdata/info/recursive_imports/A.ts diff --git a/cli/tests/testdata/recursive_imports/B.ts b/cli/tests/testdata/info/recursive_imports/B.ts similarity index 100% rename from cli/tests/testdata/recursive_imports/B.ts rename to cli/tests/testdata/info/recursive_imports/B.ts diff --git a/cli/tests/testdata/recursive_imports/C.ts b/cli/tests/testdata/info/recursive_imports/C.ts similarity index 100% rename from cli/tests/testdata/recursive_imports/C.ts rename to cli/tests/testdata/info/recursive_imports/C.ts diff --git a/cli/tests/testdata/recursive_imports/common.ts b/cli/tests/testdata/info/recursive_imports/common.ts similarity index 100% rename from cli/tests/testdata/recursive_imports/common.ts rename to cli/tests/testdata/info/recursive_imports/common.ts diff --git a/cli/tests/testdata/info_type_import.ts b/cli/tests/testdata/info_type_import.ts deleted file mode 100644 index eeef46c89c..0000000000 --- a/cli/tests/testdata/info_type_import.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { AnInterface as _, isAnInterface } from "./subdir/type_and_code.ts"; - -isAnInterface({}); diff --git a/cli/tests/testdata/inline_js_source_map_2.js b/cli/tests/testdata/inline_js_source_map_2.js deleted file mode 100644 index 036f351b9b..0000000000 --- a/cli/tests/testdata/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,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 deleted file mode 100644 index 4f9127da66..0000000000 --- a/cli/tests/testdata/inline_js_source_map_2.js.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Uncaught Error: Hello world! - at http://localhost:4545/inline_js_source_map_2.ts:6:7 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 deleted file mode 100644 index 5bea615b8c..0000000000 --- a/cli/tests/testdata/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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L2lubGluZV9qc19zb3VyY2VfbWFwXzIudHMiXSwic291cmNlc0NvbnRlbnQiOlsiMSsxO1xuaW50ZXJmYWNlIFRlc3Qge1xuICBoZWxsbzogc3RyaW5nO1xufVxuXG50aHJvdyBuZXcgRXJyb3IoXCJIZWxsbyB3b3JsZCFcIiBhcyB1bmtub3duIGFzIHN0cmluZyk7XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLENBQUMsR0FBQyxDQUFDLENBQUM7QUFLSixNQUFNLElBQUksS0FBSyxDQUFDLGNBQStCLENBQUMsQ0FBQyJ9 \ No newline at end of file diff --git a/cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js.out b/cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js.out deleted file mode 100644 index 4f9127da66..0000000000 --- a/cli/tests/testdata/inline_js_source_map_2_with_inline_contents.js.out +++ /dev/null @@ -1,2 +0,0 @@ -error: Uncaught Error: Hello world! - 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 deleted file mode 100644 index decf47bdcc..0000000000 --- a/cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js +++ /dev/null @@ -1,4 +0,0 @@ -"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/testdata/issue13562.ts b/cli/tests/testdata/issue13562.ts deleted file mode 100644 index 9f3134aef2..0000000000 --- a/cli/tests/testdata/issue13562.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello3 } from "./subdir/mod1.ts?q=.json"; - -printHello3(); diff --git a/cli/tests/testdata/lock_check_err.out b/cli/tests/testdata/lock_check_err.out deleted file mode 100644 index 3c5eceb8cf..0000000000 --- a/cli/tests/testdata/lock_check_err.out +++ /dev/null @@ -1,3 +0,0 @@ -[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/003_relative_import.ts - Lock file: lock_check_err.json diff --git a/cli/tests/testdata/lsp/code_action_redirect_response.json b/cli/tests/testdata/lsp/code_action_redirect_response.json index b2bb470bd9..2351275703 100644 --- a/cli/tests/testdata/lsp/code_action_redirect_response.json +++ b/cli/tests/testdata/lsp/code_action_redirect_response.json @@ -17,10 +17,10 @@ "severity": 3, "code": "redirect", "source": "deno", - "message": "The import of \"http://127.0.0.1:4545/x_deno_warning.js\" was redirected to \"http://127.0.0.1:4545/x_deno_warning_redirect.js\".", + "message": "The import of \"http://127.0.0.1:4545/x_deno_warning.js\" was redirected to \"http://127.0.0.1:4545/lsp/x_deno_warning_redirect.js\".", "data": { "specifier": "http://127.0.0.1:4545/x_deno_warning.js", - "redirect": "http://127.0.0.1:4545/x_deno_warning_redirect.js" + "redirect": "http://127.0.0.1:4545/lsp/x_deno_warning_redirect.js" } } ], @@ -38,7 +38,7 @@ "character": 60 } }, - "newText": "\"http://127.0.0.1:4545/x_deno_warning_redirect.js\"" + "newText": "\"http://127.0.0.1:4545/lsp/x_deno_warning_redirect.js\"" } ] } diff --git a/cli/tests/testdata/x_deno_warning_redirect.js b/cli/tests/testdata/lsp/x_deno_warning_redirect.js similarity index 100% rename from cli/tests/testdata/x_deno_warning_redirect.js rename to cli/tests/testdata/lsp/x_deno_warning_redirect.js diff --git a/cli/tests/testdata/main_module.ts b/cli/tests/testdata/main_module.ts deleted file mode 100644 index 19988f4bff..0000000000 --- a/cli/tests/testdata/main_module.ts +++ /dev/null @@ -1,3 +0,0 @@ -console.log("main_module", Deno.mainModule); - -import "./main_module2.ts"; diff --git a/cli/tests/testdata/main_module.ts.out b/cli/tests/testdata/main_module.ts.out deleted file mode 100644 index 817bb6b8cf..0000000000 --- a/cli/tests/testdata/main_module.ts.out +++ /dev/null @@ -1,2 +0,0 @@ -main_module2 [WILDCARD]/main_module.ts -main_module [WILDCARD]/main_module.ts diff --git a/cli/tests/testdata/main_module2.ts b/cli/tests/testdata/main_module2.ts deleted file mode 100644 index 585615c7f9..0000000000 --- a/cli/tests/testdata/main_module2.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("main_module2", Deno.mainModule); diff --git a/cli/tests/testdata/module_detection_force.ts b/cli/tests/testdata/module_detection_force.ts deleted file mode 100644 index 7729ae366c..0000000000 --- a/cli/tests/testdata/module_detection_force.ts +++ /dev/null @@ -1,3 +0,0 @@ -const a = 1; -await import("./module_detection_force_import.ts"); -console.log(a); diff --git a/cli/tests/testdata/nested_error.ts.out b/cli/tests/testdata/nested_error.ts.out deleted file mode 100644 index 042a179ff0..0000000000 --- a/cli/tests/testdata/nested_error.ts.out +++ /dev/null @@ -1,4 +0,0 @@ -error: Uncaught { - foo: Error - at file:///[WILDCARD]testdata/nested_error.ts:2:8 -} diff --git a/cli/tests/testdata/no_color.js b/cli/tests/testdata/no_color.js deleted file mode 100644 index cea11a52f0..0000000000 --- a/cli/tests/testdata/no_color.js +++ /dev/null @@ -1 +0,0 @@ -console.log("noColor", Deno.noColor); diff --git a/cli/tests/testdata/raw_mode.ts b/cli/tests/testdata/raw_mode.ts deleted file mode 100644 index 87502e7d9f..0000000000 --- a/cli/tests/testdata/raw_mode.ts +++ /dev/null @@ -1,18 +0,0 @@ -Deno.setRaw(0, true); -Deno.setRaw(0, true); // Can be called multiple times - -Deno.stdout.writeSync(new TextEncoder().encode("S")); - -const buf = new Uint8Array(3); -for (let i = 0; i < 3; i++) { - const nread = await Deno.stdin.read(buf); - if (nread === null) { - break; - } else { - const data = new TextDecoder().decode(buf.subarray(0, nread)); - Deno.stdout.writeSync(new TextEncoder().encode(data.toUpperCase())); - } -} - -Deno.setRaw(0, false); // restores old mode. -Deno.setRaw(0, false); // Can be safely called multiple times diff --git a/cli/tests/testdata/import_type.ts b/cli/tests/testdata/repl/import_type.ts similarity index 100% rename from cli/tests/testdata/import_type.ts rename to cli/tests/testdata/repl/import_type.ts diff --git a/cli/tests/testdata/001_hello.js b/cli/tests/testdata/run/001_hello.js similarity index 100% rename from cli/tests/testdata/001_hello.js rename to cli/tests/testdata/run/001_hello.js diff --git a/cli/tests/testdata/001_hello.js.out b/cli/tests/testdata/run/001_hello.js.out similarity index 100% rename from cli/tests/testdata/001_hello.js.out rename to cli/tests/testdata/run/001_hello.js.out diff --git a/cli/tests/testdata/002_hello.ts b/cli/tests/testdata/run/002_hello.ts similarity index 100% rename from cli/tests/testdata/002_hello.ts rename to cli/tests/testdata/run/002_hello.ts diff --git a/cli/tests/testdata/002_hello.ts.out b/cli/tests/testdata/run/002_hello.ts.out similarity index 100% rename from cli/tests/testdata/002_hello.ts.out rename to cli/tests/testdata/run/002_hello.ts.out diff --git a/cli/tests/testdata/run/003_relative_import.ts b/cli/tests/testdata/run/003_relative_import.ts new file mode 100644 index 0000000000..840121bfe5 --- /dev/null +++ b/cli/tests/testdata/run/003_relative_import.ts @@ -0,0 +1,3 @@ +import { printHello } from "../subdir/print_hello.ts"; + +printHello(); diff --git a/cli/tests/testdata/003_relative_import.ts.out b/cli/tests/testdata/run/003_relative_import.ts.out similarity index 100% rename from cli/tests/testdata/003_relative_import.ts.out rename to cli/tests/testdata/run/003_relative_import.ts.out diff --git a/cli/tests/testdata/004_set_timeout.ts b/cli/tests/testdata/run/004_set_timeout.ts similarity index 100% rename from cli/tests/testdata/004_set_timeout.ts rename to cli/tests/testdata/run/004_set_timeout.ts diff --git a/cli/tests/testdata/004_set_timeout.ts.out b/cli/tests/testdata/run/004_set_timeout.ts.out similarity index 100% rename from cli/tests/testdata/004_set_timeout.ts.out rename to cli/tests/testdata/run/004_set_timeout.ts.out diff --git a/cli/tests/testdata/005_more_imports.ts b/cli/tests/testdata/run/005_more_imports.ts similarity index 65% rename from cli/tests/testdata/005_more_imports.ts rename to cli/tests/testdata/run/005_more_imports.ts index 0266bf46c7..6c96fac64c 100644 --- a/cli/tests/testdata/005_more_imports.ts +++ b/cli/tests/testdata/run/005_more_imports.ts @@ -1,4 +1,4 @@ -import { printHello3, returnsFoo2, returnsHi } from "./subdir/mod1.ts"; +import { printHello3, returnsFoo2, returnsHi } from "../subdir/mod1.ts"; printHello3(); diff --git a/cli/tests/testdata/005_more_imports.ts.out b/cli/tests/testdata/run/005_more_imports.ts.out similarity index 100% rename from cli/tests/testdata/005_more_imports.ts.out rename to cli/tests/testdata/run/005_more_imports.ts.out diff --git a/cli/tests/testdata/006_url_imports.ts b/cli/tests/testdata/run/006_url_imports.ts similarity index 100% rename from cli/tests/testdata/006_url_imports.ts rename to cli/tests/testdata/run/006_url_imports.ts diff --git a/cli/tests/testdata/006_url_imports.ts.out b/cli/tests/testdata/run/006_url_imports.ts.out similarity index 100% rename from cli/tests/testdata/006_url_imports.ts.out rename to cli/tests/testdata/run/006_url_imports.ts.out diff --git a/cli/tests/testdata/012_async.ts b/cli/tests/testdata/run/012_async.ts similarity index 100% rename from cli/tests/testdata/012_async.ts rename to cli/tests/testdata/run/012_async.ts diff --git a/cli/tests/testdata/012_async.ts.out b/cli/tests/testdata/run/012_async.ts.out similarity index 100% rename from cli/tests/testdata/012_async.ts.out rename to cli/tests/testdata/run/012_async.ts.out diff --git a/cli/tests/testdata/013_dynamic_import.ts b/cli/tests/testdata/run/013_dynamic_import.ts similarity index 91% rename from cli/tests/testdata/013_dynamic_import.ts rename to cli/tests/testdata/run/013_dynamic_import.ts index d4dc551524..fc231936c0 100644 --- a/cli/tests/testdata/013_dynamic_import.ts +++ b/cli/tests/testdata/run/013_dynamic_import.ts @@ -1,6 +1,6 @@ (async () => { const { returnsHi, returnsFoo2, printHello3 } = await import( - "./subdir/mod1.ts" + "../subdir/mod1.ts" ); printHello3(); diff --git a/cli/tests/testdata/013_dynamic_import.ts.out b/cli/tests/testdata/run/013_dynamic_import.ts.out similarity index 100% rename from cli/tests/testdata/013_dynamic_import.ts.out rename to cli/tests/testdata/run/013_dynamic_import.ts.out diff --git a/cli/tests/testdata/run/014_duplicate_import.ts b/cli/tests/testdata/run/014_duplicate_import.ts new file mode 100644 index 0000000000..c7dd881cf0 --- /dev/null +++ b/cli/tests/testdata/run/014_duplicate_import.ts @@ -0,0 +1,9 @@ +// with all the imports of the same module, the module should only be +// instantiated once +import "../subdir/auto_print_hello.ts"; + +import "../subdir/auto_print_hello.ts"; + +(async () => { + await import("../subdir/auto_print_hello.ts"); +})(); diff --git a/cli/tests/testdata/014_duplicate_import.ts.out b/cli/tests/testdata/run/014_duplicate_import.ts.out similarity index 100% rename from cli/tests/testdata/014_duplicate_import.ts.out rename to cli/tests/testdata/run/014_duplicate_import.ts.out diff --git a/cli/tests/testdata/015_duplicate_parallel_import.js b/cli/tests/testdata/run/015_duplicate_parallel_import.js similarity index 91% rename from cli/tests/testdata/015_duplicate_parallel_import.js rename to cli/tests/testdata/run/015_duplicate_parallel_import.js index 172eeaf533..2fbe2c732e 100644 --- a/cli/tests/testdata/015_duplicate_parallel_import.js +++ b/cli/tests/testdata/run/015_duplicate_parallel_import.js @@ -3,7 +3,7 @@ const promises = new Array(100) .fill(null) - .map(() => import("./subdir/mod1.ts")); + .map(() => import("../subdir/mod1.ts")); Promise.all(promises).then((imports) => { const mod = imports.reduce((first, cur) => { diff --git a/cli/tests/testdata/015_duplicate_parallel_import.js.out b/cli/tests/testdata/run/015_duplicate_parallel_import.js.out similarity index 100% rename from cli/tests/testdata/015_duplicate_parallel_import.js.out rename to cli/tests/testdata/run/015_duplicate_parallel_import.js.out diff --git a/cli/tests/testdata/016_double_await.ts b/cli/tests/testdata/run/016_double_await.ts similarity index 100% rename from cli/tests/testdata/016_double_await.ts rename to cli/tests/testdata/run/016_double_await.ts diff --git a/cli/tests/testdata/016_double_await.ts.out b/cli/tests/testdata/run/016_double_await.ts.out similarity index 100% rename from cli/tests/testdata/016_double_await.ts.out rename to cli/tests/testdata/run/016_double_await.ts.out diff --git a/cli/tests/testdata/017_import_redirect.ts b/cli/tests/testdata/run/017_import_redirect.ts similarity index 100% rename from cli/tests/testdata/017_import_redirect.ts rename to cli/tests/testdata/run/017_import_redirect.ts diff --git a/cli/tests/testdata/017_import_redirect.ts.out b/cli/tests/testdata/run/017_import_redirect.ts.out similarity index 100% rename from cli/tests/testdata/017_import_redirect.ts.out rename to cli/tests/testdata/run/017_import_redirect.ts.out diff --git a/cli/tests/testdata/017_import_redirect_info.out b/cli/tests/testdata/run/017_import_redirect_info.out similarity index 100% rename from cli/tests/testdata/017_import_redirect_info.out rename to cli/tests/testdata/run/017_import_redirect_info.out diff --git a/cli/tests/testdata/018_async_catch.ts b/cli/tests/testdata/run/018_async_catch.ts similarity index 100% rename from cli/tests/testdata/018_async_catch.ts rename to cli/tests/testdata/run/018_async_catch.ts diff --git a/cli/tests/testdata/018_async_catch.ts.out b/cli/tests/testdata/run/018_async_catch.ts.out similarity index 100% rename from cli/tests/testdata/018_async_catch.ts.out rename to cli/tests/testdata/run/018_async_catch.ts.out diff --git a/cli/tests/testdata/019_media_types.ts b/cli/tests/testdata/run/019_media_types.ts similarity index 100% rename from cli/tests/testdata/019_media_types.ts rename to cli/tests/testdata/run/019_media_types.ts diff --git a/cli/tests/testdata/019_media_types.ts.out b/cli/tests/testdata/run/019_media_types.ts.out similarity index 100% rename from cli/tests/testdata/019_media_types.ts.out rename to cli/tests/testdata/run/019_media_types.ts.out diff --git a/cli/tests/testdata/run/020_json_modules.ts b/cli/tests/testdata/run/020_json_modules.ts new file mode 100644 index 0000000000..b4ae606654 --- /dev/null +++ b/cli/tests/testdata/run/020_json_modules.ts @@ -0,0 +1,2 @@ +import config from "../subdir/config.json"; +console.log(JSON.stringify(config)); diff --git a/cli/tests/testdata/020_json_modules.ts.out b/cli/tests/testdata/run/020_json_modules.ts.out similarity index 100% rename from cli/tests/testdata/020_json_modules.ts.out rename to cli/tests/testdata/run/020_json_modules.ts.out diff --git a/cli/tests/testdata/run/021_mjs_modules.ts b/cli/tests/testdata/run/021_mjs_modules.ts new file mode 100644 index 0000000000..838cd2c382 --- /dev/null +++ b/cli/tests/testdata/run/021_mjs_modules.ts @@ -0,0 +1,2 @@ +import { isMod5 } from "../subdir/mod5.mjs"; +console.log(isMod5); diff --git a/cli/tests/testdata/021_mjs_modules.ts.out b/cli/tests/testdata/run/021_mjs_modules.ts.out similarity index 100% rename from cli/tests/testdata/021_mjs_modules.ts.out rename to cli/tests/testdata/run/021_mjs_modules.ts.out diff --git a/cli/tests/testdata/run/023_no_ext b/cli/tests/testdata/run/023_no_ext new file mode 100644 index 0000000000..d2cd6a0374 --- /dev/null +++ b/cli/tests/testdata/run/023_no_ext @@ -0,0 +1,2 @@ +import * as mod4 from "../subdir/mod4.js"; +console.log(mod4.isMod4); diff --git a/cli/tests/testdata/023_no_ext.out b/cli/tests/testdata/run/023_no_ext.out similarity index 100% rename from cli/tests/testdata/023_no_ext.out rename to cli/tests/testdata/run/023_no_ext.out diff --git a/cli/tests/testdata/025_hrtime.ts b/cli/tests/testdata/run/025_hrtime.ts similarity index 100% rename from cli/tests/testdata/025_hrtime.ts rename to cli/tests/testdata/run/025_hrtime.ts diff --git a/cli/tests/testdata/025_hrtime.ts.out b/cli/tests/testdata/run/025_hrtime.ts.out similarity index 100% rename from cli/tests/testdata/025_hrtime.ts.out rename to cli/tests/testdata/run/025_hrtime.ts.out diff --git a/cli/tests/testdata/025_reload_js_type_error.js b/cli/tests/testdata/run/025_reload_js_type_error.js similarity index 100% rename from cli/tests/testdata/025_reload_js_type_error.js rename to cli/tests/testdata/run/025_reload_js_type_error.js diff --git a/cli/tests/testdata/025_reload_js_type_error.js.out b/cli/tests/testdata/run/025_reload_js_type_error.js.out similarity index 100% rename from cli/tests/testdata/025_reload_js_type_error.js.out rename to cli/tests/testdata/run/025_reload_js_type_error.js.out diff --git a/cli/tests/testdata/026_redirect_javascript.js b/cli/tests/testdata/run/026_redirect_javascript.js similarity index 100% rename from cli/tests/testdata/026_redirect_javascript.js rename to cli/tests/testdata/run/026_redirect_javascript.js diff --git a/cli/tests/testdata/026_redirect_javascript.js.out b/cli/tests/testdata/run/026_redirect_javascript.js.out similarity index 100% rename from cli/tests/testdata/026_redirect_javascript.js.out rename to cli/tests/testdata/run/026_redirect_javascript.js.out diff --git a/cli/tests/testdata/027_redirect_typescript.ts b/cli/tests/testdata/run/027_redirect_typescript.ts similarity index 100% rename from cli/tests/testdata/027_redirect_typescript.ts rename to cli/tests/testdata/run/027_redirect_typescript.ts diff --git a/cli/tests/testdata/027_redirect_typescript.ts.out b/cli/tests/testdata/run/027_redirect_typescript.ts.out similarity index 100% rename from cli/tests/testdata/027_redirect_typescript.ts.out rename to cli/tests/testdata/run/027_redirect_typescript.ts.out diff --git a/cli/tests/testdata/run/028_args.ts b/cli/tests/testdata/run/028_args.ts new file mode 100644 index 0000000000..ec41d52f9e --- /dev/null +++ b/cli/tests/testdata/run/028_args.ts @@ -0,0 +1,3 @@ +Deno.args.forEach((arg) => { + console.log(arg); +}); diff --git a/cli/tests/testdata/028_args.ts.out b/cli/tests/testdata/run/028_args.ts.out similarity index 100% rename from cli/tests/testdata/028_args.ts.out rename to cli/tests/testdata/run/028_args.ts.out diff --git a/cli/tests/testdata/033_import_map.out b/cli/tests/testdata/run/033_import_map.out similarity index 100% rename from cli/tests/testdata/033_import_map.out rename to cli/tests/testdata/run/033_import_map.out diff --git a/cli/tests/testdata/033_import_map_remote.out b/cli/tests/testdata/run/033_import_map_remote.out similarity index 100% rename from cli/tests/testdata/033_import_map_remote.out rename to cli/tests/testdata/run/033_import_map_remote.out diff --git a/cli/tests/testdata/run/035_cached_only_flag.out b/cli/tests/testdata/run/035_cached_only_flag.out new file mode 100644 index 0000000000..3bda398b6e --- /dev/null +++ b/cli/tests/testdata/run/035_cached_only_flag.out @@ -0,0 +1,4 @@ +error: Specifier not found in cache: "http://127.0.0.1:4545/run/019_media_types.ts", --cached-only is specified. + +Caused by: + Specifier not found in cache: "http://127.0.0.1:4545/run/019_media_types.ts", --cached-only is specified. diff --git a/cli/tests/testdata/038_checkjs.js b/cli/tests/testdata/run/038_checkjs.js similarity index 100% rename from cli/tests/testdata/038_checkjs.js rename to cli/tests/testdata/run/038_checkjs.js diff --git a/cli/tests/testdata/038_checkjs.js.out b/cli/tests/testdata/run/038_checkjs.js.out similarity index 100% rename from cli/tests/testdata/038_checkjs.js.out rename to cli/tests/testdata/run/038_checkjs.js.out diff --git a/cli/tests/testdata/042_dyn_import_evalcontext.ts b/cli/tests/testdata/run/042_dyn_import_evalcontext.ts similarity index 100% rename from cli/tests/testdata/042_dyn_import_evalcontext.ts rename to cli/tests/testdata/run/042_dyn_import_evalcontext.ts diff --git a/cli/tests/testdata/042_dyn_import_evalcontext.ts.out b/cli/tests/testdata/run/042_dyn_import_evalcontext.ts.out similarity index 100% rename from cli/tests/testdata/042_dyn_import_evalcontext.ts.out rename to cli/tests/testdata/run/042_dyn_import_evalcontext.ts.out diff --git a/cli/tests/testdata/run/044_bad_resource.ts b/cli/tests/testdata/run/044_bad_resource.ts new file mode 100644 index 0000000000..b956a3e3f2 --- /dev/null +++ b/cli/tests/testdata/run/044_bad_resource.ts @@ -0,0 +1,3 @@ +const file = await Deno.open("./run/044_bad_resource.ts", { read: true }); +file.close(); +await file.seek(10, 0); diff --git a/cli/tests/testdata/044_bad_resource.ts.out b/cli/tests/testdata/run/044_bad_resource.ts.out similarity index 100% rename from cli/tests/testdata/044_bad_resource.ts.out rename to cli/tests/testdata/run/044_bad_resource.ts.out diff --git a/cli/tests/testdata/045_mod.ts b/cli/tests/testdata/run/045_mod.ts similarity index 100% rename from cli/tests/testdata/045_mod.ts rename to cli/tests/testdata/run/045_mod.ts diff --git a/cli/tests/testdata/045_output.ts b/cli/tests/testdata/run/045_output.ts similarity index 100% rename from cli/tests/testdata/045_output.ts rename to cli/tests/testdata/run/045_output.ts diff --git a/cli/tests/testdata/045_programmatic_proxy_client.ts b/cli/tests/testdata/run/045_programmatic_proxy_client.ts similarity index 89% rename from cli/tests/testdata/045_programmatic_proxy_client.ts rename to cli/tests/testdata/run/045_programmatic_proxy_client.ts index 039c6e9ae3..8bc45a4b63 100644 --- a/cli/tests/testdata/045_programmatic_proxy_client.ts +++ b/cli/tests/testdata/run/045_programmatic_proxy_client.ts @@ -8,7 +8,7 @@ const client = Deno.createHttpClient({ }); const res = await fetch( - "http://localhost:4545/045_mod.ts", + "http://localhost:4545/run/045_mod.ts", { client }, ); console.log(`Response http: ${await res.text()}`); diff --git a/cli/tests/testdata/045_proxy_client.ts b/cli/tests/testdata/run/045_proxy_client.ts similarity index 78% rename from cli/tests/testdata/045_proxy_client.ts rename to cli/tests/testdata/run/045_proxy_client.ts index 9d068bc482..2a8728afac 100644 --- a/cli/tests/testdata/045_proxy_client.ts +++ b/cli/tests/testdata/run/045_proxy_client.ts @@ -1,5 +1,5 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. const res = await fetch( - "http://localhost:4545/045_mod.ts", + "http://localhost:4545/run/045_mod.ts", ); console.log(`Response http: ${await res.text()}`); diff --git a/cli/tests/testdata/045_proxy_test.ts b/cli/tests/testdata/run/045_proxy_test.ts similarity index 87% rename from cli/tests/testdata/045_proxy_test.ts rename to cli/tests/testdata/run/045_proxy_test.ts index 6a4e72affc..0ff7184b1e 100644 --- a/cli/tests/testdata/045_proxy_test.ts +++ b/cli/tests/testdata/run/045_proxy_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. -import { Server } from "../../../test_util/std/http/server.ts"; -import { assertEquals } from "../../../test_util/std/testing/asserts.ts"; +import { Server } from "../../../../test_util/std/http/server.ts"; +import { assertEquals } from "../../../../test_util/std/testing/asserts.ts"; const addr = Deno.args[1] || "localhost:4555"; @@ -37,7 +37,7 @@ async function testFetch() { "--quiet", "--reload", "--allow-net", - "045_proxy_client.ts", + "run/045_proxy_client.ts", ], env: { HTTP_PROXY: `http://${addr}`, @@ -53,7 +53,7 @@ async function testModuleDownload() { "cache", "--reload", "--quiet", - "http://localhost:4545/045_mod.ts", + "http://localhost:4545/run/045_mod.ts", ], env: { HTTP_PROXY: `http://${addr}`, @@ -70,7 +70,7 @@ async function testFetchNoProxy() { "--quiet", "--reload", "--allow-net", - "045_proxy_client.ts", + "run/045_proxy_client.ts", ], env: { HTTP_PROXY: "http://not.exising.proxy.server", @@ -87,7 +87,7 @@ async function testModuleDownloadNoProxy() { "cache", "--reload", "--quiet", - "http://localhost:4545/045_mod.ts", + "http://localhost:4545/run/045_mod.ts", ], env: { HTTP_PROXY: "http://not.exising.proxy.server", @@ -106,7 +106,7 @@ async function testFetchProgrammaticProxy() { "--reload", "--allow-net=localhost:4545,localhost:4555", "--unstable", - "045_programmatic_proxy_client.ts", + "run/045_programmatic_proxy_client.ts", ], }); assertEquals(code, 0); diff --git a/cli/tests/testdata/run/045_proxy_test.ts.out b/cli/tests/testdata/run/045_proxy_test.ts.out new file mode 100644 index 0000000000..a1e567a14a --- /dev/null +++ b/cli/tests/testdata/run/045_proxy_test.ts.out @@ -0,0 +1,6 @@ +Proxy server listening on [WILDCARD] +Proxy request to: http://localhost:4545/run/045_mod.ts +Proxy request to: http://localhost:4545/run/045_mod.ts +Proxy request to: http://localhost:4545/run/045_output.ts +Proxy request to: http://localhost:4545/run/045_mod.ts +proxy-authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= diff --git a/cli/tests/testdata/046_jsx_test.tsx b/cli/tests/testdata/run/046_jsx_test.tsx similarity index 100% rename from cli/tests/testdata/046_jsx_test.tsx rename to cli/tests/testdata/run/046_jsx_test.tsx diff --git a/cli/tests/testdata/046_jsx_test.tsx.out b/cli/tests/testdata/run/046_jsx_test.tsx.out similarity index 100% rename from cli/tests/testdata/046_jsx_test.tsx.out rename to cli/tests/testdata/run/046_jsx_test.tsx.out diff --git a/cli/tests/testdata/047_jsx_test.jsx b/cli/tests/testdata/run/047_jsx_test.jsx similarity index 100% rename from cli/tests/testdata/047_jsx_test.jsx rename to cli/tests/testdata/run/047_jsx_test.jsx diff --git a/cli/tests/testdata/047_jsx_test.jsx.out b/cli/tests/testdata/run/047_jsx_test.jsx.out similarity index 100% rename from cli/tests/testdata/047_jsx_test.jsx.out rename to cli/tests/testdata/run/047_jsx_test.jsx.out diff --git a/cli/tests/testdata/048_media_types_jsx.ts b/cli/tests/testdata/run/048_media_types_jsx.ts similarity index 100% rename from cli/tests/testdata/048_media_types_jsx.ts rename to cli/tests/testdata/run/048_media_types_jsx.ts diff --git a/cli/tests/testdata/048_media_types_jsx.ts.out b/cli/tests/testdata/run/048_media_types_jsx.ts.out similarity index 100% rename from cli/tests/testdata/048_media_types_jsx.ts.out rename to cli/tests/testdata/run/048_media_types_jsx.ts.out diff --git a/cli/tests/testdata/run/052_no_remote_flag.out b/cli/tests/testdata/run/052_no_remote_flag.out new file mode 100644 index 0000000000..f511f6d94e --- /dev/null +++ b/cli/tests/testdata/run/052_no_remote_flag.out @@ -0,0 +1,4 @@ +error: A remote specifier was requested: "http://127.0.0.1:4545/run/019_media_types.ts", but --no-remote is specified. + +Caused by: + A remote specifier was requested: "http://127.0.0.1:4545/run/019_media_types.ts", but --no-remote is specified. diff --git a/cli/tests/testdata/056_make_temp_file_write_perm.out b/cli/tests/testdata/run/056_make_temp_file_write_perm.out similarity index 100% rename from cli/tests/testdata/056_make_temp_file_write_perm.out rename to cli/tests/testdata/run/056_make_temp_file_write_perm.out diff --git a/cli/tests/testdata/056_make_temp_file_write_perm.ts b/cli/tests/testdata/run/056_make_temp_file_write_perm.ts similarity index 100% rename from cli/tests/testdata/056_make_temp_file_write_perm.ts rename to cli/tests/testdata/run/056_make_temp_file_write_perm.ts diff --git a/cli/tests/testdata/058_tasks_microtasks_close.ts b/cli/tests/testdata/run/058_tasks_microtasks_close.ts similarity index 100% rename from cli/tests/testdata/058_tasks_microtasks_close.ts rename to cli/tests/testdata/run/058_tasks_microtasks_close.ts diff --git a/cli/tests/testdata/058_tasks_microtasks_close.ts.out b/cli/tests/testdata/run/058_tasks_microtasks_close.ts.out similarity index 100% rename from cli/tests/testdata/058_tasks_microtasks_close.ts.out rename to cli/tests/testdata/run/058_tasks_microtasks_close.ts.out diff --git a/cli/tests/testdata/059_fs_relative_path_perm.ts b/cli/tests/testdata/run/059_fs_relative_path_perm.ts similarity index 100% rename from cli/tests/testdata/059_fs_relative_path_perm.ts rename to cli/tests/testdata/run/059_fs_relative_path_perm.ts diff --git a/cli/tests/testdata/059_fs_relative_path_perm.ts.out b/cli/tests/testdata/run/059_fs_relative_path_perm.ts.out similarity index 100% rename from cli/tests/testdata/059_fs_relative_path_perm.ts.out rename to cli/tests/testdata/run/059_fs_relative_path_perm.ts.out diff --git a/cli/tests/testdata/061_permissions_request.ts b/cli/tests/testdata/run/061_permissions_request.ts similarity index 100% rename from cli/tests/testdata/061_permissions_request.ts rename to cli/tests/testdata/run/061_permissions_request.ts diff --git a/cli/tests/testdata/062_permissions_request_global.ts b/cli/tests/testdata/run/062_permissions_request_global.ts similarity index 100% rename from cli/tests/testdata/062_permissions_request_global.ts rename to cli/tests/testdata/run/062_permissions_request_global.ts diff --git a/cli/tests/testdata/063_permissions_revoke.ts b/cli/tests/testdata/run/063_permissions_revoke.ts similarity index 100% rename from cli/tests/testdata/063_permissions_revoke.ts rename to cli/tests/testdata/run/063_permissions_revoke.ts diff --git a/cli/tests/testdata/063_permissions_revoke.ts.out b/cli/tests/testdata/run/063_permissions_revoke.ts.out similarity index 100% rename from cli/tests/testdata/063_permissions_revoke.ts.out rename to cli/tests/testdata/run/063_permissions_revoke.ts.out diff --git a/cli/tests/testdata/064_permissions_revoke_global.ts b/cli/tests/testdata/run/064_permissions_revoke_global.ts similarity index 100% rename from cli/tests/testdata/064_permissions_revoke_global.ts rename to cli/tests/testdata/run/064_permissions_revoke_global.ts diff --git a/cli/tests/testdata/064_permissions_revoke_global.ts.out b/cli/tests/testdata/run/064_permissions_revoke_global.ts.out similarity index 100% rename from cli/tests/testdata/064_permissions_revoke_global.ts.out rename to cli/tests/testdata/run/064_permissions_revoke_global.ts.out diff --git a/cli/tests/testdata/066_prompt.ts b/cli/tests/testdata/run/066_prompt.ts similarity index 100% rename from cli/tests/testdata/066_prompt.ts rename to cli/tests/testdata/run/066_prompt.ts diff --git a/cli/tests/testdata/070_location.ts b/cli/tests/testdata/run/070_location.ts similarity index 100% rename from cli/tests/testdata/070_location.ts rename to cli/tests/testdata/run/070_location.ts diff --git a/cli/tests/testdata/070_location.ts.out b/cli/tests/testdata/run/070_location.ts.out similarity index 100% rename from cli/tests/testdata/070_location.ts.out rename to cli/tests/testdata/run/070_location.ts.out diff --git a/cli/tests/testdata/071_location_unset.ts b/cli/tests/testdata/run/071_location_unset.ts similarity index 100% rename from cli/tests/testdata/071_location_unset.ts rename to cli/tests/testdata/run/071_location_unset.ts diff --git a/cli/tests/testdata/071_location_unset.ts.out b/cli/tests/testdata/run/071_location_unset.ts.out similarity index 100% rename from cli/tests/testdata/071_location_unset.ts.out rename to cli/tests/testdata/run/071_location_unset.ts.out diff --git a/cli/tests/testdata/run/072_location_relative_fetch.ts b/cli/tests/testdata/run/072_location_relative_fetch.ts new file mode 100644 index 0000000000..b2a291693b --- /dev/null +++ b/cli/tests/testdata/run/072_location_relative_fetch.ts @@ -0,0 +1,2 @@ +const response = await fetch("run/fetch/hello.txt"); +console.log(await response.text()); diff --git a/cli/tests/testdata/072_location_relative_fetch.ts.out b/cli/tests/testdata/run/072_location_relative_fetch.ts.out similarity index 100% rename from cli/tests/testdata/072_location_relative_fetch.ts.out rename to cli/tests/testdata/run/072_location_relative_fetch.ts.out diff --git a/cli/tests/testdata/075_import_local_query_hash.ts b/cli/tests/testdata/run/075_import_local_query_hash.ts similarity index 100% rename from cli/tests/testdata/075_import_local_query_hash.ts rename to cli/tests/testdata/run/075_import_local_query_hash.ts diff --git a/cli/tests/testdata/075_import_local_query_hash.ts.out b/cli/tests/testdata/run/075_import_local_query_hash.ts.out similarity index 100% rename from cli/tests/testdata/075_import_local_query_hash.ts.out rename to cli/tests/testdata/run/075_import_local_query_hash.ts.out diff --git a/cli/tests/testdata/077_fetch_empty.ts b/cli/tests/testdata/run/077_fetch_empty.ts similarity index 100% rename from cli/tests/testdata/077_fetch_empty.ts rename to cli/tests/testdata/run/077_fetch_empty.ts diff --git a/cli/tests/testdata/077_fetch_empty.ts.out b/cli/tests/testdata/run/077_fetch_empty.ts.out similarity index 100% rename from cli/tests/testdata/077_fetch_empty.ts.out rename to cli/tests/testdata/run/077_fetch_empty.ts.out diff --git a/cli/tests/testdata/078_unload_on_exit.ts b/cli/tests/testdata/run/078_unload_on_exit.ts similarity index 100% rename from cli/tests/testdata/078_unload_on_exit.ts rename to cli/tests/testdata/run/078_unload_on_exit.ts diff --git a/cli/tests/testdata/078_unload_on_exit.ts.out b/cli/tests/testdata/run/078_unload_on_exit.ts.out similarity index 100% rename from cli/tests/testdata/078_unload_on_exit.ts.out rename to cli/tests/testdata/run/078_unload_on_exit.ts.out diff --git a/cli/tests/testdata/079_location_authentication.ts b/cli/tests/testdata/run/079_location_authentication.ts similarity index 100% rename from cli/tests/testdata/079_location_authentication.ts rename to cli/tests/testdata/run/079_location_authentication.ts diff --git a/cli/tests/testdata/079_location_authentication.ts.out b/cli/tests/testdata/run/079_location_authentication.ts.out similarity index 100% rename from cli/tests/testdata/079_location_authentication.ts.out rename to cli/tests/testdata/run/079_location_authentication.ts.out diff --git a/cli/tests/testdata/081_location_relative_fetch_redirect.ts b/cli/tests/testdata/run/081_location_relative_fetch_redirect.ts similarity index 100% rename from cli/tests/testdata/081_location_relative_fetch_redirect.ts rename to cli/tests/testdata/run/081_location_relative_fetch_redirect.ts diff --git a/cli/tests/testdata/081_location_relative_fetch_redirect.ts.out b/cli/tests/testdata/run/081_location_relative_fetch_redirect.ts.out similarity index 100% rename from cli/tests/testdata/081_location_relative_fetch_redirect.ts.out rename to cli/tests/testdata/run/081_location_relative_fetch_redirect.ts.out diff --git a/cli/tests/testdata/082_prepare_stack_trace_throw.js b/cli/tests/testdata/run/082_prepare_stack_trace_throw.js similarity index 100% rename from cli/tests/testdata/082_prepare_stack_trace_throw.js rename to cli/tests/testdata/run/082_prepare_stack_trace_throw.js diff --git a/cli/tests/testdata/082_prepare_stack_trace_throw.js.out b/cli/tests/testdata/run/082_prepare_stack_trace_throw.js.out similarity index 100% rename from cli/tests/testdata/082_prepare_stack_trace_throw.js.out rename to cli/tests/testdata/run/082_prepare_stack_trace_throw.js.out diff --git a/cli/tests/testdata/083_legacy_external_source_map.ts b/cli/tests/testdata/run/083_legacy_external_source_map.ts similarity index 100% rename from cli/tests/testdata/083_legacy_external_source_map.ts rename to cli/tests/testdata/run/083_legacy_external_source_map.ts diff --git a/cli/tests/testdata/088_dynamic_import_already_evaluating.ts b/cli/tests/testdata/run/088_dynamic_import_already_evaluating.ts similarity index 100% rename from cli/tests/testdata/088_dynamic_import_already_evaluating.ts rename to cli/tests/testdata/run/088_dynamic_import_already_evaluating.ts diff --git a/cli/tests/testdata/088_dynamic_import_already_evaluating.ts.out b/cli/tests/testdata/run/088_dynamic_import_already_evaluating.ts.out similarity index 100% rename from cli/tests/testdata/088_dynamic_import_already_evaluating.ts.out rename to cli/tests/testdata/run/088_dynamic_import_already_evaluating.ts.out diff --git a/cli/tests/testdata/088_dynamic_import_target.ts b/cli/tests/testdata/run/088_dynamic_import_target.ts similarity index 100% rename from cli/tests/testdata/088_dynamic_import_target.ts rename to cli/tests/testdata/run/088_dynamic_import_target.ts diff --git a/cli/tests/testdata/089_run_allow_list.ts b/cli/tests/testdata/run/089_run_allow_list.ts similarity index 100% rename from cli/tests/testdata/089_run_allow_list.ts rename to cli/tests/testdata/run/089_run_allow_list.ts diff --git a/cli/tests/testdata/089_run_allow_list.ts.out b/cli/tests/testdata/run/089_run_allow_list.ts.out similarity index 100% rename from cli/tests/testdata/089_run_allow_list.ts.out rename to cli/tests/testdata/run/089_run_allow_list.ts.out diff --git a/cli/tests/testdata/090_run_permissions_request.ts b/cli/tests/testdata/run/090_run_permissions_request.ts similarity index 100% rename from cli/tests/testdata/090_run_permissions_request.ts rename to cli/tests/testdata/run/090_run_permissions_request.ts diff --git a/cli/tests/testdata/091_use_define_for_class_fields.ts b/cli/tests/testdata/run/091_use_define_for_class_fields.ts similarity index 100% rename from cli/tests/testdata/091_use_define_for_class_fields.ts rename to cli/tests/testdata/run/091_use_define_for_class_fields.ts diff --git a/cli/tests/testdata/091_use_define_for_class_fields.ts.out b/cli/tests/testdata/run/091_use_define_for_class_fields.ts.out similarity index 100% rename from cli/tests/testdata/091_use_define_for_class_fields.ts.out rename to cli/tests/testdata/run/091_use_define_for_class_fields.ts.out diff --git a/cli/tests/testdata/092_import_map_unmapped_bare_specifier.ts b/cli/tests/testdata/run/092_import_map_unmapped_bare_specifier.ts similarity index 100% rename from cli/tests/testdata/092_import_map_unmapped_bare_specifier.ts rename to cli/tests/testdata/run/092_import_map_unmapped_bare_specifier.ts diff --git a/cli/tests/testdata/092_import_map_unmapped_bare_specifier.ts.out b/cli/tests/testdata/run/092_import_map_unmapped_bare_specifier.ts.out similarity index 100% rename from cli/tests/testdata/092_import_map_unmapped_bare_specifier.ts.out rename to cli/tests/testdata/run/092_import_map_unmapped_bare_specifier.ts.out diff --git a/cli/tests/testdata/aggregate_error.out b/cli/tests/testdata/run/aggregate_error.out similarity index 100% rename from cli/tests/testdata/aggregate_error.out rename to cli/tests/testdata/run/aggregate_error.out diff --git a/cli/tests/testdata/aggregate_error.ts b/cli/tests/testdata/run/aggregate_error.ts similarity index 100% rename from cli/tests/testdata/aggregate_error.ts rename to cli/tests/testdata/run/aggregate_error.ts diff --git a/cli/tests/testdata/async_error.ts b/cli/tests/testdata/run/async_error.ts similarity index 100% rename from cli/tests/testdata/async_error.ts rename to cli/tests/testdata/run/async_error.ts diff --git a/cli/tests/testdata/async_error.ts.out b/cli/tests/testdata/run/async_error.ts.out similarity index 100% rename from cli/tests/testdata/async_error.ts.out rename to cli/tests/testdata/run/async_error.ts.out diff --git a/cli/tests/testdata/before_unload.js b/cli/tests/testdata/run/before_unload.js similarity index 100% rename from cli/tests/testdata/before_unload.js rename to cli/tests/testdata/run/before_unload.js diff --git a/cli/tests/testdata/before_unload.js.out b/cli/tests/testdata/run/before_unload.js.out similarity index 100% rename from cli/tests/testdata/before_unload.js.out rename to cli/tests/testdata/run/before_unload.js.out diff --git a/cli/tests/testdata/blob_gc_finalization.js b/cli/tests/testdata/run/blob_gc_finalization.js similarity index 100% rename from cli/tests/testdata/blob_gc_finalization.js rename to cli/tests/testdata/run/blob_gc_finalization.js diff --git a/cli/tests/testdata/blob_gc_finalization.js.out b/cli/tests/testdata/run/blob_gc_finalization.js.out similarity index 100% rename from cli/tests/testdata/blob_gc_finalization.js.out rename to cli/tests/testdata/run/blob_gc_finalization.js.out diff --git a/cli/tests/testdata/byte_order_mark.out b/cli/tests/testdata/run/byte_order_mark.out similarity index 100% rename from cli/tests/testdata/byte_order_mark.out rename to cli/tests/testdata/run/byte_order_mark.out diff --git a/cli/tests/testdata/byte_order_mark.ts b/cli/tests/testdata/run/byte_order_mark.ts similarity index 100% rename from cli/tests/testdata/byte_order_mark.ts rename to cli/tests/testdata/run/byte_order_mark.ts diff --git a/cli/tests/testdata/checkjs.tsconfig.json b/cli/tests/testdata/run/checkjs.tsconfig.json similarity index 100% rename from cli/tests/testdata/checkjs.tsconfig.json rename to cli/tests/testdata/run/checkjs.tsconfig.json diff --git a/cli/tests/testdata/commonjs.cjs b/cli/tests/testdata/run/cjs_imports/commonjs.cjs similarity index 100% rename from cli/tests/testdata/commonjs.cjs rename to cli/tests/testdata/run/cjs_imports/commonjs.cjs diff --git a/cli/tests/testdata/cjs_imports.ts.out b/cli/tests/testdata/run/cjs_imports/main.out similarity index 100% rename from cli/tests/testdata/cjs_imports.ts.out rename to cli/tests/testdata/run/cjs_imports/main.out diff --git a/cli/tests/testdata/cjs_imports.ts b/cli/tests/testdata/run/cjs_imports/main.ts similarity index 100% rename from cli/tests/testdata/cjs_imports.ts rename to cli/tests/testdata/run/cjs_imports/main.ts diff --git a/cli/tests/testdata/classic_workers_event_loop.js b/cli/tests/testdata/run/classic_workers_event_loop.js similarity index 100% rename from cli/tests/testdata/classic_workers_event_loop.js rename to cli/tests/testdata/run/classic_workers_event_loop.js diff --git a/cli/tests/testdata/classic_workers_event_loop.js.out b/cli/tests/testdata/run/classic_workers_event_loop.js.out similarity index 100% rename from cli/tests/testdata/classic_workers_event_loop.js.out rename to cli/tests/testdata/run/classic_workers_event_loop.js.out diff --git a/cli/tests/testdata/colors_without_globalThis.js b/cli/tests/testdata/run/colors_without_globalThis.js similarity index 100% rename from cli/tests/testdata/colors_without_globalThis.js rename to cli/tests/testdata/run/colors_without_globalThis.js diff --git a/cli/tests/testdata/complex_error.ts b/cli/tests/testdata/run/complex_error.ts similarity index 100% rename from cli/tests/testdata/complex_error.ts rename to cli/tests/testdata/run/complex_error.ts diff --git a/cli/tests/testdata/complex_error.ts.out b/cli/tests/testdata/run/complex_error.ts.out similarity index 100% rename from cli/tests/testdata/complex_error.ts.out rename to cli/tests/testdata/run/complex_error.ts.out diff --git a/cli/tests/testdata/complex_permissions_test.ts b/cli/tests/testdata/run/complex_permissions_test.ts similarity index 100% rename from cli/tests/testdata/complex_permissions_test.ts rename to cli/tests/testdata/run/complex_permissions_test.ts diff --git a/cli/tests/testdata/run/config/main.out b/cli/tests/testdata/run/config/main.out new file mode 100644 index 0000000000..2773148073 --- /dev/null +++ b/cli/tests/testdata/run/config/main.out @@ -0,0 +1,4 @@ +[WILDCARD]Unsupported compiler options in "[WILDCARD]tsconfig.json". + The following options were ignored: + module, target +Check [WILDCARD]/main.ts diff --git a/cli/tests/testdata/config.ts b/cli/tests/testdata/run/config/main.ts similarity index 100% rename from cli/tests/testdata/config.ts rename to cli/tests/testdata/run/config/main.ts diff --git a/cli/tests/testdata/config.tsconfig.json b/cli/tests/testdata/run/config/tsconfig.json similarity index 100% rename from cli/tests/testdata/config.tsconfig.json rename to cli/tests/testdata/run/config/tsconfig.json diff --git a/cli/tests/testdata/run/config_json_import.ts b/cli/tests/testdata/run/config_json_import.ts new file mode 100644 index 0000000000..9cf1cceaa7 --- /dev/null +++ b/cli/tests/testdata/run/config_json_import.ts @@ -0,0 +1,2 @@ +import config from "../jsx/deno-jsx.json" assert { type: "json" }; +console.log(config); diff --git a/cli/tests/testdata/config_json_import.ts.out b/cli/tests/testdata/run/config_json_import.ts.out similarity index 100% rename from cli/tests/testdata/config_json_import.ts.out rename to cli/tests/testdata/run/config_json_import.ts.out diff --git a/cli/tests/testdata/config_types.ts.out b/cli/tests/testdata/run/config_types/main.out similarity index 100% rename from cli/tests/testdata/config_types.ts.out rename to cli/tests/testdata/run/config_types/main.out diff --git a/cli/tests/testdata/config_types.ts b/cli/tests/testdata/run/config_types/main.ts similarity index 100% rename from cli/tests/testdata/config_types.ts rename to cli/tests/testdata/run/config_types/main.ts diff --git a/cli/tests/testdata/run/config_types/remote.tsconfig.json b/cli/tests/testdata/run/config_types/remote.tsconfig.json new file mode 100644 index 0000000000..255ff5def0 --- /dev/null +++ b/cli/tests/testdata/run/config_types/remote.tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "types": [ + "http://localhost:4545/run/config_types/types.d.ts" + ] + } +} diff --git a/cli/tests/testdata/config_types.tsconfig.json b/cli/tests/testdata/run/config_types/tsconfig.json similarity index 65% rename from cli/tests/testdata/config_types.tsconfig.json rename to cli/tests/testdata/run/config_types/tsconfig.json index 3810d45341..85f1549e0d 100644 --- a/cli/tests/testdata/config_types.tsconfig.json +++ b/cli/tests/testdata/run/config_types/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "types": [ - "./subdir/types.d.ts" + "./types.d.ts" ] } } diff --git a/cli/tests/testdata/subdir/types.d.ts b/cli/tests/testdata/run/config_types/types.d.ts similarity index 100% rename from cli/tests/testdata/subdir/types.d.ts rename to cli/tests/testdata/run/config_types/types.d.ts diff --git a/cli/tests/testdata/custom_inspect_url.js b/cli/tests/testdata/run/custom_inspect_url.js similarity index 100% rename from cli/tests/testdata/custom_inspect_url.js rename to cli/tests/testdata/run/custom_inspect_url.js diff --git a/cli/tests/testdata/custom_inspect_url.js.out b/cli/tests/testdata/run/custom_inspect_url.js.out similarity index 100% rename from cli/tests/testdata/custom_inspect_url.js.out rename to cli/tests/testdata/run/custom_inspect_url.js.out diff --git a/cli/tests/testdata/delete_window.js b/cli/tests/testdata/run/delete_window.js similarity index 100% rename from cli/tests/testdata/delete_window.js rename to cli/tests/testdata/run/delete_window.js diff --git a/cli/tests/testdata/deno_exit_tampering.ts b/cli/tests/testdata/run/deno_exit_tampering.ts similarity index 100% rename from cli/tests/testdata/deno_exit_tampering.ts rename to cli/tests/testdata/run/deno_exit_tampering.ts diff --git a/cli/tests/testdata/disallow_http_from_https.js b/cli/tests/testdata/run/disallow_http_from_https.js similarity index 59% rename from cli/tests/testdata/disallow_http_from_https.js rename to cli/tests/testdata/run/disallow_http_from_https.js index bff407b5ec..b8ddff1706 100644 --- a/cli/tests/testdata/disallow_http_from_https.js +++ b/cli/tests/testdata/run/disallow_http_from_https.js @@ -1,2 +1,2 @@ // Trying to import "http://", while this file is accessed by "https://" -import "http://localhost:4545/001_hello.js"; +import "http://localhost:4545/run/001_hello.js"; diff --git a/cli/tests/testdata/disallow_http_from_https.ts b/cli/tests/testdata/run/disallow_http_from_https.ts similarity index 59% rename from cli/tests/testdata/disallow_http_from_https.ts rename to cli/tests/testdata/run/disallow_http_from_https.ts index bff407b5ec..b8ddff1706 100644 --- a/cli/tests/testdata/disallow_http_from_https.ts +++ b/cli/tests/testdata/run/disallow_http_from_https.ts @@ -1,2 +1,2 @@ // Trying to import "http://", while this file is accessed by "https://" -import "http://localhost:4545/001_hello.js"; +import "http://localhost:4545/run/001_hello.js"; diff --git a/cli/tests/testdata/run/disallow_http_from_https_js.out b/cli/tests/testdata/run/disallow_http_from_https_js.out new file mode 100644 index 0000000000..5dc327975c --- /dev/null +++ b/cli/tests/testdata/run/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/run/001_hello.js + at https://localhost:5545/run/disallow_http_from_https.js:2:8 diff --git a/cli/tests/testdata/run/disallow_http_from_https_ts.out b/cli/tests/testdata/run/disallow_http_from_https_ts.out new file mode 100644 index 0000000000..e3b8f43907 --- /dev/null +++ b/cli/tests/testdata/run/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/run/001_hello.js + at https://localhost:5545/run/disallow_http_from_https.ts:2:8 diff --git a/cli/tests/testdata/dom_exception_formatting.ts b/cli/tests/testdata/run/dom_exception_formatting.ts similarity index 100% rename from cli/tests/testdata/dom_exception_formatting.ts rename to cli/tests/testdata/run/dom_exception_formatting.ts diff --git a/cli/tests/testdata/dom_exception_formatting.ts.out b/cli/tests/testdata/run/dom_exception_formatting.ts.out similarity index 100% rename from cli/tests/testdata/dom_exception_formatting.ts.out rename to cli/tests/testdata/run/dom_exception_formatting.ts.out diff --git a/cli/tests/testdata/error_001.ts b/cli/tests/testdata/run/dynamic_import_already_rejected/error_001.ts similarity index 100% rename from cli/tests/testdata/error_001.ts rename to cli/tests/testdata/run/dynamic_import_already_rejected/error_001.ts diff --git a/cli/tests/testdata/086_dynamic_import_already_rejected.ts.out b/cli/tests/testdata/run/dynamic_import_already_rejected/main.out similarity index 100% rename from cli/tests/testdata/086_dynamic_import_already_rejected.ts.out rename to cli/tests/testdata/run/dynamic_import_already_rejected/main.out diff --git a/cli/tests/testdata/086_dynamic_import_already_rejected.ts b/cli/tests/testdata/run/dynamic_import_already_rejected/main.ts similarity index 100% rename from cli/tests/testdata/086_dynamic_import_already_rejected.ts rename to cli/tests/testdata/run/dynamic_import_already_rejected/main.ts diff --git a/cli/tests/testdata/delayed_error.ts b/cli/tests/testdata/run/dynamic_import_async_error/delayed_error.ts similarity index 100% rename from cli/tests/testdata/delayed_error.ts rename to cli/tests/testdata/run/dynamic_import_async_error/delayed_error.ts diff --git a/cli/tests/testdata/085_dynamic_import_async_error.ts.out b/cli/tests/testdata/run/dynamic_import_async_error/main.out similarity index 100% rename from cli/tests/testdata/085_dynamic_import_async_error.ts.out rename to cli/tests/testdata/run/dynamic_import_async_error/main.out diff --git a/cli/tests/testdata/085_dynamic_import_async_error.ts b/cli/tests/testdata/run/dynamic_import_async_error/main.ts similarity index 100% rename from cli/tests/testdata/085_dynamic_import_async_error.ts rename to cli/tests/testdata/run/dynamic_import_async_error/main.ts diff --git a/cli/tests/testdata/dynamic_import_conditional.js b/cli/tests/testdata/run/dynamic_import_conditional.js similarity index 100% rename from cli/tests/testdata/dynamic_import_conditional.js rename to cli/tests/testdata/run/dynamic_import_conditional.js diff --git a/cli/tests/testdata/dynamic_import_conditional.js.out b/cli/tests/testdata/run/dynamic_import_conditional.js.out similarity index 100% rename from cli/tests/testdata/dynamic_import_conditional.js.out rename to cli/tests/testdata/run/dynamic_import_conditional.js.out diff --git a/cli/tests/testdata/subdir/empty.ts b/cli/tests/testdata/run/empty.ts similarity index 100% rename from cli/tests/testdata/subdir/empty.ts rename to cli/tests/testdata/run/empty.ts diff --git a/cli/tests/testdata/run/error_001.ts b/cli/tests/testdata/run/error_001.ts new file mode 100644 index 0000000000..b01068bc01 --- /dev/null +++ b/cli/tests/testdata/run/error_001.ts @@ -0,0 +1,9 @@ +function foo(): never { + throw Error("bad"); +} + +function bar() { + foo(); +} + +bar(); diff --git a/cli/tests/testdata/error_001.ts.out b/cli/tests/testdata/run/error_001.ts.out similarity index 100% rename from cli/tests/testdata/error_001.ts.out rename to cli/tests/testdata/run/error_001.ts.out diff --git a/cli/tests/testdata/run/error_002.ts b/cli/tests/testdata/run/error_002.ts new file mode 100644 index 0000000000..5f8179bbeb --- /dev/null +++ b/cli/tests/testdata/run/error_002.ts @@ -0,0 +1,7 @@ +import { throwsError } from "../subdir/mod1.ts"; + +function foo() { + throwsError(); +} + +foo(); diff --git a/cli/tests/testdata/error_002.ts.out b/cli/tests/testdata/run/error_002.ts.out similarity index 100% rename from cli/tests/testdata/error_002.ts.out rename to cli/tests/testdata/run/error_002.ts.out diff --git a/cli/tests/testdata/error_003_typescript.ts b/cli/tests/testdata/run/error_003_typescript.ts similarity index 100% rename from cli/tests/testdata/error_003_typescript.ts rename to cli/tests/testdata/run/error_003_typescript.ts diff --git a/cli/tests/testdata/error_003_typescript.ts.out b/cli/tests/testdata/run/error_003_typescript.ts.out similarity index 100% rename from cli/tests/testdata/error_003_typescript.ts.out rename to cli/tests/testdata/run/error_003_typescript.ts.out diff --git a/cli/tests/testdata/error_004_missing_module.ts b/cli/tests/testdata/run/error_004_missing_module.ts similarity index 100% rename from cli/tests/testdata/error_004_missing_module.ts rename to cli/tests/testdata/run/error_004_missing_module.ts diff --git a/cli/tests/testdata/error_004_missing_module.ts.out b/cli/tests/testdata/run/error_004_missing_module.ts.out similarity index 100% rename from cli/tests/testdata/error_004_missing_module.ts.out rename to cli/tests/testdata/run/error_004_missing_module.ts.out diff --git a/cli/tests/testdata/error_005_missing_dynamic_import.ts b/cli/tests/testdata/run/error_005_missing_dynamic_import.ts similarity index 100% rename from cli/tests/testdata/error_005_missing_dynamic_import.ts rename to cli/tests/testdata/run/error_005_missing_dynamic_import.ts diff --git a/cli/tests/testdata/error_005_missing_dynamic_import.ts.out b/cli/tests/testdata/run/error_005_missing_dynamic_import.ts.out similarity index 100% rename from cli/tests/testdata/error_005_missing_dynamic_import.ts.out rename to cli/tests/testdata/run/error_005_missing_dynamic_import.ts.out diff --git a/cli/tests/testdata/error_006_import_ext_failure.ts b/cli/tests/testdata/run/error_006_import_ext_failure.ts similarity index 100% rename from cli/tests/testdata/error_006_import_ext_failure.ts rename to cli/tests/testdata/run/error_006_import_ext_failure.ts diff --git a/cli/tests/testdata/error_006_import_ext_failure.ts.out b/cli/tests/testdata/run/error_006_import_ext_failure.ts.out similarity index 100% rename from cli/tests/testdata/error_006_import_ext_failure.ts.out rename to cli/tests/testdata/run/error_006_import_ext_failure.ts.out diff --git a/cli/tests/testdata/error_007_any.ts b/cli/tests/testdata/run/error_007_any.ts similarity index 100% rename from cli/tests/testdata/error_007_any.ts rename to cli/tests/testdata/run/error_007_any.ts diff --git a/cli/tests/testdata/error_007_any.ts.out b/cli/tests/testdata/run/error_007_any.ts.out similarity index 100% rename from cli/tests/testdata/error_007_any.ts.out rename to cli/tests/testdata/run/error_007_any.ts.out diff --git a/cli/tests/testdata/error_008_checkjs.js b/cli/tests/testdata/run/error_008_checkjs.js similarity index 100% rename from cli/tests/testdata/error_008_checkjs.js rename to cli/tests/testdata/run/error_008_checkjs.js diff --git a/cli/tests/testdata/error_008_checkjs.js.out b/cli/tests/testdata/run/error_008_checkjs.js.out similarity index 100% rename from cli/tests/testdata/error_008_checkjs.js.out rename to cli/tests/testdata/run/error_008_checkjs.js.out diff --git a/cli/tests/testdata/error_009_extensions_error.js b/cli/tests/testdata/run/error_009_extensions_error.js similarity index 100% rename from cli/tests/testdata/error_009_extensions_error.js rename to cli/tests/testdata/run/error_009_extensions_error.js diff --git a/cli/tests/testdata/error_009_extensions_error.js.out b/cli/tests/testdata/run/error_009_extensions_error.js.out similarity index 100% rename from cli/tests/testdata/error_009_extensions_error.js.out rename to cli/tests/testdata/run/error_009_extensions_error.js.out diff --git a/cli/tests/testdata/error_009_missing_js_module.disabled b/cli/tests/testdata/run/error_009_missing_js_module.disabled similarity index 100% rename from cli/tests/testdata/error_009_missing_js_module.disabled rename to cli/tests/testdata/run/error_009_missing_js_module.disabled diff --git a/cli/tests/testdata/error_011_bad_module_specifier.ts b/cli/tests/testdata/run/error_011_bad_module_specifier.ts similarity index 100% rename from cli/tests/testdata/error_011_bad_module_specifier.ts rename to cli/tests/testdata/run/error_011_bad_module_specifier.ts diff --git a/cli/tests/testdata/error_011_bad_module_specifier.ts.out b/cli/tests/testdata/run/error_011_bad_module_specifier.ts.out similarity index 100% rename from cli/tests/testdata/error_011_bad_module_specifier.ts.out rename to cli/tests/testdata/run/error_011_bad_module_specifier.ts.out diff --git a/cli/tests/testdata/error_012_bad_dynamic_import_specifier.ts b/cli/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts similarity index 100% rename from cli/tests/testdata/error_012_bad_dynamic_import_specifier.ts rename to cli/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts diff --git a/cli/tests/testdata/error_012_bad_dynamic_import_specifier.ts.out b/cli/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts.out similarity index 100% rename from cli/tests/testdata/error_012_bad_dynamic_import_specifier.ts.out rename to cli/tests/testdata/run/error_012_bad_dynamic_import_specifier.ts.out diff --git a/cli/tests/testdata/error_013_missing_script.out b/cli/tests/testdata/run/error_013_missing_script.out similarity index 100% rename from cli/tests/testdata/error_013_missing_script.out rename to cli/tests/testdata/run/error_013_missing_script.out diff --git a/cli/tests/testdata/error_014_catch_dynamic_import_error.js b/cli/tests/testdata/run/error_014_catch_dynamic_import_error.js similarity index 79% rename from cli/tests/testdata/error_014_catch_dynamic_import_error.js rename to cli/tests/testdata/run/error_014_catch_dynamic_import_error.js index 483be7b1a9..c58e54dcbb 100644 --- a/cli/tests/testdata/error_014_catch_dynamic_import_error.js +++ b/cli/tests/testdata/run/error_014_catch_dynamic_import_error.js @@ -7,21 +7,21 @@ } try { - await import("./subdir/indirect_import_error.js"); + await import("../subdir/indirect_import_error.js"); } catch (err) { console.log("Caught indirect direct dynamic import error."); console.log(err); } try { - await import("./subdir/throws.js"); + await import("../subdir/throws.js"); } catch (err) { console.log("Caught error thrown by dynamically imported module."); console.log(err); } try { - await import("./subdir/indirect_throws.js"); + await import("../subdir/indirect_throws.js"); } catch (err) { console.log( "Caught error thrown indirectly by dynamically imported module.", diff --git a/cli/tests/testdata/error_014_catch_dynamic_import_error.js.out b/cli/tests/testdata/run/error_014_catch_dynamic_import_error.js.out similarity index 100% rename from cli/tests/testdata/error_014_catch_dynamic_import_error.js.out rename to cli/tests/testdata/run/error_014_catch_dynamic_import_error.js.out diff --git a/cli/tests/testdata/error_015_dynamic_import_permissions.js b/cli/tests/testdata/run/error_015_dynamic_import_permissions.js similarity index 100% rename from cli/tests/testdata/error_015_dynamic_import_permissions.js rename to cli/tests/testdata/run/error_015_dynamic_import_permissions.js diff --git a/cli/tests/testdata/error_015_dynamic_import_permissions.out b/cli/tests/testdata/run/error_015_dynamic_import_permissions.out similarity index 100% rename from cli/tests/testdata/error_015_dynamic_import_permissions.out rename to cli/tests/testdata/run/error_015_dynamic_import_permissions.out diff --git a/cli/tests/testdata/error_016_dynamic_import_permissions2.js b/cli/tests/testdata/run/error_016_dynamic_import_permissions2.js similarity index 100% rename from cli/tests/testdata/error_016_dynamic_import_permissions2.js rename to cli/tests/testdata/run/error_016_dynamic_import_permissions2.js diff --git a/cli/tests/testdata/error_016_dynamic_import_permissions2.out b/cli/tests/testdata/run/error_016_dynamic_import_permissions2.out similarity index 100% rename from cli/tests/testdata/error_016_dynamic_import_permissions2.out rename to cli/tests/testdata/run/error_016_dynamic_import_permissions2.out diff --git a/cli/tests/testdata/error_017_hide_long_source_ts.ts b/cli/tests/testdata/run/error_017_hide_long_source_ts.ts similarity index 100% rename from cli/tests/testdata/error_017_hide_long_source_ts.ts rename to cli/tests/testdata/run/error_017_hide_long_source_ts.ts diff --git a/cli/tests/testdata/error_017_hide_long_source_ts.ts.out b/cli/tests/testdata/run/error_017_hide_long_source_ts.ts.out similarity index 100% rename from cli/tests/testdata/error_017_hide_long_source_ts.ts.out rename to cli/tests/testdata/run/error_017_hide_long_source_ts.ts.out diff --git a/cli/tests/testdata/error_018_hide_long_source_js.js b/cli/tests/testdata/run/error_018_hide_long_source_js.js similarity index 100% rename from cli/tests/testdata/error_018_hide_long_source_js.js rename to cli/tests/testdata/run/error_018_hide_long_source_js.js diff --git a/cli/tests/testdata/error_018_hide_long_source_js.js.out b/cli/tests/testdata/run/error_018_hide_long_source_js.js.out similarity index 100% rename from cli/tests/testdata/error_018_hide_long_source_js.js.out rename to cli/tests/testdata/run/error_018_hide_long_source_js.js.out diff --git a/cli/tests/testdata/error_019_stack_function.ts b/cli/tests/testdata/run/error_019_stack_function.ts similarity index 100% rename from cli/tests/testdata/error_019_stack_function.ts rename to cli/tests/testdata/run/error_019_stack_function.ts diff --git a/cli/tests/testdata/error_019_stack_function.ts.out b/cli/tests/testdata/run/error_019_stack_function.ts.out similarity index 100% rename from cli/tests/testdata/error_019_stack_function.ts.out rename to cli/tests/testdata/run/error_019_stack_function.ts.out diff --git a/cli/tests/testdata/error_020_stack_constructor.ts b/cli/tests/testdata/run/error_020_stack_constructor.ts similarity index 100% rename from cli/tests/testdata/error_020_stack_constructor.ts rename to cli/tests/testdata/run/error_020_stack_constructor.ts diff --git a/cli/tests/testdata/error_020_stack_constructor.ts.out b/cli/tests/testdata/run/error_020_stack_constructor.ts.out similarity index 100% rename from cli/tests/testdata/error_020_stack_constructor.ts.out rename to cli/tests/testdata/run/error_020_stack_constructor.ts.out diff --git a/cli/tests/testdata/error_021_stack_method.ts b/cli/tests/testdata/run/error_021_stack_method.ts similarity index 100% rename from cli/tests/testdata/error_021_stack_method.ts rename to cli/tests/testdata/run/error_021_stack_method.ts diff --git a/cli/tests/testdata/error_021_stack_method.ts.out b/cli/tests/testdata/run/error_021_stack_method.ts.out similarity index 100% rename from cli/tests/testdata/error_021_stack_method.ts.out rename to cli/tests/testdata/run/error_021_stack_method.ts.out diff --git a/cli/tests/testdata/error_022_stack_custom_error.ts b/cli/tests/testdata/run/error_022_stack_custom_error.ts similarity index 100% rename from cli/tests/testdata/error_022_stack_custom_error.ts rename to cli/tests/testdata/run/error_022_stack_custom_error.ts diff --git a/cli/tests/testdata/error_022_stack_custom_error.ts.out b/cli/tests/testdata/run/error_022_stack_custom_error.ts.out similarity index 100% rename from cli/tests/testdata/error_022_stack_custom_error.ts.out rename to cli/tests/testdata/run/error_022_stack_custom_error.ts.out diff --git a/cli/tests/testdata/error_023_stack_async.ts b/cli/tests/testdata/run/error_023_stack_async.ts similarity index 100% rename from cli/tests/testdata/error_023_stack_async.ts rename to cli/tests/testdata/run/error_023_stack_async.ts diff --git a/cli/tests/testdata/error_023_stack_async.ts.out b/cli/tests/testdata/run/error_023_stack_async.ts.out similarity index 100% rename from cli/tests/testdata/error_023_stack_async.ts.out rename to cli/tests/testdata/run/error_023_stack_async.ts.out diff --git a/cli/tests/testdata/error_024_stack_promise_all.ts b/cli/tests/testdata/run/error_024_stack_promise_all.ts similarity index 100% rename from cli/tests/testdata/error_024_stack_promise_all.ts rename to cli/tests/testdata/run/error_024_stack_promise_all.ts diff --git a/cli/tests/testdata/error_024_stack_promise_all.ts.out b/cli/tests/testdata/run/error_024_stack_promise_all.ts.out similarity index 100% rename from cli/tests/testdata/error_024_stack_promise_all.ts.out rename to cli/tests/testdata/run/error_024_stack_promise_all.ts.out diff --git a/cli/tests/testdata/error_025_tab_indent b/cli/tests/testdata/run/error_025_tab_indent similarity index 100% rename from cli/tests/testdata/error_025_tab_indent rename to cli/tests/testdata/run/error_025_tab_indent diff --git a/cli/tests/testdata/error_025_tab_indent.out b/cli/tests/testdata/run/error_025_tab_indent.out similarity index 100% rename from cli/tests/testdata/error_025_tab_indent.out rename to cli/tests/testdata/run/error_025_tab_indent.out diff --git a/cli/tests/testdata/run/error_026_remote_import_error.ts b/cli/tests/testdata/run/error_026_remote_import_error.ts new file mode 100644 index 0000000000..1b230d06bb --- /dev/null +++ b/cli/tests/testdata/run/error_026_remote_import_error.ts @@ -0,0 +1 @@ +import "http://localhost:4545/run/error_001.ts"; diff --git a/cli/tests/testdata/run/error_026_remote_import_error.ts.out b/cli/tests/testdata/run/error_026_remote_import_error.ts.out new file mode 100644 index 0000000000..84f926f245 --- /dev/null +++ b/cli/tests/testdata/run/error_026_remote_import_error.ts.out @@ -0,0 +1,7 @@ +[WILDCARD]error: Uncaught Error: bad + throw Error("bad"); + ^ + at foo (http://localhost:4545/run/error_001.ts:2:9) + at bar (http://localhost:4545/run/error_001.ts:6:3) + at http://localhost:4545/run/error_001.ts:9:1 +[WILDCARD] diff --git a/cli/tests/testdata/error_cause.ts b/cli/tests/testdata/run/error_cause.ts similarity index 100% rename from cli/tests/testdata/error_cause.ts rename to cli/tests/testdata/run/error_cause.ts diff --git a/cli/tests/testdata/error_cause.ts.out b/cli/tests/testdata/run/error_cause.ts.out similarity index 100% rename from cli/tests/testdata/error_cause.ts.out rename to cli/tests/testdata/run/error_cause.ts.out diff --git a/cli/tests/testdata/error_cause_recursive.ts b/cli/tests/testdata/run/error_cause_recursive.ts similarity index 100% rename from cli/tests/testdata/error_cause_recursive.ts rename to cli/tests/testdata/run/error_cause_recursive.ts diff --git a/cli/tests/testdata/error_cause_recursive.ts.out b/cli/tests/testdata/run/error_cause_recursive.ts.out similarity index 100% rename from cli/tests/testdata/error_cause_recursive.ts.out rename to cli/tests/testdata/run/error_cause_recursive.ts.out diff --git a/cli/tests/testdata/error_for_await.ts b/cli/tests/testdata/run/error_for_await.ts similarity index 100% rename from cli/tests/testdata/error_for_await.ts rename to cli/tests/testdata/run/error_for_await.ts diff --git a/cli/tests/testdata/error_for_await.ts.out b/cli/tests/testdata/run/error_for_await.ts.out similarity index 100% rename from cli/tests/testdata/error_for_await.ts.out rename to cli/tests/testdata/run/error_for_await.ts.out diff --git a/cli/tests/testdata/error_import_map_unable_to_load.out b/cli/tests/testdata/run/error_import_map_unable_to_load.out similarity index 100% rename from cli/tests/testdata/error_import_map_unable_to_load.out rename to cli/tests/testdata/run/error_import_map_unable_to_load.out diff --git a/cli/tests/testdata/error_local_static_import_from_remote.js b/cli/tests/testdata/run/error_local_static_import_from_remote.js similarity index 100% rename from cli/tests/testdata/error_local_static_import_from_remote.js rename to cli/tests/testdata/run/error_local_static_import_from_remote.js diff --git a/cli/tests/testdata/error_local_static_import_from_remote.js.out b/cli/tests/testdata/run/error_local_static_import_from_remote.js.out similarity index 66% rename from cli/tests/testdata/error_local_static_import_from_remote.js.out rename to cli/tests/testdata/run/error_local_static_import_from_remote.js.out index 1ea10bd88e..34f9e81e14 100644 --- a/cli/tests/testdata/error_local_static_import_from_remote.js.out +++ b/cli/tests/testdata/run/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/error_local_static_import_from_remote.js:1:8 + at http://localhost:4545/run/error_local_static_import_from_remote.js:1:8 diff --git a/cli/tests/testdata/error_local_static_import_from_remote.ts b/cli/tests/testdata/run/error_local_static_import_from_remote.ts similarity index 100% rename from cli/tests/testdata/error_local_static_import_from_remote.ts rename to cli/tests/testdata/run/error_local_static_import_from_remote.ts diff --git a/cli/tests/testdata/error_local_static_import_from_remote.ts.out b/cli/tests/testdata/run/error_local_static_import_from_remote.ts.out similarity index 66% rename from cli/tests/testdata/error_local_static_import_from_remote.ts.out rename to cli/tests/testdata/run/error_local_static_import_from_remote.ts.out index 7308c6f9d1..88990a049e 100644 --- a/cli/tests/testdata/error_local_static_import_from_remote.ts.out +++ b/cli/tests/testdata/run/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/error_local_static_import_from_remote.ts:1:8 + at http://localhost:4545/run/error_local_static_import_from_remote.ts:1:8 diff --git a/cli/tests/testdata/error_missing_module_named_import.ts b/cli/tests/testdata/run/error_missing_module_named_import.ts similarity index 100% rename from cli/tests/testdata/error_missing_module_named_import.ts rename to cli/tests/testdata/run/error_missing_module_named_import.ts diff --git a/cli/tests/testdata/error_missing_module_named_import.ts.out b/cli/tests/testdata/run/error_missing_module_named_import.ts.out similarity index 100% rename from cli/tests/testdata/error_missing_module_named_import.ts.out rename to cli/tests/testdata/run/error_missing_module_named_import.ts.out diff --git a/cli/tests/testdata/error_name_non_string.js b/cli/tests/testdata/run/error_name_non_string.js similarity index 100% rename from cli/tests/testdata/error_name_non_string.js rename to cli/tests/testdata/run/error_name_non_string.js diff --git a/cli/tests/testdata/error_name_non_string.js.out b/cli/tests/testdata/run/error_name_non_string.js.out similarity index 100% rename from cli/tests/testdata/error_name_non_string.js.out rename to cli/tests/testdata/run/error_name_non_string.js.out diff --git a/cli/tests/testdata/run/error_no_check.ts b/cli/tests/testdata/run/error_no_check.ts new file mode 100644 index 0000000000..2da01e639a --- /dev/null +++ b/cli/tests/testdata/run/error_no_check.ts @@ -0,0 +1 @@ +export { AnInterface, isAnInterface } from "../subdir/type_and_code.ts"; diff --git a/cli/tests/testdata/run/error_no_check.ts.out b/cli/tests/testdata/run/error_no_check.ts.out new file mode 100644 index 0000000000..78f478045d --- /dev/null +++ b/cli/tests/testdata/run/error_no_check.ts.out @@ -0,0 +1,2 @@ +error: Uncaught SyntaxError: The requested module '../subdir/type_and_code.ts' does not provide an export named 'AnInterface' +[WILDCARD] \ No newline at end of file diff --git a/cli/tests/testdata/error_syntax.js b/cli/tests/testdata/run/error_syntax.js similarity index 100% rename from cli/tests/testdata/error_syntax.js rename to cli/tests/testdata/run/error_syntax.js diff --git a/cli/tests/testdata/error_syntax.js.out b/cli/tests/testdata/run/error_syntax.js.out similarity index 100% rename from cli/tests/testdata/error_syntax.js.out rename to cli/tests/testdata/run/error_syntax.js.out diff --git a/cli/tests/testdata/error_syntax_empty_trailing_line.mjs b/cli/tests/testdata/run/error_syntax_empty_trailing_line.mjs similarity index 100% rename from cli/tests/testdata/error_syntax_empty_trailing_line.mjs rename to cli/tests/testdata/run/error_syntax_empty_trailing_line.mjs diff --git a/cli/tests/testdata/error_syntax_empty_trailing_line.mjs.out b/cli/tests/testdata/run/error_syntax_empty_trailing_line.mjs.out similarity index 100% rename from cli/tests/testdata/error_syntax_empty_trailing_line.mjs.out rename to cli/tests/testdata/run/error_syntax_empty_trailing_line.mjs.out diff --git a/cli/tests/testdata/run/error_type_definitions.ts b/cli/tests/testdata/run/error_type_definitions.ts new file mode 100644 index 0000000000..86675cbaae --- /dev/null +++ b/cli/tests/testdata/run/error_type_definitions.ts @@ -0,0 +1,5 @@ +// @deno-types="../type_definitions/bar.d.ts" +import { Bar } from "../type_definitions/bar.js"; + +const bar = new Bar(); +console.log(bar); diff --git a/cli/tests/testdata/error_type_definitions.ts.out b/cli/tests/testdata/run/error_type_definitions.ts.out similarity index 100% rename from cli/tests/testdata/error_type_definitions.ts.out rename to cli/tests/testdata/run/error_type_definitions.ts.out diff --git a/cli/tests/testdata/es_private_fields.js b/cli/tests/testdata/run/es_private_fields.js similarity index 100% rename from cli/tests/testdata/es_private_fields.js rename to cli/tests/testdata/run/es_private_fields.js diff --git a/cli/tests/testdata/es_private_fields.js.out b/cli/tests/testdata/run/es_private_fields.js.out similarity index 100% rename from cli/tests/testdata/es_private_fields.js.out rename to cli/tests/testdata/run/es_private_fields.js.out diff --git a/cli/tests/testdata/eval_context_throw_dom_exception.js b/cli/tests/testdata/run/eval_context_throw_dom_exception.js similarity index 100% rename from cli/tests/testdata/eval_context_throw_dom_exception.js rename to cli/tests/testdata/run/eval_context_throw_dom_exception.js diff --git a/cli/tests/testdata/eval_context_throw_dom_exception.js.out b/cli/tests/testdata/run/eval_context_throw_dom_exception.js.out similarity index 100% rename from cli/tests/testdata/eval_context_throw_dom_exception.js.out rename to cli/tests/testdata/run/eval_context_throw_dom_exception.js.out diff --git a/cli/tests/testdata/event_listener_error.ts b/cli/tests/testdata/run/event_listener_error.ts similarity index 100% rename from cli/tests/testdata/event_listener_error.ts rename to cli/tests/testdata/run/event_listener_error.ts diff --git a/cli/tests/testdata/event_listener_error.ts.out b/cli/tests/testdata/run/event_listener_error.ts.out similarity index 100% rename from cli/tests/testdata/event_listener_error.ts.out rename to cli/tests/testdata/run/event_listener_error.ts.out diff --git a/cli/tests/testdata/event_listener_error_handled.ts b/cli/tests/testdata/run/event_listener_error_handled.ts similarity index 100% rename from cli/tests/testdata/event_listener_error_handled.ts rename to cli/tests/testdata/run/event_listener_error_handled.ts diff --git a/cli/tests/testdata/event_listener_error_handled.ts.out b/cli/tests/testdata/run/event_listener_error_handled.ts.out similarity index 100% rename from cli/tests/testdata/event_listener_error_handled.ts.out rename to cli/tests/testdata/run/event_listener_error_handled.ts.out diff --git a/cli/tests/testdata/event_listener_error_immediate_exit.ts b/cli/tests/testdata/run/event_listener_error_immediate_exit.ts similarity index 100% rename from cli/tests/testdata/event_listener_error_immediate_exit.ts rename to cli/tests/testdata/run/event_listener_error_immediate_exit.ts diff --git a/cli/tests/testdata/event_listener_error_immediate_exit.ts.out b/cli/tests/testdata/run/event_listener_error_immediate_exit.ts.out similarity index 100% rename from cli/tests/testdata/event_listener_error_immediate_exit.ts.out rename to cli/tests/testdata/run/event_listener_error_immediate_exit.ts.out diff --git a/cli/tests/testdata/event_listener_error_immediate_exit_worker.ts b/cli/tests/testdata/run/event_listener_error_immediate_exit_worker.ts similarity index 100% rename from cli/tests/testdata/event_listener_error_immediate_exit_worker.ts rename to cli/tests/testdata/run/event_listener_error_immediate_exit_worker.ts diff --git a/cli/tests/testdata/event_listener_error_immediate_exit_worker.ts.out b/cli/tests/testdata/run/event_listener_error_immediate_exit_worker.ts.out similarity index 100% rename from cli/tests/testdata/event_listener_error_immediate_exit_worker.ts.out rename to cli/tests/testdata/run/event_listener_error_immediate_exit_worker.ts.out diff --git a/cli/tests/testdata/exec_path.ts b/cli/tests/testdata/run/exec_path.ts similarity index 100% rename from cli/tests/testdata/exec_path.ts rename to cli/tests/testdata/run/exec_path.ts diff --git a/cli/tests/testdata/exit_error42.ts b/cli/tests/testdata/run/exit_error42.ts similarity index 100% rename from cli/tests/testdata/exit_error42.ts rename to cli/tests/testdata/run/exit_error42.ts diff --git a/cli/tests/testdata/exit_error42.ts.out b/cli/tests/testdata/run/exit_error42.ts.out similarity index 100% rename from cli/tests/testdata/exit_error42.ts.out rename to cli/tests/testdata/run/exit_error42.ts.out diff --git a/cli/tests/testdata/run/export_type_def.ts b/cli/tests/testdata/run/export_type_def.ts new file mode 100644 index 0000000000..9a1e2b0fea --- /dev/null +++ b/cli/tests/testdata/run/export_type_def.ts @@ -0,0 +1,2 @@ +// @deno-types="../type_definitions/foo.d.ts" +export { foo } from "../type_definitions/foo.js"; diff --git a/cli/tests/testdata/fetch/hello.txt b/cli/tests/testdata/run/fetch/hello.txt similarity index 100% rename from cli/tests/testdata/fetch/hello.txt rename to cli/tests/testdata/run/fetch/hello.txt diff --git a/cli/tests/testdata/fetch/other.ts b/cli/tests/testdata/run/fetch/other.ts similarity index 100% rename from cli/tests/testdata/fetch/other.ts rename to cli/tests/testdata/run/fetch/other.ts diff --git a/cli/tests/testdata/fetch/test.ts b/cli/tests/testdata/run/fetch/test.ts similarity index 100% rename from cli/tests/testdata/fetch/test.ts rename to cli/tests/testdata/run/fetch/test.ts diff --git a/cli/tests/testdata/fetch_async_error_stack.ts b/cli/tests/testdata/run/fetch_async_error_stack.ts similarity index 100% rename from cli/tests/testdata/fetch_async_error_stack.ts rename to cli/tests/testdata/run/fetch_async_error_stack.ts diff --git a/cli/tests/testdata/fetch_async_error_stack.ts.out b/cli/tests/testdata/run/fetch_async_error_stack.ts.out similarity index 100% rename from cli/tests/testdata/fetch_async_error_stack.ts.out rename to cli/tests/testdata/run/fetch_async_error_stack.ts.out diff --git a/cli/tests/testdata/fetch_response_finalization.js b/cli/tests/testdata/run/fetch_response_finalization.js similarity index 100% rename from cli/tests/testdata/fetch_response_finalization.js rename to cli/tests/testdata/run/fetch_response_finalization.js diff --git a/cli/tests/testdata/fetch_response_finalization.js.out b/cli/tests/testdata/run/fetch_response_finalization.js.out similarity index 100% rename from cli/tests/testdata/fetch_response_finalization.js.out rename to cli/tests/testdata/run/fetch_response_finalization.js.out diff --git a/cli/tests/testdata/unstable_ffi_1.js b/cli/tests/testdata/run/ffi/unstable_ffi_1.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_1.js rename to cli/tests/testdata/run/ffi/unstable_ffi_1.js diff --git a/cli/tests/testdata/unstable_ffi_1.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_1.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_1.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_1.js.out diff --git a/cli/tests/testdata/unstable_ffi_10.js b/cli/tests/testdata/run/ffi/unstable_ffi_10.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_10.js rename to cli/tests/testdata/run/ffi/unstable_ffi_10.js diff --git a/cli/tests/testdata/unstable_ffi_10.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_10.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_10.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_10.js.out diff --git a/cli/tests/testdata/unstable_ffi_11.js b/cli/tests/testdata/run/ffi/unstable_ffi_11.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_11.js rename to cli/tests/testdata/run/ffi/unstable_ffi_11.js diff --git a/cli/tests/testdata/unstable_ffi_11.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_11.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_11.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_11.js.out diff --git a/cli/tests/testdata/unstable_ffi_12.js b/cli/tests/testdata/run/ffi/unstable_ffi_12.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_12.js rename to cli/tests/testdata/run/ffi/unstable_ffi_12.js diff --git a/cli/tests/testdata/unstable_ffi_12.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_12.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_12.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_12.js.out diff --git a/cli/tests/testdata/unstable_ffi_13.js b/cli/tests/testdata/run/ffi/unstable_ffi_13.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_13.js rename to cli/tests/testdata/run/ffi/unstable_ffi_13.js diff --git a/cli/tests/testdata/unstable_ffi_13.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_13.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_13.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_13.js.out diff --git a/cli/tests/testdata/unstable_ffi_14.js b/cli/tests/testdata/run/ffi/unstable_ffi_14.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_14.js rename to cli/tests/testdata/run/ffi/unstable_ffi_14.js diff --git a/cli/tests/testdata/unstable_ffi_14.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_14.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_14.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_14.js.out diff --git a/cli/tests/testdata/unstable_ffi_15.js b/cli/tests/testdata/run/ffi/unstable_ffi_15.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_15.js rename to cli/tests/testdata/run/ffi/unstable_ffi_15.js diff --git a/cli/tests/testdata/unstable_ffi_15.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_15.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_15.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_15.js.out diff --git a/cli/tests/testdata/unstable_ffi_2.js b/cli/tests/testdata/run/ffi/unstable_ffi_2.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_2.js rename to cli/tests/testdata/run/ffi/unstable_ffi_2.js diff --git a/cli/tests/testdata/unstable_ffi_2.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_2.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_2.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_2.js.out diff --git a/cli/tests/testdata/unstable_ffi_3.js b/cli/tests/testdata/run/ffi/unstable_ffi_3.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_3.js rename to cli/tests/testdata/run/ffi/unstable_ffi_3.js diff --git a/cli/tests/testdata/unstable_ffi_3.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_3.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_3.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_3.js.out diff --git a/cli/tests/testdata/unstable_ffi_4.js b/cli/tests/testdata/run/ffi/unstable_ffi_4.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_4.js rename to cli/tests/testdata/run/ffi/unstable_ffi_4.js diff --git a/cli/tests/testdata/unstable_ffi_4.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_4.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_4.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_4.js.out diff --git a/cli/tests/testdata/unstable_ffi_5.js b/cli/tests/testdata/run/ffi/unstable_ffi_5.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_5.js rename to cli/tests/testdata/run/ffi/unstable_ffi_5.js diff --git a/cli/tests/testdata/unstable_ffi_5.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_5.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_5.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_5.js.out diff --git a/cli/tests/testdata/unstable_ffi_6.js b/cli/tests/testdata/run/ffi/unstable_ffi_6.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_6.js rename to cli/tests/testdata/run/ffi/unstable_ffi_6.js diff --git a/cli/tests/testdata/unstable_ffi_6.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_6.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_6.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_6.js.out diff --git a/cli/tests/testdata/unstable_ffi_7.js b/cli/tests/testdata/run/ffi/unstable_ffi_7.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_7.js rename to cli/tests/testdata/run/ffi/unstable_ffi_7.js diff --git a/cli/tests/testdata/unstable_ffi_7.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_7.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_7.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_7.js.out diff --git a/cli/tests/testdata/unstable_ffi_8.js b/cli/tests/testdata/run/ffi/unstable_ffi_8.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_8.js rename to cli/tests/testdata/run/ffi/unstable_ffi_8.js diff --git a/cli/tests/testdata/unstable_ffi_8.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_8.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_8.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_8.js.out diff --git a/cli/tests/testdata/unstable_ffi_9.js b/cli/tests/testdata/run/ffi/unstable_ffi_9.js similarity index 100% rename from cli/tests/testdata/unstable_ffi_9.js rename to cli/tests/testdata/run/ffi/unstable_ffi_9.js diff --git a/cli/tests/testdata/unstable_ffi_9.js.out b/cli/tests/testdata/run/ffi/unstable_ffi_9.js.out similarity index 100% rename from cli/tests/testdata/unstable_ffi_9.js.out rename to cli/tests/testdata/run/ffi/unstable_ffi_9.js.out diff --git a/cli/tests/testdata/finalization_registry.js b/cli/tests/testdata/run/finalization_registry.js similarity index 100% rename from cli/tests/testdata/finalization_registry.js rename to cli/tests/testdata/run/finalization_registry.js diff --git a/cli/tests/testdata/finalization_registry.js.out b/cli/tests/testdata/run/finalization_registry.js.out similarity index 100% rename from cli/tests/testdata/finalization_registry.js.out rename to cli/tests/testdata/run/finalization_registry.js.out diff --git a/cli/tests/testdata/fix_dynamic_import_errors.js b/cli/tests/testdata/run/fix_dynamic_import_errors.js similarity index 52% rename from cli/tests/testdata/fix_dynamic_import_errors.js rename to cli/tests/testdata/run/fix_dynamic_import_errors.js index 317047ccb5..1d7be37e06 100644 --- a/cli/tests/testdata/fix_dynamic_import_errors.js +++ b/cli/tests/testdata/run/fix_dynamic_import_errors.js @@ -1,7 +1,7 @@ -import("./dynamic_import/b.js").catch(() => { +import("../dynamic_import/b.js").catch(() => { console.log("caught import error from b.js"); }); -import("./dynamic_import/c.js").catch(() => { +import("../dynamic_import/c.js").catch(() => { console.log("caught import error from c.js"); }); diff --git a/cli/tests/testdata/fix_dynamic_import_errors.js.out b/cli/tests/testdata/run/fix_dynamic_import_errors.js.out similarity index 100% rename from cli/tests/testdata/fix_dynamic_import_errors.js.out rename to cli/tests/testdata/run/fix_dynamic_import_errors.js.out diff --git a/cli/tests/testdata/run/fix_emittable_skipped.js b/cli/tests/testdata/run/fix_emittable_skipped.js new file mode 100644 index 0000000000..a4ccc9efda --- /dev/null +++ b/cli/tests/testdata/run/fix_emittable_skipped.js @@ -0,0 +1,7 @@ +/// + +import "../subdir/polyfill.ts"; + +export const a = "a"; + +console.log(globalThis.polyfill); diff --git a/cli/tests/testdata/fix_emittable_skipped.ts.out b/cli/tests/testdata/run/fix_emittable_skipped.ts.out similarity index 100% rename from cli/tests/testdata/fix_emittable_skipped.ts.out rename to cli/tests/testdata/run/fix_emittable_skipped.ts.out diff --git a/cli/tests/testdata/fix_exotic_specifiers.ts b/cli/tests/testdata/run/fix_exotic_specifiers.ts similarity index 100% rename from cli/tests/testdata/fix_exotic_specifiers.ts rename to cli/tests/testdata/run/fix_exotic_specifiers.ts diff --git a/cli/tests/testdata/fix_exotic_specifiers.ts.out b/cli/tests/testdata/run/fix_exotic_specifiers.ts.out similarity index 100% rename from cli/tests/testdata/fix_exotic_specifiers.ts.out rename to cli/tests/testdata/run/fix_exotic_specifiers.ts.out diff --git a/cli/tests/testdata/run/fix_js_import_js.ts b/cli/tests/testdata/run/fix_js_import_js.ts new file mode 100644 index 0000000000..0f01877cd8 --- /dev/null +++ b/cli/tests/testdata/run/fix_js_import_js.ts @@ -0,0 +1,3 @@ +import { isMod4 } from "../subdir/mod6.js"; + +console.log(isMod4); diff --git a/cli/tests/testdata/fix_js_import_js.ts.out b/cli/tests/testdata/run/fix_js_import_js.ts.out similarity index 100% rename from cli/tests/testdata/fix_js_import_js.ts.out rename to cli/tests/testdata/run/fix_js_import_js.ts.out diff --git a/cli/tests/testdata/run/fix_js_imports.ts b/cli/tests/testdata/run/fix_js_imports.ts new file mode 100644 index 0000000000..6ed13bae30 --- /dev/null +++ b/cli/tests/testdata/run/fix_js_imports.ts @@ -0,0 +1,3 @@ +import * as amdLike from "../subdir/amd_like.js"; + +console.log(amdLike); diff --git a/cli/tests/testdata/fix_js_imports.ts.out b/cli/tests/testdata/run/fix_js_imports.ts.out similarity index 100% rename from cli/tests/testdata/fix_js_imports.ts.out rename to cli/tests/testdata/run/fix_js_imports.ts.out diff --git a/cli/tests/testdata/fix_tsc_file_exists.out b/cli/tests/testdata/run/fix_tsc_file_exists.out similarity index 100% rename from cli/tests/testdata/fix_tsc_file_exists.out rename to cli/tests/testdata/run/fix_tsc_file_exists.out diff --git a/cli/tests/testdata/fix_worker_dispatchevent.ts b/cli/tests/testdata/run/fix_worker_dispatchevent.ts similarity index 100% rename from cli/tests/testdata/fix_worker_dispatchevent.ts rename to cli/tests/testdata/run/fix_worker_dispatchevent.ts diff --git a/cli/tests/testdata/fix_worker_dispatchevent.ts.out b/cli/tests/testdata/run/fix_worker_dispatchevent.ts.out similarity index 100% rename from cli/tests/testdata/fix_worker_dispatchevent.ts.out rename to cli/tests/testdata/run/fix_worker_dispatchevent.ts.out diff --git a/cli/tests/testdata/followup_dyn_import_resolves/main.ts b/cli/tests/testdata/run/followup_dyn_import_resolves/main.ts similarity index 100% rename from cli/tests/testdata/followup_dyn_import_resolves/main.ts rename to cli/tests/testdata/run/followup_dyn_import_resolves/main.ts diff --git a/cli/tests/testdata/followup_dyn_import_resolves/main.ts.out b/cli/tests/testdata/run/followup_dyn_import_resolves/main.ts.out similarity index 100% rename from cli/tests/testdata/followup_dyn_import_resolves/main.ts.out rename to cli/tests/testdata/run/followup_dyn_import_resolves/main.ts.out diff --git a/cli/tests/testdata/followup_dyn_import_resolves/sub1.ts b/cli/tests/testdata/run/followup_dyn_import_resolves/sub1.ts similarity index 100% rename from cli/tests/testdata/followup_dyn_import_resolves/sub1.ts rename to cli/tests/testdata/run/followup_dyn_import_resolves/sub1.ts diff --git a/cli/tests/testdata/followup_dyn_import_resolves/sub2.ts b/cli/tests/testdata/run/followup_dyn_import_resolves/sub2.ts similarity index 100% rename from cli/tests/testdata/followup_dyn_import_resolves/sub2.ts rename to cli/tests/testdata/run/followup_dyn_import_resolves/sub2.ts diff --git a/cli/tests/testdata/future_check.ts b/cli/tests/testdata/run/future_check.ts similarity index 100% rename from cli/tests/testdata/future_check.ts rename to cli/tests/testdata/run/future_check.ts diff --git a/cli/tests/testdata/future_check2.out b/cli/tests/testdata/run/future_check2.out similarity index 100% rename from cli/tests/testdata/future_check2.out rename to cli/tests/testdata/run/future_check2.out diff --git a/cli/tests/testdata/heapstats.js b/cli/tests/testdata/run/heapstats.js similarity index 100% rename from cli/tests/testdata/heapstats.js rename to cli/tests/testdata/run/heapstats.js diff --git a/cli/tests/testdata/heapstats.js.out b/cli/tests/testdata/run/heapstats.js.out similarity index 100% rename from cli/tests/testdata/heapstats.js.out rename to cli/tests/testdata/run/heapstats.js.out diff --git a/cli/tests/testdata/http2_request_url.ts b/cli/tests/testdata/run/http2_request_url.ts similarity index 100% rename from cli/tests/testdata/http2_request_url.ts rename to cli/tests/testdata/run/http2_request_url.ts diff --git a/cli/tests/testdata/https_import.ts b/cli/tests/testdata/run/https_import.ts similarity index 100% rename from cli/tests/testdata/https_import.ts rename to cli/tests/testdata/run/https_import.ts diff --git a/cli/tests/testdata/https_import.ts.out b/cli/tests/testdata/run/https_import.ts.out similarity index 100% rename from cli/tests/testdata/https_import.ts.out rename to cli/tests/testdata/run/https_import.ts.out diff --git a/cli/tests/testdata/if_main.ts b/cli/tests/testdata/run/if_main.ts similarity index 100% rename from cli/tests/testdata/if_main.ts rename to cli/tests/testdata/run/if_main.ts diff --git a/cli/tests/testdata/if_main.ts.out b/cli/tests/testdata/run/if_main.ts.out similarity index 100% rename from cli/tests/testdata/if_main.ts.out rename to cli/tests/testdata/run/if_main.ts.out diff --git a/cli/tests/testdata/import_blob_url.ts b/cli/tests/testdata/run/import_blob_url.ts similarity index 100% rename from cli/tests/testdata/import_blob_url.ts rename to cli/tests/testdata/run/import_blob_url.ts diff --git a/cli/tests/testdata/import_blob_url.ts.out b/cli/tests/testdata/run/import_blob_url.ts.out similarity index 100% rename from cli/tests/testdata/import_blob_url.ts.out rename to cli/tests/testdata/run/import_blob_url.ts.out diff --git a/cli/tests/testdata/import_blob_url_error_stack.ts b/cli/tests/testdata/run/import_blob_url_error_stack.ts similarity index 100% rename from cli/tests/testdata/import_blob_url_error_stack.ts rename to cli/tests/testdata/run/import_blob_url_error_stack.ts diff --git a/cli/tests/testdata/import_blob_url_error_stack.ts.out b/cli/tests/testdata/run/import_blob_url_error_stack.ts.out similarity index 100% rename from cli/tests/testdata/import_blob_url_error_stack.ts.out rename to cli/tests/testdata/run/import_blob_url_error_stack.ts.out diff --git a/cli/tests/testdata/import_blob_url_import_relative.ts b/cli/tests/testdata/run/import_blob_url_import_relative.ts similarity index 100% rename from cli/tests/testdata/import_blob_url_import_relative.ts rename to cli/tests/testdata/run/import_blob_url_import_relative.ts diff --git a/cli/tests/testdata/import_blob_url_import_relative.ts.out b/cli/tests/testdata/run/import_blob_url_import_relative.ts.out similarity index 100% rename from cli/tests/testdata/import_blob_url_import_relative.ts.out rename to cli/tests/testdata/run/import_blob_url_import_relative.ts.out diff --git a/cli/tests/testdata/import_blob_url_imports.ts b/cli/tests/testdata/run/import_blob_url_imports.ts similarity index 100% rename from cli/tests/testdata/import_blob_url_imports.ts rename to cli/tests/testdata/run/import_blob_url_imports.ts diff --git a/cli/tests/testdata/import_blob_url_imports.ts.out b/cli/tests/testdata/run/import_blob_url_imports.ts.out similarity index 100% rename from cli/tests/testdata/import_blob_url_imports.ts.out rename to cli/tests/testdata/run/import_blob_url_imports.ts.out diff --git a/cli/tests/testdata/import_blob_url_jsx.ts b/cli/tests/testdata/run/import_blob_url_jsx.ts similarity index 100% rename from cli/tests/testdata/import_blob_url_jsx.ts rename to cli/tests/testdata/run/import_blob_url_jsx.ts diff --git a/cli/tests/testdata/import_blob_url_jsx.ts.out b/cli/tests/testdata/run/import_blob_url_jsx.ts.out similarity index 100% rename from cli/tests/testdata/import_blob_url_jsx.ts.out rename to cli/tests/testdata/run/import_blob_url_jsx.ts.out diff --git a/cli/tests/testdata/053_import_compression/brotli b/cli/tests/testdata/run/import_compression/brotli similarity index 100% rename from cli/tests/testdata/053_import_compression/brotli rename to cli/tests/testdata/run/import_compression/brotli diff --git a/cli/tests/testdata/053_import_compression/gziped b/cli/tests/testdata/run/import_compression/gziped similarity index 100% rename from cli/tests/testdata/053_import_compression/gziped rename to cli/tests/testdata/run/import_compression/gziped diff --git a/cli/tests/testdata/053_import_compression.out b/cli/tests/testdata/run/import_compression/main.out similarity index 100% rename from cli/tests/testdata/053_import_compression.out rename to cli/tests/testdata/run/import_compression/main.out diff --git a/cli/tests/testdata/run/import_compression/main.ts b/cli/tests/testdata/run/import_compression/main.ts new file mode 100644 index 0000000000..3dcd6fa24e --- /dev/null +++ b/cli/tests/testdata/run/import_compression/main.ts @@ -0,0 +1,13 @@ +import "http://127.0.0.1:4545/run/import_compression/gziped"; +import "http://127.0.0.1:4545/run/import_compression/brotli"; + +console.log( + await fetch( + "http://127.0.0.1:4545/run/import_compression/gziped", + ).then((res) => res.text()), +); +console.log( + await fetch( + "http://127.0.0.1:4545/run/import_compression/brotli", + ).then((res) => res.text()), +); diff --git a/cli/tests/testdata/import_data_url.ts b/cli/tests/testdata/run/import_data_url.ts similarity index 100% rename from cli/tests/testdata/import_data_url.ts rename to cli/tests/testdata/run/import_data_url.ts diff --git a/cli/tests/testdata/import_data_url.ts.out b/cli/tests/testdata/run/import_data_url.ts.out similarity index 100% rename from cli/tests/testdata/import_data_url.ts.out rename to cli/tests/testdata/run/import_data_url.ts.out diff --git a/cli/tests/testdata/import_data_url_error_stack.ts b/cli/tests/testdata/run/import_data_url_error_stack.ts similarity index 100% rename from cli/tests/testdata/import_data_url_error_stack.ts rename to cli/tests/testdata/run/import_data_url_error_stack.ts diff --git a/cli/tests/testdata/import_data_url_error_stack.ts.out b/cli/tests/testdata/run/import_data_url_error_stack.ts.out similarity index 100% rename from cli/tests/testdata/import_data_url_error_stack.ts.out rename to cli/tests/testdata/run/import_data_url_error_stack.ts.out diff --git a/cli/tests/testdata/import_data_url_import_relative.ts b/cli/tests/testdata/run/import_data_url_import_relative.ts similarity index 100% rename from cli/tests/testdata/import_data_url_import_relative.ts rename to cli/tests/testdata/run/import_data_url_import_relative.ts diff --git a/cli/tests/testdata/import_data_url_import_relative.ts.out b/cli/tests/testdata/run/import_data_url_import_relative.ts.out similarity index 100% rename from cli/tests/testdata/import_data_url_import_relative.ts.out rename to cli/tests/testdata/run/import_data_url_import_relative.ts.out diff --git a/cli/tests/testdata/import_data_url_imports.ts b/cli/tests/testdata/run/import_data_url_imports.ts similarity index 100% rename from cli/tests/testdata/import_data_url_imports.ts rename to cli/tests/testdata/run/import_data_url_imports.ts diff --git a/cli/tests/testdata/import_data_url_imports.ts.out b/cli/tests/testdata/run/import_data_url_imports.ts.out similarity index 100% rename from cli/tests/testdata/import_data_url_imports.ts.out rename to cli/tests/testdata/run/import_data_url_imports.ts.out diff --git a/cli/tests/testdata/import_data_url_jsx.ts b/cli/tests/testdata/run/import_data_url_jsx.ts similarity index 100% rename from cli/tests/testdata/import_data_url_jsx.ts rename to cli/tests/testdata/run/import_data_url_jsx.ts diff --git a/cli/tests/testdata/import_data_url_jsx.ts.out b/cli/tests/testdata/run/import_data_url_jsx.ts.out similarity index 100% rename from cli/tests/testdata/import_data_url_jsx.ts.out rename to cli/tests/testdata/run/import_data_url_jsx.ts.out diff --git a/cli/tests/testdata/import_dynamic_data_url.ts b/cli/tests/testdata/run/import_dynamic_data_url.ts similarity index 100% rename from cli/tests/testdata/import_dynamic_data_url.ts rename to cli/tests/testdata/run/import_dynamic_data_url.ts diff --git a/cli/tests/testdata/import_dynamic_data_url.ts.out b/cli/tests/testdata/run/import_dynamic_data_url.ts.out similarity index 100% rename from cli/tests/testdata/import_dynamic_data_url.ts.out rename to cli/tests/testdata/run/import_dynamic_data_url.ts.out diff --git a/cli/tests/testdata/import_extensionless.ts b/cli/tests/testdata/run/import_extensionless.ts similarity index 100% rename from cli/tests/testdata/import_extensionless.ts rename to cli/tests/testdata/run/import_extensionless.ts diff --git a/cli/tests/testdata/import_extensionless.ts.out b/cli/tests/testdata/run/import_extensionless.ts.out similarity index 100% rename from cli/tests/testdata/import_extensionless.ts.out rename to cli/tests/testdata/run/import_extensionless.ts.out diff --git a/cli/tests/testdata/import_file_with_colon.ts b/cli/tests/testdata/run/import_file_with_colon.ts similarity index 100% rename from cli/tests/testdata/import_file_with_colon.ts rename to cli/tests/testdata/run/import_file_with_colon.ts diff --git a/cli/tests/testdata/import_file_with_colon.ts.out b/cli/tests/testdata/run/import_file_with_colon.ts.out similarity index 100% rename from cli/tests/testdata/import_file_with_colon.ts.out rename to cli/tests/testdata/run/import_file_with_colon.ts.out diff --git a/cli/tests/testdata/import_meta.importmap.json b/cli/tests/testdata/run/import_meta/importmap.json similarity index 100% rename from cli/tests/testdata/import_meta.importmap.json rename to cli/tests/testdata/run/import_meta/importmap.json diff --git a/cli/tests/testdata/import_meta.ts.out b/cli/tests/testdata/run/import_meta/main.out similarity index 83% rename from cli/tests/testdata/import_meta.ts.out rename to cli/tests/testdata/run/import_meta/main.out index a431f61df7..89aeddaf32 100644 --- a/cli/tests/testdata/import_meta.ts.out +++ b/cli/tests/testdata/run/import_meta/main.out @@ -1,5 +1,5 @@ -import_meta2 [WILDCARD]import_meta2.ts false -import_meta [WILDCARD]import_meta.ts true +other [WILDCARD]other.ts false +main [WILDCARD]main.ts true Resolving ./foo.js file:///[WILDCARD]/foo.js Resolving bare from import map https://example.com/ Resolving https://example.com/rewrite from import map https://example.com/rewritten diff --git a/cli/tests/testdata/import_meta.ts b/cli/tests/testdata/run/import_meta/main.ts similarity index 82% rename from cli/tests/testdata/import_meta.ts rename to cli/tests/testdata/run/import_meta/main.ts index 37af690201..02f0a1c589 100644 --- a/cli/tests/testdata/import_meta.ts +++ b/cli/tests/testdata/run/import_meta/main.ts @@ -1,8 +1,8 @@ -import { assertThrows } from "../../../test_util/std/testing/asserts.ts"; +import { assertThrows } from "../../../../../test_util/std/testing/asserts.ts"; -console.log("import_meta", import.meta.url, import.meta.main); +console.log("main", import.meta.url, import.meta.main); -import "./import_meta2.ts"; +import "./other.ts"; console.log("Resolving ./foo.js", import.meta.resolve("./foo.js")); console.log("Resolving bare from import map", import.meta.resolve("bare")); diff --git a/cli/tests/testdata/run/import_meta/other.ts b/cli/tests/testdata/run/import_meta/other.ts new file mode 100644 index 0000000000..47d7527cd7 --- /dev/null +++ b/cli/tests/testdata/run/import_meta/other.ts @@ -0,0 +1 @@ +console.log("other", import.meta.url, import.meta.main); diff --git a/cli/tests/testdata/run/import_type.ts b/cli/tests/testdata/run/import_type.ts new file mode 100644 index 0000000000..22c639cbcf --- /dev/null +++ b/cli/tests/testdata/run/import_type.ts @@ -0,0 +1,5 @@ +import { type B, create } from "../subdir/export_types.ts"; + +const b: B = create(); + +console.log(b); diff --git a/cli/tests/testdata/import_type.ts.out b/cli/tests/testdata/run/import_type.ts.out similarity index 100% rename from cli/tests/testdata/import_type.ts.out rename to cli/tests/testdata/run/import_type.ts.out diff --git a/cli/tests/testdata/inline_js_source_map.ts b/cli/tests/testdata/run/inline_js_source_map.ts similarity index 100% rename from cli/tests/testdata/inline_js_source_map.ts rename to cli/tests/testdata/run/inline_js_source_map.ts diff --git a/cli/tests/testdata/run/inline_js_source_map_2.js b/cli/tests/testdata/run/inline_js_source_map_2.js new file mode 100644 index 0000000000..d14d906b80 --- /dev/null +++ b/cli/tests/testdata/run/inline_js_source_map_2.js @@ -0,0 +1,4 @@ +"use strict"; +1 + 1; +throw new Error("Hello world!"); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/cli/tests/testdata/run/inline_js_source_map_2.js.out b/cli/tests/testdata/run/inline_js_source_map_2.js.out new file mode 100644 index 0000000000..72a531b0bc --- /dev/null +++ b/cli/tests/testdata/run/inline_js_source_map_2.js.out @@ -0,0 +1,2 @@ +error: Uncaught Error: Hello world! + at http://localhost:4545/run/inline_js_source_map_2.ts:6:7 diff --git a/cli/tests/testdata/inline_js_source_map_2.ts b/cli/tests/testdata/run/inline_js_source_map_2.ts similarity index 100% rename from cli/tests/testdata/inline_js_source_map_2.ts rename to cli/tests/testdata/run/inline_js_source_map_2.ts diff --git a/cli/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js b/cli/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js new file mode 100644 index 0000000000..7660cc229b --- /dev/null +++ b/cli/tests/testdata/run/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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcF8yLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIjErMTtcbmludGVyZmFjZSBUZXN0IHtcbiAgaGVsbG86IHN0cmluZztcbn1cblxudGhyb3cgbmV3IEVycm9yKFwiSGVsbG8gd29ybGQhXCIgYXMgdW5rbm93biBhcyBzdHJpbmcpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxDQUFDLEdBQUMsQ0FBQyxDQUFDO0FBS0osTUFBTSxJQUFJLEtBQUssQ0FBQyxjQUErQixDQUFDLENBQUMifQ== \ No newline at end of file diff --git a/cli/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js.out b/cli/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js.out new file mode 100644 index 0000000000..72a531b0bc --- /dev/null +++ b/cli/tests/testdata/run/inline_js_source_map_2_with_inline_contents.js.out @@ -0,0 +1,2 @@ +error: Uncaught Error: Hello world! + at http://localhost:4545/run/inline_js_source_map_2.ts:6:7 diff --git a/cli/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js b/cli/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js new file mode 100644 index 0000000000..887f023209 --- /dev/null +++ b/cli/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js @@ -0,0 +1,4 @@ +"use strict"; +import "http://localhost:4545/run/inline_js_source_map.ts"; +throw new Error("Hello world!"); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaHR0cDovL2xvY2FsaG9zdDo0NTQ1L3J1bi9pbmxpbmVfanNfc291cmNlX21hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsQ0FBQyxHQUFDLENBQUMsQ0FBQztBQUtKLE1BQU0sSUFBSSxLQUFLLENBQUMsY0FBK0IsQ0FBQyxDQUFDIn0= \ No newline at end of file diff --git a/cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js.out b/cli/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js.out similarity index 59% rename from cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js.out rename to cli/tests/testdata/run/inline_js_source_map_with_contents_from_graph.js.out index 7304fc5f64..9a5a26a68e 100644 --- a/cli/tests/testdata/inline_js_source_map_with_contents_from_graph.js.out +++ b/cli/tests/testdata/run/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/inline_js_source_map.ts:6:7 + at http://localhost:4545/run/inline_js_source_map.ts:6:7 diff --git a/cli/tests/testdata/run/issue13562.ts b/cli/tests/testdata/run/issue13562.ts new file mode 100644 index 0000000000..afbf69f99e --- /dev/null +++ b/cli/tests/testdata/run/issue13562.ts @@ -0,0 +1,3 @@ +import { printHello3 } from "../subdir/mod1.ts?q=.json"; + +printHello3(); diff --git a/cli/tests/testdata/issue13562.ts.out b/cli/tests/testdata/run/issue13562.ts.out similarity index 100% rename from cli/tests/testdata/issue13562.ts.out rename to cli/tests/testdata/run/issue13562.ts.out diff --git a/cli/tests/testdata/issue9750.js b/cli/tests/testdata/run/issue9750.js similarity index 100% rename from cli/tests/testdata/issue9750.js rename to cli/tests/testdata/run/issue9750.js diff --git a/cli/tests/testdata/js_import_detect.ts b/cli/tests/testdata/run/js_import_detect.ts similarity index 100% rename from cli/tests/testdata/js_import_detect.ts rename to cli/tests/testdata/run/js_import_detect.ts diff --git a/cli/tests/testdata/js_import_detect.ts.out b/cli/tests/testdata/run/js_import_detect.ts.out similarity index 100% rename from cli/tests/testdata/js_import_detect.ts.out rename to cli/tests/testdata/run/js_import_detect.ts.out diff --git a/cli/tests/testdata/js_root_with_ts_check.js b/cli/tests/testdata/run/js_root_with_ts_check.js similarity index 100% rename from cli/tests/testdata/js_root_with_ts_check.js rename to cli/tests/testdata/run/js_root_with_ts_check.js diff --git a/cli/tests/testdata/js_root_with_ts_check.js.out b/cli/tests/testdata/run/js_root_with_ts_check.js.out similarity index 100% rename from cli/tests/testdata/js_root_with_ts_check.js.out rename to cli/tests/testdata/run/js_root_with_ts_check.js.out diff --git a/cli/tests/testdata/jsx_import_from_ts.App.jsx b/cli/tests/testdata/run/jsx_import_from_ts.App.jsx similarity index 100% rename from cli/tests/testdata/jsx_import_from_ts.App.jsx rename to cli/tests/testdata/run/jsx_import_from_ts.App.jsx diff --git a/cli/tests/testdata/jsx_import_from_ts.ts b/cli/tests/testdata/run/jsx_import_from_ts.ts similarity index 100% rename from cli/tests/testdata/jsx_import_from_ts.ts rename to cli/tests/testdata/run/jsx_import_from_ts.ts diff --git a/cli/tests/testdata/jsx_import_from_ts.ts.out b/cli/tests/testdata/run/jsx_import_from_ts.ts.out similarity index 100% rename from cli/tests/testdata/jsx_import_from_ts.ts.out rename to cli/tests/testdata/run/jsx_import_from_ts.ts.out diff --git a/cli/tests/testdata/jsx_import_source.out b/cli/tests/testdata/run/jsx_import_source.out similarity index 100% rename from cli/tests/testdata/jsx_import_source.out rename to cli/tests/testdata/run/jsx_import_source.out diff --git a/cli/tests/testdata/jsx_import_source_dev.out b/cli/tests/testdata/run/jsx_import_source_dev.out similarity index 100% rename from cli/tests/testdata/jsx_import_source_dev.out rename to cli/tests/testdata/run/jsx_import_source_dev.out diff --git a/cli/tests/testdata/jsx_import_source_error.out b/cli/tests/testdata/run/jsx_import_source_error.out similarity index 100% rename from cli/tests/testdata/jsx_import_source_error.out rename to cli/tests/testdata/run/jsx_import_source_error.out diff --git a/cli/tests/testdata/jsx_import_source_import_map.out b/cli/tests/testdata/run/jsx_import_source_import_map.out similarity index 100% rename from cli/tests/testdata/jsx_import_source_import_map.out rename to cli/tests/testdata/run/jsx_import_source_import_map.out diff --git a/cli/tests/testdata/jsx_import_source_import_map_dev.out b/cli/tests/testdata/run/jsx_import_source_import_map_dev.out similarity index 100% rename from cli/tests/testdata/jsx_import_source_import_map_dev.out rename to cli/tests/testdata/run/jsx_import_source_import_map_dev.out diff --git a/cli/tests/testdata/jsx_import_source_no_pragma.tsx b/cli/tests/testdata/run/jsx_import_source_no_pragma.tsx similarity index 100% rename from cli/tests/testdata/jsx_import_source_no_pragma.tsx rename to cli/tests/testdata/run/jsx_import_source_no_pragma.tsx diff --git a/cli/tests/testdata/jsx_import_source_pragma.tsx b/cli/tests/testdata/run/jsx_import_source_pragma.tsx similarity index 100% rename from cli/tests/testdata/jsx_import_source_pragma.tsx rename to cli/tests/testdata/run/jsx_import_source_pragma.tsx diff --git a/cli/tests/testdata/jsx_import_source_pragma_import_map.tsx b/cli/tests/testdata/run/jsx_import_source_pragma_import_map.tsx similarity index 100% rename from cli/tests/testdata/jsx_import_source_pragma_import_map.tsx rename to cli/tests/testdata/run/jsx_import_source_pragma_import_map.tsx diff --git a/cli/tests/testdata/lock_check_err.json b/cli/tests/testdata/run/lock_check_err.json similarity index 66% rename from cli/tests/testdata/lock_check_err.json rename to cli/tests/testdata/run/lock_check_err.json index 9bf52adca5..fc6c2d45c4 100644 --- a/cli/tests/testdata/lock_check_err.json +++ b/cli/tests/testdata/run/lock_check_err.json @@ -1,4 +1,4 @@ { "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", - "http://127.0.0.1:4545/003_relative_import.ts": "bad" + "http://127.0.0.1:4545/run/003_relative_import.ts": "bad" } diff --git a/cli/tests/testdata/run/lock_check_err.out b/cli/tests/testdata/run/lock_check_err.out new file mode 100644 index 0000000000..e4cc7b81a1 --- /dev/null +++ b/cli/tests/testdata/run/lock_check_err.out @@ -0,0 +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/run/003_relative_import.ts + Lock file: run/lock_check_err.json diff --git a/cli/tests/testdata/lock_check_err2.json b/cli/tests/testdata/run/lock_check_err2.json similarity index 100% rename from cli/tests/testdata/lock_check_err2.json rename to cli/tests/testdata/run/lock_check_err2.json diff --git a/cli/tests/testdata/lock_check_err2.out b/cli/tests/testdata/run/lock_check_err2.out similarity index 81% rename from cli/tests/testdata/lock_check_err2.out rename to cli/tests/testdata/run/lock_check_err2.out index 958c01654b..065c7434b8 100644 --- a/cli/tests/testdata/lock_check_err2.out +++ b/cli/tests/testdata/run/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/subdir/mt_text_ecmascript.j3.js - Lock file: lock_check_err2.json + Lock file: run/lock_check_err2.json diff --git a/cli/tests/testdata/lock_check_ok.json b/cli/tests/testdata/run/lock_check_ok.json similarity index 50% rename from cli/tests/testdata/lock_check_ok.json rename to cli/tests/testdata/run/lock_check_ok.json index 9dd5b05481..94de0f6307 100644 --- a/cli/tests/testdata/lock_check_ok.json +++ b/cli/tests/testdata/run/lock_check_ok.json @@ -1,4 +1,4 @@ { "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", - "http://127.0.0.1:4545/003_relative_import.ts": "aa9e16de824f81871a1c7164d5bd6857df7db2e18621750bd66b0bde4df07f21" + "http://127.0.0.1:4545/run/003_relative_import.ts": "a1572e8fd2c2712b33f04aed2561505b5feb2c8696f1f2cded3de7127931b97e" } diff --git a/cli/tests/testdata/lock_check_ok2.json b/cli/tests/testdata/run/lock_check_ok2.json similarity index 100% rename from cli/tests/testdata/lock_check_ok2.json rename to cli/tests/testdata/run/lock_check_ok2.json diff --git a/cli/tests/testdata/lock_dynamic_imports.json b/cli/tests/testdata/run/lock_dynamic_imports.json similarity index 70% rename from cli/tests/testdata/lock_dynamic_imports.json rename to cli/tests/testdata/run/lock_dynamic_imports.json index 57263bc85b..0269b9409c 100644 --- a/cli/tests/testdata/lock_dynamic_imports.json +++ b/cli/tests/testdata/run/lock_dynamic_imports.json @@ -1,5 +1,5 @@ { - "http://127.0.0.1:4545/013_dynamic_import.ts": "f0d2d108c100e769cda9f26b74326f21e44cab81611aa7f6cd2b731d4cbc1995", + "http://127.0.0.1:4545/run/013_dynamic_import.ts": "3f83e653329dc1f963761a986997d710b9763f667fc243eef89b3a5decacda30", "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/testdata/lock_dynamic_imports.out b/cli/tests/testdata/run/lock_dynamic_imports.out similarity index 78% rename from cli/tests/testdata/lock_dynamic_imports.out rename to cli/tests/testdata/run/lock_dynamic_imports.out index 601d2282b7..acc65c8e6b 100644 --- a/cli/tests/testdata/lock_dynamic_imports.out +++ b/cli/tests/testdata/run/lock_dynamic_imports.out @@ -1,4 +1,4 @@ [WILDCARD] error: The source code is invalid, as it does not match the expected hash in the lock file. Specifier: http://127.0.0.1:4545/subdir/subdir2/mod2.ts - Lock file: lock_dynamic_imports.json + Lock file: run/lock_dynamic_imports.json diff --git a/cli/tests/testdata/file_exists.ts b/cli/tests/testdata/run/lock_write_fetch/file_exists.ts similarity index 100% rename from cli/tests/testdata/file_exists.ts rename to cli/tests/testdata/run/lock_write_fetch/file_exists.ts diff --git a/cli/tests/testdata/lock_write_fetch.ts.out b/cli/tests/testdata/run/lock_write_fetch/main.out similarity index 100% rename from cli/tests/testdata/lock_write_fetch.ts.out rename to cli/tests/testdata/run/lock_write_fetch/main.out diff --git a/cli/tests/testdata/lock_write_fetch.ts b/cli/tests/testdata/run/lock_write_fetch/main.ts similarity index 90% rename from cli/tests/testdata/lock_write_fetch.ts rename to cli/tests/testdata/run/lock_write_fetch/main.ts index b403f5536c..3e6892cf02 100644 --- a/cli/tests/testdata/lock_write_fetch.ts +++ b/cli/tests/testdata/run/lock_write_fetch/main.ts @@ -13,7 +13,7 @@ const fetchProc = await Deno.spawn(Deno.execPath(), { "--lock=lock_write_fetch.json", "--lock-write", "--cert=tls/RootCA.pem", - "https_import.ts", + "run/https_import.ts", ], }); @@ -26,7 +26,7 @@ const fetchCheckProc = await Deno.spawn(Deno.execPath(), { "cache", "--lock=lock_write_fetch.json", "--cert=tls/RootCA.pem", - "https_import.ts", + "run/https_import.ts", ], }); @@ -42,7 +42,7 @@ const runProc = await Deno.spawn(Deno.execPath(), { "--lock=lock_write_fetch.json", "--lock-write", "--allow-read", - "file_exists.ts", + "run/lock_write_fetch/file_exists.ts", "lock_write_fetch.json", ], }); diff --git a/cli/tests/testdata/lock_write_requires_lock.out b/cli/tests/testdata/run/lock_write_requires_lock.out similarity index 100% rename from cli/tests/testdata/lock_write_requires_lock.out rename to cli/tests/testdata/run/lock_write_requires_lock.out diff --git a/cli/tests/testdata/long_data_url_formatting.ts b/cli/tests/testdata/run/long_data_url_formatting.ts similarity index 100% rename from cli/tests/testdata/long_data_url_formatting.ts rename to cli/tests/testdata/run/long_data_url_formatting.ts diff --git a/cli/tests/testdata/long_data_url_formatting.ts.out b/cli/tests/testdata/run/long_data_url_formatting.ts.out similarity index 100% rename from cli/tests/testdata/long_data_url_formatting.ts.out rename to cli/tests/testdata/run/long_data_url_formatting.ts.out diff --git a/cli/tests/testdata/run/main_module/main.out b/cli/tests/testdata/run/main_module/main.out new file mode 100644 index 0000000000..29f592c2a6 --- /dev/null +++ b/cli/tests/testdata/run/main_module/main.out @@ -0,0 +1,2 @@ +other [WILDCARD]/main.ts +main [WILDCARD]/main.ts diff --git a/cli/tests/testdata/run/main_module/main.ts b/cli/tests/testdata/run/main_module/main.ts new file mode 100644 index 0000000000..d2f2c66ee7 --- /dev/null +++ b/cli/tests/testdata/run/main_module/main.ts @@ -0,0 +1,3 @@ +console.log("main", Deno.mainModule); + +import "./other.ts"; diff --git a/cli/tests/testdata/run/main_module/other.ts b/cli/tests/testdata/run/main_module/other.ts new file mode 100644 index 0000000000..b3e524b0a3 --- /dev/null +++ b/cli/tests/testdata/run/main_module/other.ts @@ -0,0 +1 @@ +console.log("other", Deno.mainModule); diff --git a/cli/tests/testdata/mts_dmts_mjs.out b/cli/tests/testdata/run/mts_dmts_mjs.out similarity index 100% rename from cli/tests/testdata/mts_dmts_mjs.out rename to cli/tests/testdata/run/mts_dmts_mjs.out diff --git a/cli/tests/testdata/nested_error.ts b/cli/tests/testdata/run/nested_error.ts similarity index 100% rename from cli/tests/testdata/nested_error.ts rename to cli/tests/testdata/run/nested_error.ts diff --git a/cli/tests/testdata/run/nested_error.ts.out b/cli/tests/testdata/run/nested_error.ts.out new file mode 100644 index 0000000000..f5ebeec4d8 --- /dev/null +++ b/cli/tests/testdata/run/nested_error.ts.out @@ -0,0 +1,4 @@ +error: Uncaught { + foo: Error + at file:///[WILDCARD]testdata/run/nested_error.ts:2:8 +} diff --git a/cli/tests/testdata/no_check_decorators.ts b/cli/tests/testdata/run/no_check_decorators.ts similarity index 100% rename from cli/tests/testdata/no_check_decorators.ts rename to cli/tests/testdata/run/no_check_decorators.ts diff --git a/cli/tests/testdata/no_check_decorators.ts.out b/cli/tests/testdata/run/no_check_decorators.ts.out similarity index 100% rename from cli/tests/testdata/no_check_decorators.ts.out rename to cli/tests/testdata/run/no_check_decorators.ts.out diff --git a/cli/tests/testdata/087_hello.ts b/cli/tests/testdata/run/no_check_imports_not_used_as_values/hello.ts similarity index 100% rename from cli/tests/testdata/087_hello.ts rename to cli/tests/testdata/run/no_check_imports_not_used_as_values/hello.ts diff --git a/cli/tests/testdata/087_no_check_imports_not_used_as_values.ts.out b/cli/tests/testdata/run/no_check_imports_not_used_as_values/main.out similarity index 100% rename from cli/tests/testdata/087_no_check_imports_not_used_as_values.ts.out rename to cli/tests/testdata/run/no_check_imports_not_used_as_values/main.out diff --git a/cli/tests/testdata/087_no_check_imports_not_used_as_values.ts b/cli/tests/testdata/run/no_check_imports_not_used_as_values/main.ts similarity index 55% rename from cli/tests/testdata/087_no_check_imports_not_used_as_values.ts rename to cli/tests/testdata/run/no_check_imports_not_used_as_values/main.ts index 64a13f9b19..80e17aa35d 100644 --- a/cli/tests/testdata/087_no_check_imports_not_used_as_values.ts +++ b/cli/tests/testdata/run/no_check_imports_not_used_as_values/main.ts @@ -1,4 +1,4 @@ -import { SomeType } from "./087_hello.ts"; +import { SomeType } from "./hello.ts"; const string: SomeType = "Hi!"; console.log(string); diff --git a/cli/tests/testdata/preserve_imports.tsconfig.json b/cli/tests/testdata/run/no_check_imports_not_used_as_values/preserve_imports.tsconfig.json similarity index 100% rename from cli/tests/testdata/preserve_imports.tsconfig.json rename to cli/tests/testdata/run/no_check_imports_not_used_as_values/preserve_imports.tsconfig.json diff --git a/cli/tests/testdata/no_check_remote.ts b/cli/tests/testdata/run/no_check_remote.ts similarity index 100% rename from cli/tests/testdata/no_check_remote.ts rename to cli/tests/testdata/run/no_check_remote.ts diff --git a/cli/tests/testdata/no_check_remote.ts.disabled.out b/cli/tests/testdata/run/no_check_remote.ts.disabled.out similarity index 100% rename from cli/tests/testdata/no_check_remote.ts.disabled.out rename to cli/tests/testdata/run/no_check_remote.ts.disabled.out diff --git a/cli/tests/testdata/no_check_remote.ts.enabled.out b/cli/tests/testdata/run/no_check_remote.ts.enabled.out similarity index 100% rename from cli/tests/testdata/no_check_remote.ts.enabled.out rename to cli/tests/testdata/run/no_check_remote.ts.enabled.out diff --git a/cli/tests/testdata/no_mem_cache.js b/cli/tests/testdata/run/no_mem_cache.js similarity index 100% rename from cli/tests/testdata/no_mem_cache.js rename to cli/tests/testdata/run/no_mem_cache.js diff --git a/cli/tests/testdata/no_mem_cache.js.out b/cli/tests/testdata/run/no_mem_cache.js.out similarity index 100% rename from cli/tests/testdata/no_mem_cache.js.out rename to cli/tests/testdata/run/no_mem_cache.js.out diff --git a/cli/tests/testdata/no_prompt.ts b/cli/tests/testdata/run/no_prompt.ts similarity index 100% rename from cli/tests/testdata/no_prompt.ts rename to cli/tests/testdata/run/no_prompt.ts diff --git a/cli/tests/testdata/no_validate_asm.js b/cli/tests/testdata/run/no_validate_asm.js similarity index 100% rename from cli/tests/testdata/no_validate_asm.js rename to cli/tests/testdata/run/no_validate_asm.js diff --git a/cli/tests/testdata/node_env_var_allowlist.ts b/cli/tests/testdata/run/node_env_var_allowlist.ts similarity index 100% rename from cli/tests/testdata/node_env_var_allowlist.ts rename to cli/tests/testdata/run/node_env_var_allowlist.ts diff --git a/cli/tests/testdata/node_env_var_allowlist_with_unstable_flag.ts.out b/cli/tests/testdata/run/node_env_var_allowlist_with_unstable_flag.ts.out similarity index 100% rename from cli/tests/testdata/node_env_var_allowlist_with_unstable_flag.ts.out rename to cli/tests/testdata/run/node_env_var_allowlist_with_unstable_flag.ts.out diff --git a/cli/tests/testdata/node_env_var_allowlist_without_unstable_flag.ts.out b/cli/tests/testdata/run/node_env_var_allowlist_without_unstable_flag.ts.out similarity index 100% rename from cli/tests/testdata/node_env_var_allowlist_without_unstable_flag.ts.out rename to cli/tests/testdata/run/node_env_var_allowlist_without_unstable_flag.ts.out diff --git a/cli/tests/testdata/034_onload/imported.ts b/cli/tests/testdata/run/onload/imported.ts similarity index 81% rename from cli/tests/testdata/034_onload/imported.ts rename to cli/tests/testdata/run/onload/imported.ts index a176d42009..969f97e563 100644 --- a/cli/tests/testdata/034_onload/imported.ts +++ b/cli/tests/testdata/run/onload/imported.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-window-prefix -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/testdata/034_onload.out b/cli/tests/testdata/run/onload/main.out similarity index 100% rename from cli/tests/testdata/034_onload.out rename to cli/tests/testdata/run/onload/main.out diff --git a/cli/tests/testdata/034_onload/main.ts b/cli/tests/testdata/run/onload/main.ts similarity index 89% rename from cli/tests/testdata/034_onload/main.ts rename to cli/tests/testdata/run/onload/main.ts index df67131054..798b8aa7b0 100644 --- a/cli/tests/testdata/034_onload/main.ts +++ b/cli/tests/testdata/run/onload/main.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-window-prefix no-prototype-builtins -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/testdata/034_onload/nest_imported.ts b/cli/tests/testdata/run/onload/nest_imported.ts similarity index 80% rename from cli/tests/testdata/034_onload/nest_imported.ts rename to cli/tests/testdata/run/onload/nest_imported.ts index e461dd9b1f..351a3cb221 100644 --- a/cli/tests/testdata/034_onload/nest_imported.ts +++ b/cli/tests/testdata/run/onload/nest_imported.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-window-prefix -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/op_exit_op_set_exit_code_in_worker.ts b/cli/tests/testdata/run/op_exit_op_set_exit_code_in_worker.ts similarity index 100% rename from cli/tests/testdata/op_exit_op_set_exit_code_in_worker.ts rename to cli/tests/testdata/run/op_exit_op_set_exit_code_in_worker.ts diff --git a/cli/tests/testdata/op_exit_op_set_exit_code_worker.js b/cli/tests/testdata/run/op_exit_op_set_exit_code_worker.js similarity index 100% rename from cli/tests/testdata/op_exit_op_set_exit_code_worker.js rename to cli/tests/testdata/run/op_exit_op_set_exit_code_worker.js diff --git a/cli/tests/testdata/permission_test.ts b/cli/tests/testdata/run/permission_test.ts similarity index 94% rename from cli/tests/testdata/permission_test.ts rename to cli/tests/testdata/run/permission_test.ts index 4b186a0a2f..9b5409b4f2 100644 --- a/cli/tests/testdata/permission_test.ts +++ b/cli/tests/testdata/run/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("hello.txt"); + Deno.readFileSync("assets/hello.txt"); return Promise.resolve(); }, writeRequired() { diff --git a/cli/tests/testdata/private_field_presence.ts b/cli/tests/testdata/run/private_field_presence.ts similarity index 100% rename from cli/tests/testdata/private_field_presence.ts rename to cli/tests/testdata/run/private_field_presence.ts diff --git a/cli/tests/testdata/private_field_presence.ts.out b/cli/tests/testdata/run/private_field_presence.ts.out similarity index 100% rename from cli/tests/testdata/private_field_presence.ts.out rename to cli/tests/testdata/run/private_field_presence.ts.out diff --git a/cli/tests/testdata/proto_exploit.js b/cli/tests/testdata/run/proto_exploit.js similarity index 100% rename from cli/tests/testdata/proto_exploit.js rename to cli/tests/testdata/run/proto_exploit.js diff --git a/cli/tests/testdata/proto_exploit.js.out b/cli/tests/testdata/run/proto_exploit.js.out similarity index 100% rename from cli/tests/testdata/proto_exploit.js.out rename to cli/tests/testdata/run/proto_exploit.js.out diff --git a/cli/tests/testdata/queue_microtask_error.ts b/cli/tests/testdata/run/queue_microtask_error.ts similarity index 100% rename from cli/tests/testdata/queue_microtask_error.ts rename to cli/tests/testdata/run/queue_microtask_error.ts diff --git a/cli/tests/testdata/queue_microtask_error.ts.out b/cli/tests/testdata/run/queue_microtask_error.ts.out similarity index 100% rename from cli/tests/testdata/queue_microtask_error.ts.out rename to cli/tests/testdata/run/queue_microtask_error.ts.out diff --git a/cli/tests/testdata/queue_microtask_error_handled.ts b/cli/tests/testdata/run/queue_microtask_error_handled.ts similarity index 100% rename from cli/tests/testdata/queue_microtask_error_handled.ts rename to cli/tests/testdata/run/queue_microtask_error_handled.ts diff --git a/cli/tests/testdata/queue_microtask_error_handled.ts.out b/cli/tests/testdata/run/queue_microtask_error_handled.ts.out similarity index 100% rename from cli/tests/testdata/queue_microtask_error_handled.ts.out rename to cli/tests/testdata/run/queue_microtask_error_handled.ts.out diff --git a/cli/tests/testdata/reference_types.ts b/cli/tests/testdata/run/reference_types.ts similarity index 100% rename from cli/tests/testdata/reference_types.ts rename to cli/tests/testdata/run/reference_types.ts diff --git a/cli/tests/testdata/reference_types.ts.out b/cli/tests/testdata/run/reference_types.ts.out similarity index 100% rename from cli/tests/testdata/reference_types.ts.out rename to cli/tests/testdata/run/reference_types.ts.out diff --git a/cli/tests/testdata/reference_types_error.js b/cli/tests/testdata/run/reference_types_error.js similarity index 100% rename from cli/tests/testdata/reference_types_error.js rename to cli/tests/testdata/run/reference_types_error.js diff --git a/cli/tests/testdata/reference_types_error.js.out b/cli/tests/testdata/run/reference_types_error.js.out similarity index 100% rename from cli/tests/testdata/reference_types_error.js.out rename to cli/tests/testdata/run/reference_types_error.js.out diff --git a/cli/tests/testdata/reference_types_remote.ts b/cli/tests/testdata/run/reference_types_remote.ts similarity index 100% rename from cli/tests/testdata/reference_types_remote.ts rename to cli/tests/testdata/run/reference_types_remote.ts diff --git a/cli/tests/testdata/reference_types_remote.ts.out b/cli/tests/testdata/run/reference_types_remote.ts.out similarity index 100% rename from cli/tests/testdata/reference_types_remote.ts.out rename to cli/tests/testdata/run/reference_types_remote.ts.out diff --git a/cli/tests/testdata/replace_self.js b/cli/tests/testdata/run/replace_self.js similarity index 100% rename from cli/tests/testdata/replace_self.js rename to cli/tests/testdata/run/replace_self.js diff --git a/cli/tests/testdata/replace_self.js.out b/cli/tests/testdata/run/replace_self.js.out similarity index 100% rename from cli/tests/testdata/replace_self.js.out rename to cli/tests/testdata/run/replace_self.js.out diff --git a/cli/tests/testdata/report_error.ts b/cli/tests/testdata/run/report_error.ts similarity index 100% rename from cli/tests/testdata/report_error.ts rename to cli/tests/testdata/run/report_error.ts diff --git a/cli/tests/testdata/report_error.ts.out b/cli/tests/testdata/run/report_error.ts.out similarity index 100% rename from cli/tests/testdata/report_error.ts.out rename to cli/tests/testdata/run/report_error.ts.out diff --git a/cli/tests/testdata/report_error_end_of_program.ts b/cli/tests/testdata/run/report_error_end_of_program.ts similarity index 100% rename from cli/tests/testdata/report_error_end_of_program.ts rename to cli/tests/testdata/run/report_error_end_of_program.ts diff --git a/cli/tests/testdata/report_error_end_of_program.ts.out b/cli/tests/testdata/run/report_error_end_of_program.ts.out similarity index 100% rename from cli/tests/testdata/report_error_end_of_program.ts.out rename to cli/tests/testdata/run/report_error_end_of_program.ts.out diff --git a/cli/tests/testdata/report_error_handled.ts b/cli/tests/testdata/run/report_error_handled.ts similarity index 100% rename from cli/tests/testdata/report_error_handled.ts rename to cli/tests/testdata/run/report_error_handled.ts diff --git a/cli/tests/testdata/report_error_handled.ts.out b/cli/tests/testdata/run/report_error_handled.ts.out similarity index 100% rename from cli/tests/testdata/report_error_handled.ts.out rename to cli/tests/testdata/run/report_error_handled.ts.out diff --git a/cli/tests/testdata/resolve_dns.ts b/cli/tests/testdata/run/resolve_dns.ts similarity index 100% rename from cli/tests/testdata/resolve_dns.ts rename to cli/tests/testdata/run/resolve_dns.ts diff --git a/cli/tests/testdata/resolve_dns.ts.out b/cli/tests/testdata/run/resolve_dns.ts.out similarity index 100% rename from cli/tests/testdata/resolve_dns.ts.out rename to cli/tests/testdata/run/resolve_dns.ts.out diff --git a/cli/tests/testdata/resolve_dns.zone.in b/cli/tests/testdata/run/resolve_dns.zone.in similarity index 100% rename from cli/tests/testdata/resolve_dns.zone.in rename to cli/tests/testdata/run/resolve_dns.zone.in diff --git a/cli/tests/testdata/runtime_decorators.ts b/cli/tests/testdata/run/runtime_decorators.ts similarity index 100% rename from cli/tests/testdata/runtime_decorators.ts rename to cli/tests/testdata/run/runtime_decorators.ts diff --git a/cli/tests/testdata/runtime_decorators.ts.out b/cli/tests/testdata/run/runtime_decorators.ts.out similarity index 100% rename from cli/tests/testdata/runtime_decorators.ts.out rename to cli/tests/testdata/run/runtime_decorators.ts.out diff --git a/cli/tests/testdata/seed_random.js b/cli/tests/testdata/run/seed_random.js similarity index 100% rename from cli/tests/testdata/seed_random.js rename to cli/tests/testdata/run/seed_random.js diff --git a/cli/tests/testdata/seed_random.js.out b/cli/tests/testdata/run/seed_random.js.out similarity index 100% rename from cli/tests/testdata/seed_random.js.out rename to cli/tests/testdata/run/seed_random.js.out diff --git a/cli/tests/testdata/set_exit_code_0.ts b/cli/tests/testdata/run/set_exit_code_0.ts similarity index 100% rename from cli/tests/testdata/set_exit_code_0.ts rename to cli/tests/testdata/run/set_exit_code_0.ts diff --git a/cli/tests/testdata/set_exit_code_1.ts b/cli/tests/testdata/run/set_exit_code_1.ts similarity index 100% rename from cli/tests/testdata/set_exit_code_1.ts rename to cli/tests/testdata/run/set_exit_code_1.ts diff --git a/cli/tests/testdata/set_exit_code_2.ts b/cli/tests/testdata/run/set_exit_code_2.ts similarity index 100% rename from cli/tests/testdata/set_exit_code_2.ts rename to cli/tests/testdata/run/set_exit_code_2.ts diff --git a/cli/tests/testdata/set_timeout_error.ts b/cli/tests/testdata/run/set_timeout_error.ts similarity index 100% rename from cli/tests/testdata/set_timeout_error.ts rename to cli/tests/testdata/run/set_timeout_error.ts diff --git a/cli/tests/testdata/set_timeout_error.ts.out b/cli/tests/testdata/run/set_timeout_error.ts.out similarity index 100% rename from cli/tests/testdata/set_timeout_error.ts.out rename to cli/tests/testdata/run/set_timeout_error.ts.out diff --git a/cli/tests/testdata/set_timeout_error_handled.ts b/cli/tests/testdata/run/set_timeout_error_handled.ts similarity index 100% rename from cli/tests/testdata/set_timeout_error_handled.ts rename to cli/tests/testdata/run/set_timeout_error_handled.ts diff --git a/cli/tests/testdata/set_timeout_error_handled.ts.out b/cli/tests/testdata/run/set_timeout_error_handled.ts.out similarity index 100% rename from cli/tests/testdata/set_timeout_error_handled.ts.out rename to cli/tests/testdata/run/set_timeout_error_handled.ts.out diff --git a/cli/tests/testdata/shebang.ts b/cli/tests/testdata/run/shebang.ts similarity index 100% rename from cli/tests/testdata/shebang.ts rename to cli/tests/testdata/run/shebang.ts diff --git a/cli/tests/testdata/shebang.ts.out b/cli/tests/testdata/run/shebang.ts.out similarity index 100% rename from cli/tests/testdata/shebang.ts.out rename to cli/tests/testdata/run/shebang.ts.out diff --git a/cli/tests/testdata/shebang2.ts b/cli/tests/testdata/run/shebang2.ts similarity index 100% rename from cli/tests/testdata/shebang2.ts rename to cli/tests/testdata/run/shebang2.ts diff --git a/cli/tests/testdata/single_compile_with_reload.ts b/cli/tests/testdata/run/single_compile_with_reload.ts similarity index 100% rename from cli/tests/testdata/single_compile_with_reload.ts rename to cli/tests/testdata/run/single_compile_with_reload.ts diff --git a/cli/tests/testdata/single_compile_with_reload.ts.out b/cli/tests/testdata/run/single_compile_with_reload.ts.out similarity index 100% rename from cli/tests/testdata/single_compile_with_reload.ts.out rename to cli/tests/testdata/run/single_compile_with_reload.ts.out diff --git a/cli/tests/testdata/single_compile_with_reload_dyn.ts b/cli/tests/testdata/run/single_compile_with_reload_dyn.ts similarity index 65% rename from cli/tests/testdata/single_compile_with_reload_dyn.ts rename to cli/tests/testdata/run/single_compile_with_reload_dyn.ts index 0266bf46c7..6c96fac64c 100644 --- a/cli/tests/testdata/single_compile_with_reload_dyn.ts +++ b/cli/tests/testdata/run/single_compile_with_reload_dyn.ts @@ -1,4 +1,4 @@ -import { printHello3, returnsFoo2, returnsHi } from "./subdir/mod1.ts"; +import { printHello3, returnsFoo2, returnsHi } from "../subdir/mod1.ts"; printHello3(); diff --git a/cli/tests/testdata/single_compile_with_reload_worker.ts b/cli/tests/testdata/run/single_compile_with_reload_worker.ts similarity index 100% rename from cli/tests/testdata/single_compile_with_reload_worker.ts rename to cli/tests/testdata/run/single_compile_with_reload_worker.ts diff --git a/cli/tests/testdata/spawn_stdout_inherit.ts b/cli/tests/testdata/run/spawn_stdout_inherit.ts similarity index 100% rename from cli/tests/testdata/spawn_stdout_inherit.ts rename to cli/tests/testdata/run/spawn_stdout_inherit.ts diff --git a/cli/tests/testdata/spawn_stdout_inherit.ts.out b/cli/tests/testdata/run/spawn_stdout_inherit.ts.out similarity index 100% rename from cli/tests/testdata/spawn_stdout_inherit.ts.out rename to cli/tests/testdata/run/spawn_stdout_inherit.ts.out diff --git a/cli/tests/testdata/swc_syntax_error.ts b/cli/tests/testdata/run/swc_syntax_error.ts similarity index 100% rename from cli/tests/testdata/swc_syntax_error.ts rename to cli/tests/testdata/run/swc_syntax_error.ts diff --git a/cli/tests/testdata/swc_syntax_error.ts.out b/cli/tests/testdata/run/swc_syntax_error.ts.out similarity index 100% rename from cli/tests/testdata/swc_syntax_error.ts.out rename to cli/tests/testdata/run/swc_syntax_error.ts.out diff --git a/cli/tests/testdata/test_and_bench_in_run.js b/cli/tests/testdata/run/test_and_bench_in_run.js similarity index 100% rename from cli/tests/testdata/test_and_bench_in_run.js rename to cli/tests/testdata/run/test_and_bench_in_run.js diff --git a/cli/tests/testdata/tls.out b/cli/tests/testdata/run/tls.out similarity index 100% rename from cli/tests/testdata/tls.out rename to cli/tests/testdata/run/tls.out diff --git a/cli/tests/testdata/tls_connecttls.js b/cli/tests/testdata/run/tls_connecttls.js similarity index 85% rename from cli/tests/testdata/tls_connecttls.js rename to cli/tests/testdata/run/tls_connecttls.js index 1e8cf320cf..fb38399684 100644 --- a/cli/tests/testdata/tls_connecttls.js +++ b/cli/tests/testdata/run/tls_connecttls.js @@ -1,10 +1,10 @@ -import { deferred } from "../../../test_util/std/async/deferred.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"; +} 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/testdata/tls_starttls.js b/cli/tests/testdata/run/tls_starttls.js similarity index 86% rename from cli/tests/testdata/tls_starttls.js rename to cli/tests/testdata/run/tls_starttls.js index 9b8767eaac..7aa4365127 100644 --- a/cli/tests/testdata/tls_starttls.js +++ b/cli/tests/testdata/run/tls_starttls.js @@ -1,10 +1,10 @@ -import { deferred } from "../../../test_util/std/async/deferred.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"; +} 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/testdata/top_level_await_circular.js b/cli/tests/testdata/run/top_level_await/circular.js similarity index 100% rename from cli/tests/testdata/top_level_await_circular.js rename to cli/tests/testdata/run/top_level_await/circular.js diff --git a/cli/tests/testdata/top_level_await_circular.out b/cli/tests/testdata/run/top_level_await/circular.out similarity index 100% rename from cli/tests/testdata/top_level_await_circular.out rename to cli/tests/testdata/run/top_level_await/circular.out diff --git a/cli/tests/testdata/top_level_await_loop.js b/cli/tests/testdata/run/top_level_await/loop.js similarity index 64% rename from cli/tests/testdata/top_level_await_loop.js rename to cli/tests/testdata/run/top_level_await/loop.js index 384f8d0edd..415db5ec78 100644 --- a/cli/tests/testdata/top_level_await_loop.js +++ b/cli/tests/testdata/run/top_level_await/loop.js @@ -1,9 +1,11 @@ -const importsDir = Deno.readDirSync(Deno.realPathSync("./tla2")); +const importsDir = Deno.readDirSync( + Deno.realPathSync("./run/top_level_await/tla2"), +); const resolvedPaths = []; for (const { name } of importsDir) { - const filePath = Deno.realPathSync(`./tla2/${name}`); + const filePath = Deno.realPathSync(`./run/top_level_await/tla2/${name}`); resolvedPaths.push(filePath); } diff --git a/cli/tests/testdata/top_level_await_loop.out b/cli/tests/testdata/run/top_level_await/loop.out similarity index 100% rename from cli/tests/testdata/top_level_await_loop.out rename to cli/tests/testdata/run/top_level_await/loop.out diff --git a/cli/tests/testdata/top_level_await_nested.out b/cli/tests/testdata/run/top_level_await/nested.out similarity index 100% rename from cli/tests/testdata/top_level_await_nested.out rename to cli/tests/testdata/run/top_level_await/nested.out diff --git a/cli/tests/testdata/top_level_await_nested/a.js b/cli/tests/testdata/run/top_level_await/nested/a.js similarity index 100% rename from cli/tests/testdata/top_level_await_nested/a.js rename to cli/tests/testdata/run/top_level_await/nested/a.js diff --git a/cli/tests/testdata/top_level_await_nested/b.js b/cli/tests/testdata/run/top_level_await/nested/b.js similarity index 100% rename from cli/tests/testdata/top_level_await_nested/b.js rename to cli/tests/testdata/run/top_level_await/nested/b.js diff --git a/cli/tests/testdata/top_level_await_nested/main.js b/cli/tests/testdata/run/top_level_await/nested/main.js similarity index 100% rename from cli/tests/testdata/top_level_await_nested/main.js rename to cli/tests/testdata/run/top_level_await/nested/main.js diff --git a/cli/tests/testdata/top_level_await_order.js b/cli/tests/testdata/run/top_level_await/order.js similarity index 100% rename from cli/tests/testdata/top_level_await_order.js rename to cli/tests/testdata/run/top_level_await/order.js diff --git a/cli/tests/testdata/top_level_await_order.out b/cli/tests/testdata/run/top_level_await/order.out similarity index 100% rename from cli/tests/testdata/top_level_await_order.out rename to cli/tests/testdata/run/top_level_await/order.out diff --git a/cli/tests/testdata/tla/a.js b/cli/tests/testdata/run/top_level_await/tla/a.js similarity index 100% rename from cli/tests/testdata/tla/a.js rename to cli/tests/testdata/run/top_level_await/tla/a.js diff --git a/cli/tests/testdata/tla/b.js b/cli/tests/testdata/run/top_level_await/tla/b.js similarity index 100% rename from cli/tests/testdata/tla/b.js rename to cli/tests/testdata/run/top_level_await/tla/b.js diff --git a/cli/tests/testdata/tla/c.js b/cli/tests/testdata/run/top_level_await/tla/c.js similarity index 100% rename from cli/tests/testdata/tla/c.js rename to cli/tests/testdata/run/top_level_await/tla/c.js diff --git a/cli/tests/testdata/tla/d.js b/cli/tests/testdata/run/top_level_await/tla/d.js similarity index 100% rename from cli/tests/testdata/tla/d.js rename to cli/tests/testdata/run/top_level_await/tla/d.js diff --git a/cli/tests/testdata/tla/order.js b/cli/tests/testdata/run/top_level_await/tla/order.js similarity index 100% rename from cli/tests/testdata/tla/order.js rename to cli/tests/testdata/run/top_level_await/tla/order.js diff --git a/cli/tests/testdata/tla/parent.js b/cli/tests/testdata/run/top_level_await/tla/parent.js similarity index 100% rename from cli/tests/testdata/tla/parent.js rename to cli/tests/testdata/run/top_level_await/tla/parent.js diff --git a/cli/tests/testdata/tla2/a.js b/cli/tests/testdata/run/top_level_await/tla2/a.js similarity index 100% rename from cli/tests/testdata/tla2/a.js rename to cli/tests/testdata/run/top_level_await/tla2/a.js diff --git a/cli/tests/testdata/tla2/b.js b/cli/tests/testdata/run/top_level_await/tla2/b.js similarity index 100% rename from cli/tests/testdata/tla2/b.js rename to cli/tests/testdata/run/top_level_await/tla2/b.js diff --git a/cli/tests/testdata/tla3/b.js b/cli/tests/testdata/run/top_level_await/tla3/b.js similarity index 69% rename from cli/tests/testdata/tla3/b.js rename to cli/tests/testdata/run/top_level_await/tla3/b.js index b74c659e4f..d0349545e9 100644 --- a/cli/tests/testdata/tla3/b.js +++ b/cli/tests/testdata/run/top_level_await/tla3/b.js @@ -1,5 +1,5 @@ import { foo } from "./timeout_loop.js"; -import { collection } from "../top_level_await_circular.js"; +import { collection } from "../circular.js"; console.log("collection in b", collection); console.log("foo in b", foo); diff --git a/cli/tests/testdata/tla3/timeout_loop.js b/cli/tests/testdata/run/top_level_await/tla3/timeout_loop.js similarity index 100% rename from cli/tests/testdata/tla3/timeout_loop.js rename to cli/tests/testdata/run/top_level_await/tla3/timeout_loop.js diff --git a/cli/tests/testdata/top_level_await.js b/cli/tests/testdata/run/top_level_await/top_level_await.js similarity index 56% rename from cli/tests/testdata/top_level_await.js rename to cli/tests/testdata/run/top_level_await/top_level_await.js index af6fbd6622..ea319ea124 100644 --- a/cli/tests/testdata/top_level_await.js +++ b/cli/tests/testdata/run/top_level_await/top_level_await.js @@ -1,3 +1,3 @@ -const buf = await Deno.readFile("hello.txt"); +const buf = await Deno.readFile("./assets/hello.txt"); const n = await Deno.stdout.write(buf); console.log(`\n\nwrite ${n}`); diff --git a/cli/tests/testdata/top_level_await.out b/cli/tests/testdata/run/top_level_await/top_level_await.out similarity index 100% rename from cli/tests/testdata/top_level_await.out rename to cli/tests/testdata/run/top_level_await/top_level_await.out diff --git a/cli/tests/testdata/top_level_await.ts b/cli/tests/testdata/run/top_level_await/top_level_await.ts similarity index 54% rename from cli/tests/testdata/top_level_await.ts rename to cli/tests/testdata/run/top_level_await/top_level_await.ts index 65de253eae..8d47ceb21e 100644 --- a/cli/tests/testdata/top_level_await.ts +++ b/cli/tests/testdata/run/top_level_await/top_level_await.ts @@ -1,3 +1,3 @@ -const buf: Uint8Array = await Deno.readFile("hello.txt"); +const buf: Uint8Array = await Deno.readFile("./assets/hello.txt"); const n: number = await Deno.stdout.write(buf); console.log(`\n\nwrite ${n}`); diff --git a/cli/tests/testdata/top_level_for_await.js b/cli/tests/testdata/run/top_level_await/top_level_for_await.js similarity index 100% rename from cli/tests/testdata/top_level_for_await.js rename to cli/tests/testdata/run/top_level_await/top_level_for_await.js diff --git a/cli/tests/testdata/top_level_for_await.out b/cli/tests/testdata/run/top_level_await/top_level_for_await.out similarity index 100% rename from cli/tests/testdata/top_level_for_await.out rename to cli/tests/testdata/run/top_level_await/top_level_for_await.out diff --git a/cli/tests/testdata/top_level_for_await.ts b/cli/tests/testdata/run/top_level_await/top_level_for_await.ts similarity index 100% rename from cli/tests/testdata/top_level_for_await.ts rename to cli/tests/testdata/run/top_level_await/top_level_for_await.ts diff --git a/cli/tests/testdata/top_level_await_unresolved.js b/cli/tests/testdata/run/top_level_await/unresolved.js similarity index 100% rename from cli/tests/testdata/top_level_await_unresolved.js rename to cli/tests/testdata/run/top_level_await/unresolved.js diff --git a/cli/tests/testdata/top_level_await_unresolved.out b/cli/tests/testdata/run/top_level_await/unresolved.out similarity index 100% rename from cli/tests/testdata/top_level_await_unresolved.out rename to cli/tests/testdata/run/top_level_await/unresolved.out diff --git a/cli/tests/testdata/ts_decorators.ts b/cli/tests/testdata/run/ts_decorators.ts similarity index 100% rename from cli/tests/testdata/ts_decorators.ts rename to cli/tests/testdata/run/ts_decorators.ts diff --git a/cli/tests/testdata/ts_decorators.ts.out b/cli/tests/testdata/run/ts_decorators.ts.out similarity index 100% rename from cli/tests/testdata/ts_decorators.ts.out rename to cli/tests/testdata/run/ts_decorators.ts.out diff --git a/cli/tests/testdata/ts_import_from_js.deps.js b/cli/tests/testdata/run/ts_import_from_js/deps.js similarity index 67% rename from cli/tests/testdata/ts_import_from_js.deps.js rename to cli/tests/testdata/run/ts_import_from_js/deps.js index ef326c444b..746b5cf6b0 100644 --- a/cli/tests/testdata/ts_import_from_js.deps.js +++ b/cli/tests/testdata/run/ts_import_from_js/deps.js @@ -1,2 +1,2 @@ -import "./005_more_imports.ts"; +import "../005_more_imports.ts"; export { printHello } from "http://localhost:4545/subdir/mod2.ts"; diff --git a/cli/tests/testdata/run/ts_import_from_js/main.js b/cli/tests/testdata/run/ts_import_from_js/main.js new file mode 100644 index 0000000000..32d6c29a15 --- /dev/null +++ b/cli/tests/testdata/run/ts_import_from_js/main.js @@ -0,0 +1,3 @@ +import { printHello } from "./deps.js"; +printHello(); +console.log("success"); diff --git a/cli/tests/testdata/ts_import_from_js.js.out b/cli/tests/testdata/run/ts_import_from_js/main.out similarity index 100% rename from cli/tests/testdata/ts_import_from_js.js.out rename to cli/tests/testdata/run/ts_import_from_js/main.out diff --git a/cli/tests/testdata/ts_type_imports.ts b/cli/tests/testdata/run/ts_type_imports.ts similarity index 100% rename from cli/tests/testdata/ts_type_imports.ts rename to cli/tests/testdata/run/ts_type_imports.ts diff --git a/cli/tests/testdata/ts_type_imports.ts.out b/cli/tests/testdata/run/ts_type_imports.ts.out similarity index 100% rename from cli/tests/testdata/ts_type_imports.ts.out rename to cli/tests/testdata/run/ts_type_imports.ts.out diff --git a/cli/tests/testdata/ts_type_imports_foo.ts b/cli/tests/testdata/run/ts_type_imports_foo.ts similarity index 100% rename from cli/tests/testdata/ts_type_imports_foo.ts rename to cli/tests/testdata/run/ts_type_imports_foo.ts diff --git a/cli/tests/testdata/ts_type_only_import.d.ts b/cli/tests/testdata/run/ts_type_only_import.d.ts similarity index 100% rename from cli/tests/testdata/ts_type_only_import.d.ts rename to cli/tests/testdata/run/ts_type_only_import.d.ts diff --git a/cli/tests/testdata/ts_type_only_import.ts b/cli/tests/testdata/run/ts_type_only_import.ts similarity index 100% rename from cli/tests/testdata/ts_type_only_import.ts rename to cli/tests/testdata/run/ts_type_only_import.ts diff --git a/cli/tests/testdata/ts_type_only_import.ts.out b/cli/tests/testdata/run/ts_type_only_import.ts.out similarity index 100% rename from cli/tests/testdata/ts_type_only_import.ts.out rename to cli/tests/testdata/run/ts_type_only_import.ts.out diff --git a/cli/tests/testdata/run/tsx_imports/Component.tsx b/cli/tests/testdata/run/tsx_imports/Component.tsx new file mode 100644 index 0000000000..c466a28ca2 --- /dev/null +++ b/cli/tests/testdata/run/tsx_imports/Component.tsx @@ -0,0 +1 @@ +import "../046_jsx_test.tsx"; diff --git a/cli/tests/testdata/tsx_imports.ts b/cli/tests/testdata/run/tsx_imports/tsx_imports.ts similarity index 100% rename from cli/tests/testdata/tsx_imports.ts rename to cli/tests/testdata/run/tsx_imports/tsx_imports.ts diff --git a/cli/tests/testdata/tsx_imports.ts.out b/cli/tests/testdata/run/tsx_imports/tsx_imports.ts.out similarity index 100% rename from cli/tests/testdata/tsx_imports.ts.out rename to cli/tests/testdata/run/tsx_imports/tsx_imports.ts.out diff --git a/cli/tests/testdata/run/type_definitions.ts b/cli/tests/testdata/run/type_definitions.ts new file mode 100644 index 0000000000..5948427219 --- /dev/null +++ b/cli/tests/testdata/run/type_definitions.ts @@ -0,0 +1,12 @@ +// deno-lint-ignore-file + +// @deno-types="../type_definitions/foo.d.ts" +import { foo } from "../type_definitions/foo.js"; +// @deno-types="../type_definitions/fizz.d.ts" +import "../type_definitions/fizz.js"; + +import * as qat from "../type_definitions/qat.ts"; + +console.log(foo); +console.log(fizz); +console.log(qat.qat); diff --git a/cli/tests/testdata/type_definitions.ts.out b/cli/tests/testdata/run/type_definitions.ts.out similarity index 100% rename from cli/tests/testdata/type_definitions.ts.out rename to cli/tests/testdata/run/type_definitions.ts.out diff --git a/cli/tests/testdata/type_definitions_for_export.ts b/cli/tests/testdata/run/type_definitions_for_export.ts similarity index 100% rename from cli/tests/testdata/type_definitions_for_export.ts rename to cli/tests/testdata/run/type_definitions_for_export.ts diff --git a/cli/tests/testdata/type_definitions_for_export.ts.out b/cli/tests/testdata/run/type_definitions_for_export.ts.out similarity index 100% rename from cli/tests/testdata/type_definitions_for_export.ts.out rename to cli/tests/testdata/run/type_definitions_for_export.ts.out diff --git a/cli/tests/testdata/type_directives_01.ts b/cli/tests/testdata/run/type_directives_01.ts similarity index 100% rename from cli/tests/testdata/type_directives_01.ts rename to cli/tests/testdata/run/type_directives_01.ts diff --git a/cli/tests/testdata/type_directives_01.ts.out b/cli/tests/testdata/run/type_directives_01.ts.out similarity index 100% rename from cli/tests/testdata/type_directives_01.ts.out rename to cli/tests/testdata/run/type_directives_01.ts.out diff --git a/cli/tests/testdata/run/type_directives_02.ts b/cli/tests/testdata/run/type_directives_02.ts new file mode 100644 index 0000000000..0c59346e2b --- /dev/null +++ b/cli/tests/testdata/run/type_directives_02.ts @@ -0,0 +1,3 @@ +import * as foo from "../subdir/type_reference.js"; + +console.log(foo.foo); diff --git a/cli/tests/testdata/type_directives_02.ts.out b/cli/tests/testdata/run/type_directives_02.ts.out similarity index 100% rename from cli/tests/testdata/type_directives_02.ts.out rename to cli/tests/testdata/run/type_directives_02.ts.out diff --git a/cli/tests/testdata/run/type_directives_js_main.js b/cli/tests/testdata/run/type_directives_js_main.js new file mode 100644 index 0000000000..0c59346e2b --- /dev/null +++ b/cli/tests/testdata/run/type_directives_js_main.js @@ -0,0 +1,3 @@ +import * as foo from "../subdir/type_reference.js"; + +console.log(foo.foo); diff --git a/cli/tests/testdata/type_directives_js_main.js.out b/cli/tests/testdata/run/type_directives_js_main.js.out similarity index 100% rename from cli/tests/testdata/type_directives_js_main.js.out rename to cli/tests/testdata/run/type_directives_js_main.js.out diff --git a/cli/tests/testdata/run/type_directives_redirect.ts b/cli/tests/testdata/run/type_directives_redirect.ts new file mode 100644 index 0000000000..8b98831fdf --- /dev/null +++ b/cli/tests/testdata/run/type_directives_redirect.ts @@ -0,0 +1 @@ +import "http://localhost:4545/run/type_directives_redirect.js"; diff --git a/cli/tests/testdata/type_directives_redirect.ts.out b/cli/tests/testdata/run/type_directives_redirect.ts.out similarity index 100% rename from cli/tests/testdata/type_directives_redirect.ts.out rename to cli/tests/testdata/run/type_directives_redirect.ts.out diff --git a/cli/tests/testdata/type_headers_deno_types.ts b/cli/tests/testdata/run/type_headers_deno_types.ts similarity index 75% rename from cli/tests/testdata/type_headers_deno_types.ts rename to cli/tests/testdata/run/type_headers_deno_types.ts index 92391c666c..9670f68cd2 100644 --- a/cli/tests/testdata/type_headers_deno_types.ts +++ b/cli/tests/testdata/run/type_headers_deno_types.ts @@ -12,7 +12,7 @@ * header. */ -// @deno-types="http://127.0.0.1:4545/type_headers_deno_types.foo.d.ts" -import { foo } from "http://127.0.0.1:4545/type_headers_deno_types.foo.js"; +// @deno-types="http://127.0.0.1:4545/run/type_headers_deno_types.foo.d.ts" +import { foo } from "http://127.0.0.1:4545/run/type_headers_deno_types.foo.js"; foo("hello"); diff --git a/cli/tests/testdata/run/type_headers_deno_types.ts.out b/cli/tests/testdata/run/type_headers_deno_types.ts.out new file mode 100644 index 0000000000..798f983112 --- /dev/null +++ b/cli/tests/testdata/run/type_headers_deno_types.ts.out @@ -0,0 +1,5 @@ +Download http://[WILDCARD]:4545/run/type_headers_deno_types.foo.js +Download http://[WILDCARD]:4545/run/type_headers_deno_types.foo.d.ts +Download http://[WILDCARD]:4545/run/type_headers_deno_types.d.ts +Check [WILDCARD]/type_headers_deno_types.ts +hello diff --git a/cli/tests/testdata/unbuffered_stderr.ts b/cli/tests/testdata/run/unbuffered_stderr.ts similarity index 100% rename from cli/tests/testdata/unbuffered_stderr.ts rename to cli/tests/testdata/run/unbuffered_stderr.ts diff --git a/cli/tests/testdata/unbuffered_stderr.ts.out b/cli/tests/testdata/run/unbuffered_stderr.ts.out similarity index 100% rename from cli/tests/testdata/unbuffered_stderr.ts.out rename to cli/tests/testdata/run/unbuffered_stderr.ts.out diff --git a/cli/tests/testdata/unbuffered_stdout.ts b/cli/tests/testdata/run/unbuffered_stdout.ts similarity index 100% rename from cli/tests/testdata/unbuffered_stdout.ts rename to cli/tests/testdata/run/unbuffered_stdout.ts diff --git a/cli/tests/testdata/unbuffered_stdout.ts.out b/cli/tests/testdata/run/unbuffered_stdout.ts.out similarity index 100% rename from cli/tests/testdata/unbuffered_stdout.ts.out rename to cli/tests/testdata/run/unbuffered_stdout.ts.out diff --git a/cli/tests/testdata/unhandled_rejection.ts b/cli/tests/testdata/run/unhandled_rejection.ts similarity index 100% rename from cli/tests/testdata/unhandled_rejection.ts rename to cli/tests/testdata/run/unhandled_rejection.ts diff --git a/cli/tests/testdata/run/unhandled_rejection.ts.out b/cli/tests/testdata/run/unhandled_rejection.ts.out new file mode 100644 index 0000000000..6ab1667dc1 --- /dev/null +++ b/cli/tests/testdata/run/unhandled_rejection.ts.out @@ -0,0 +1,9 @@ +[WILDCARD] +unhandled rejection at: Promise { + Error: bar not available + at new Foo (file:///[WILDCARD]/testdata/run/unhandled_rejection.ts:8:20) + at file:///[WILDCARD]/testdata/run/unhandled_rejection.ts:12:1 +} reason: Error: bar not available + at new Foo (file:///[WILDCARD]/testdata/run/unhandled_rejection.ts:8:20) + at file:///[WILDCARD]/testdata/run/unhandled_rejection.ts:12:1 +unhandled rejection at: Promise { undefined } reason: undefined diff --git a/cli/tests/testdata/unhandled_rejection_sync_error.ts b/cli/tests/testdata/run/unhandled_rejection_sync_error.ts similarity index 100% rename from cli/tests/testdata/unhandled_rejection_sync_error.ts rename to cli/tests/testdata/run/unhandled_rejection_sync_error.ts diff --git a/cli/tests/testdata/run/unhandled_rejection_sync_error.ts.out b/cli/tests/testdata/run/unhandled_rejection_sync_error.ts.out new file mode 100644 index 0000000000..e178373f03 --- /dev/null +++ b/cli/tests/testdata/run/unhandled_rejection_sync_error.ts.out @@ -0,0 +1,6 @@ +[WILDCARD] +unhandled rejection at: Promise { + Error: boom! + at file:///[WILDCARD]testdata/run/unhandled_rejection_sync_error.ts:6:7 +} reason: Error: boom! + at file:///[WILDCARD]testdata/run/unhandled_rejection_sync_error.ts:6:7 diff --git a/cli/tests/testdata/unstable.js b/cli/tests/testdata/run/unstable.js similarity index 100% rename from cli/tests/testdata/unstable.js rename to cli/tests/testdata/run/unstable.js diff --git a/cli/tests/testdata/unstable.ts b/cli/tests/testdata/run/unstable.ts similarity index 100% rename from cli/tests/testdata/unstable.ts rename to cli/tests/testdata/run/unstable.ts diff --git a/cli/tests/testdata/unstable_disabled.out b/cli/tests/testdata/run/unstable_disabled.out similarity index 100% rename from cli/tests/testdata/unstable_disabled.out rename to cli/tests/testdata/run/unstable_disabled.out diff --git a/cli/tests/testdata/unstable_disabled_js.out b/cli/tests/testdata/run/unstable_disabled_js.out similarity index 100% rename from cli/tests/testdata/unstable_disabled_js.out rename to cli/tests/testdata/run/unstable_disabled_js.out diff --git a/cli/tests/testdata/unstable_enabled.out b/cli/tests/testdata/run/unstable_enabled.out similarity index 100% rename from cli/tests/testdata/unstable_enabled.out rename to cli/tests/testdata/run/unstable_enabled.out diff --git a/cli/tests/testdata/unstable_enabled_js.out b/cli/tests/testdata/run/unstable_enabled_js.out similarity index 100% rename from cli/tests/testdata/unstable_enabled_js.out rename to cli/tests/testdata/run/unstable_enabled_js.out diff --git a/cli/tests/testdata/unstable_worker.ts b/cli/tests/testdata/run/unstable_worker.ts similarity index 62% rename from cli/tests/testdata/unstable_worker.ts rename to cli/tests/testdata/run/unstable_worker.ts index f96de6c4ab..d111d2c7e3 100644 --- a/cli/tests/testdata/unstable_worker.ts +++ b/cli/tests/testdata/run/unstable_worker.ts @@ -1,5 +1,5 @@ const w = new Worker( - import.meta.resolve("./workers/worker_unstable.ts"), + import.meta.resolve("../workers/worker_unstable.ts"), { type: "module", name: "Unstable Worker" }, ); diff --git a/cli/tests/testdata/unstable_worker.ts.out b/cli/tests/testdata/run/unstable_worker.ts.out similarity index 100% rename from cli/tests/testdata/unstable_worker.ts.out rename to cli/tests/testdata/run/unstable_worker.ts.out diff --git a/cli/tests/testdata/unsupported_dynamic_import_scheme.out b/cli/tests/testdata/run/unsupported_dynamic_import_scheme.out similarity index 100% rename from cli/tests/testdata/unsupported_dynamic_import_scheme.out rename to cli/tests/testdata/run/unsupported_dynamic_import_scheme.out diff --git a/cli/tests/testdata/v8_flags.js b/cli/tests/testdata/run/v8_flags.js similarity index 100% rename from cli/tests/testdata/v8_flags.js rename to cli/tests/testdata/run/v8_flags.js diff --git a/cli/tests/testdata/v8_flags.js.out b/cli/tests/testdata/run/v8_flags.js.out similarity index 100% rename from cli/tests/testdata/v8_flags.js.out rename to cli/tests/testdata/run/v8_flags.js.out diff --git a/cli/tests/testdata/v8_flags_unrecognized.out b/cli/tests/testdata/run/v8_flags_unrecognized.out similarity index 100% rename from cli/tests/testdata/v8_flags_unrecognized.out rename to cli/tests/testdata/run/v8_flags_unrecognized.out diff --git a/cli/tests/testdata/v8_help.out b/cli/tests/testdata/run/v8_help.out similarity index 100% rename from cli/tests/testdata/v8_help.out rename to cli/tests/testdata/run/v8_help.out diff --git a/cli/tests/testdata/wasm.ts b/cli/tests/testdata/run/wasm.ts similarity index 100% rename from cli/tests/testdata/wasm.ts rename to cli/tests/testdata/run/wasm.ts diff --git a/cli/tests/testdata/wasm.ts.out b/cli/tests/testdata/run/wasm.ts.out similarity index 100% rename from cli/tests/testdata/wasm.ts.out rename to cli/tests/testdata/run/wasm.ts.out diff --git a/cli/tests/testdata/wasm_async.js b/cli/tests/testdata/run/wasm_async.js similarity index 100% rename from cli/tests/testdata/wasm_async.js rename to cli/tests/testdata/run/wasm_async.js diff --git a/cli/tests/testdata/wasm_async.out b/cli/tests/testdata/run/wasm_async.out similarity index 100% rename from cli/tests/testdata/wasm_async.out rename to cli/tests/testdata/run/wasm_async.out diff --git a/cli/tests/testdata/wasm_shared.out b/cli/tests/testdata/run/wasm_shared.out similarity index 100% rename from cli/tests/testdata/wasm_shared.out rename to cli/tests/testdata/run/wasm_shared.out diff --git a/cli/tests/testdata/wasm_shared.ts b/cli/tests/testdata/run/wasm_shared.ts similarity index 100% rename from cli/tests/testdata/wasm_shared.ts rename to cli/tests/testdata/run/wasm_shared.ts diff --git a/cli/tests/testdata/wasm_streaming_panic_test.js b/cli/tests/testdata/run/wasm_streaming_panic_test.js similarity index 100% rename from cli/tests/testdata/wasm_streaming_panic_test.js rename to cli/tests/testdata/run/wasm_streaming_panic_test.js diff --git a/cli/tests/testdata/wasm_streaming_panic_test.js.out b/cli/tests/testdata/run/wasm_streaming_panic_test.js.out similarity index 100% rename from cli/tests/testdata/wasm_streaming_panic_test.js.out rename to cli/tests/testdata/run/wasm_streaming_panic_test.js.out diff --git a/cli/tests/testdata/wasm_unreachable.js b/cli/tests/testdata/run/wasm_unreachable.js similarity index 82% rename from cli/tests/testdata/wasm_unreachable.js rename to cli/tests/testdata/run/wasm_unreachable.js index 36aab0d84f..d6a4f59dbc 100644 --- a/cli/tests/testdata/wasm_unreachable.js +++ b/cli/tests/testdata/run/wasm_unreachable.js @@ -1,5 +1,5 @@ // WebAssembly module containing a single function with an unreachable instruction -const binary = await Deno.readFile("./unreachable.wasm"); +const binary = await Deno.readFile("./assets/unreachable.wasm"); const module = new WebAssembly.Module(binary); const instance = new WebAssembly.Instance(module); diff --git a/cli/tests/testdata/wasm_unreachable.out b/cli/tests/testdata/run/wasm_unreachable.out similarity index 100% rename from cli/tests/testdata/wasm_unreachable.out rename to cli/tests/testdata/run/wasm_unreachable.out diff --git a/cli/tests/testdata/wasm_url.js b/cli/tests/testdata/run/wasm_url.js similarity index 81% rename from cli/tests/testdata/wasm_url.js rename to cli/tests/testdata/run/wasm_url.js index bb7ccd73df..71686ef7e1 100644 --- a/cli/tests/testdata/wasm_url.js +++ b/cli/tests/testdata/run/wasm_url.js @@ -1,5 +1,5 @@ const module = await WebAssembly.compileStreaming( - fetch("http://localhost:4545/unreachable.wasm"), + fetch("http://localhost:4545/assets/unreachable.wasm"), ); const instance = new WebAssembly.Instance(module); diff --git a/cli/tests/testdata/wasm_url.out b/cli/tests/testdata/run/wasm_url.out similarity index 57% rename from cli/tests/testdata/wasm_url.out rename to cli/tests/testdata/run/wasm_url.out index c88b51020a..ae3bf491ae 100644 --- a/cli/tests/testdata/wasm_url.out +++ b/cli/tests/testdata/run/wasm_url.out @@ -1,3 +1,3 @@ error: Uncaught (in promise) RuntimeError: unreachable - at (http://localhost:4545/unreachable.wasm:1:41) + at (http://localhost:4545/assets/unreachable.wasm:1:41) at [WILDCARD]/wasm_url.js:[WILDCARD] diff --git a/cli/tests/testdata/weakref.ts b/cli/tests/testdata/run/weakref.ts similarity index 100% rename from cli/tests/testdata/weakref.ts rename to cli/tests/testdata/run/weakref.ts diff --git a/cli/tests/testdata/weakref.ts.out b/cli/tests/testdata/run/weakref.ts.out similarity index 100% rename from cli/tests/testdata/weakref.ts.out rename to cli/tests/testdata/run/weakref.ts.out diff --git a/cli/tests/testdata/websocket_server_idletimeout.ts b/cli/tests/testdata/run/websocket_server_idletimeout.ts similarity index 100% rename from cli/tests/testdata/websocket_server_idletimeout.ts rename to cli/tests/testdata/run/websocket_server_idletimeout.ts diff --git a/cli/tests/testdata/websocket_server_multi_field_connection_header_test.ts b/cli/tests/testdata/run/websocket_server_multi_field_connection_header_test.ts similarity index 89% rename from cli/tests/testdata/websocket_server_multi_field_connection_header_test.ts rename to cli/tests/testdata/run/websocket_server_multi_field_connection_header_test.ts index a662ce9ef1..709419a6a3 100644 --- a/cli/tests/testdata/websocket_server_multi_field_connection_header_test.ts +++ b/cli/tests/testdata/run/websocket_server_multi_field_connection_header_test.ts @@ -1,4 +1,4 @@ -import { deferred } from "../unit/test_util.ts"; +import { deferred } from "../../unit/test_util.ts"; const promise = deferred(); const listener = Deno.listen({ port: 4319 }); diff --git a/cli/tests/testdata/websocket_test.ts b/cli/tests/testdata/run/websocket_test.ts similarity index 98% rename from cli/tests/testdata/websocket_test.ts rename to cli/tests/testdata/run/websocket_test.ts index 1572e0e67f..e557a3cb27 100644 --- a/cli/tests/testdata/websocket_test.ts +++ b/cli/tests/testdata/run/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/testdata/websocketstream_ping_test.ts b/cli/tests/testdata/run/websocketstream_ping_test.ts similarity index 100% rename from cli/tests/testdata/websocketstream_ping_test.ts rename to cli/tests/testdata/run/websocketstream_ping_test.ts diff --git a/cli/tests/testdata/websocketstream_test.ts b/cli/tests/testdata/run/websocketstream_test.ts similarity index 99% rename from cli/tests/testdata/websocketstream_test.ts rename to cli/tests/testdata/run/websocketstream_test.ts index 71969314ec..74d8e5d9a1 100644 --- a/cli/tests/testdata/websocketstream_test.ts +++ b/cli/tests/testdata/run/websocketstream_test.ts @@ -7,7 +7,7 @@ import { assertRejects, assertThrows, unreachable, -} 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/testdata/webstorage/config_a.jsonc b/cli/tests/testdata/run/webstorage/config_a.jsonc similarity index 100% rename from cli/tests/testdata/webstorage/config_a.jsonc rename to cli/tests/testdata/run/webstorage/config_a.jsonc diff --git a/cli/tests/testdata/webstorage/config_b.jsonc b/cli/tests/testdata/run/webstorage/config_b.jsonc similarity index 100% rename from cli/tests/testdata/webstorage/config_b.jsonc rename to cli/tests/testdata/run/webstorage/config_b.jsonc diff --git a/cli/tests/testdata/webstorage/fixture.ts b/cli/tests/testdata/run/webstorage/fixture.ts similarity index 100% rename from cli/tests/testdata/webstorage/fixture.ts rename to cli/tests/testdata/run/webstorage/fixture.ts diff --git a/cli/tests/testdata/webstorage/logger.ts b/cli/tests/testdata/run/webstorage/logger.ts similarity index 100% rename from cli/tests/testdata/webstorage/logger.ts rename to cli/tests/testdata/run/webstorage/logger.ts diff --git a/cli/tests/testdata/webstorage/serialization.ts b/cli/tests/testdata/run/webstorage/serialization.ts similarity index 100% rename from cli/tests/testdata/webstorage/serialization.ts rename to cli/tests/testdata/run/webstorage/serialization.ts diff --git a/cli/tests/testdata/webstorage/serialization.ts.out b/cli/tests/testdata/run/webstorage/serialization.ts.out similarity index 100% rename from cli/tests/testdata/webstorage/serialization.ts.out rename to cli/tests/testdata/run/webstorage/serialization.ts.out diff --git a/cli/tests/testdata/webstorage/setter.ts b/cli/tests/testdata/run/webstorage/setter.ts similarity index 100% rename from cli/tests/testdata/webstorage/setter.ts rename to cli/tests/testdata/run/webstorage/setter.ts diff --git a/cli/tests/testdata/worker_close_in_wasm_reactions.js b/cli/tests/testdata/run/worker_close_in_wasm_reactions.js similarity index 80% rename from cli/tests/testdata/worker_close_in_wasm_reactions.js rename to cli/tests/testdata/run/worker_close_in_wasm_reactions.js index ed57fa053a..8238aaa148 100644 --- a/cli/tests/testdata/worker_close_in_wasm_reactions.js +++ b/cli/tests/testdata/run/worker_close_in_wasm_reactions.js @@ -5,6 +5,6 @@ // WASM async operation. new Worker( - import.meta.resolve("./workers/close_in_wasm_reactions.js"), + import.meta.resolve("../workers/close_in_wasm_reactions.js"), { type: "module" }, ); diff --git a/cli/tests/testdata/worker_close_in_wasm_reactions.js.out b/cli/tests/testdata/run/worker_close_in_wasm_reactions.js.out similarity index 100% rename from cli/tests/testdata/worker_close_in_wasm_reactions.js.out rename to cli/tests/testdata/run/worker_close_in_wasm_reactions.js.out diff --git a/cli/tests/testdata/worker_close_nested.js b/cli/tests/testdata/run/worker_close_nested.js similarity index 89% rename from cli/tests/testdata/worker_close_nested.js rename to cli/tests/testdata/run/worker_close_nested.js index 865022faad..b39dfd4c0b 100644 --- a/cli/tests/testdata/worker_close_nested.js +++ b/cli/tests/testdata/run/worker_close_nested.js @@ -6,7 +6,7 @@ console.log("Starting the main thread"); const worker = new Worker( - import.meta.resolve("./workers/close_nested_parent.js"), + import.meta.resolve("../workers/close_nested_parent.js"), { type: "module" }, ); diff --git a/cli/tests/testdata/worker_close_nested.js.out b/cli/tests/testdata/run/worker_close_nested.js.out similarity index 100% rename from cli/tests/testdata/worker_close_nested.js.out rename to cli/tests/testdata/run/worker_close_nested.js.out diff --git a/cli/tests/testdata/worker_close_race.js b/cli/tests/testdata/run/worker_close_race.js similarity index 85% rename from cli/tests/testdata/worker_close_race.js rename to cli/tests/testdata/run/worker_close_race.js index ff2b0eb8f9..1b369c5d3f 100644 --- a/cli/tests/testdata/worker_close_race.js +++ b/cli/tests/testdata/run/worker_close_race.js @@ -5,7 +5,7 @@ // `Worker.prototype.terminate()`. const worker = new Worker( - import.meta.resolve("./workers/close_race_worker.js"), + import.meta.resolve("../workers/close_race_worker.js"), { type: "module" }, ); diff --git a/cli/tests/testdata/worker_close_race.js.out b/cli/tests/testdata/run/worker_close_race.js.out similarity index 100% rename from cli/tests/testdata/worker_close_race.js.out rename to cli/tests/testdata/run/worker_close_race.js.out diff --git a/cli/tests/testdata/worker_drop_handle_race.js b/cli/tests/testdata/run/worker_drop_handle_race.js similarity index 88% rename from cli/tests/testdata/worker_drop_handle_race.js rename to cli/tests/testdata/run/worker_drop_handle_race.js index 78f2d6cab2..5ad918314a 100644 --- a/cli/tests/testdata/worker_drop_handle_race.js +++ b/cli/tests/testdata/run/worker_drop_handle_race.js @@ -7,6 +7,6 @@ // The exception thrown in the worker will not terminate the worker, but it will // propagate to the main thread and cause it to exit. new Worker( - import.meta.resolve("./workers/drop_handle_race.js"), + import.meta.resolve("../workers/drop_handle_race.js"), { type: "module" }, ); diff --git a/cli/tests/testdata/worker_drop_handle_race.js.out b/cli/tests/testdata/run/worker_drop_handle_race.js.out similarity index 100% rename from cli/tests/testdata/worker_drop_handle_race.js.out rename to cli/tests/testdata/run/worker_drop_handle_race.js.out diff --git a/cli/tests/testdata/worker_drop_handle_race_terminate.js b/cli/tests/testdata/run/worker_drop_handle_race_terminate.js similarity index 100% rename from cli/tests/testdata/worker_drop_handle_race_terminate.js rename to cli/tests/testdata/run/worker_drop_handle_race_terminate.js diff --git a/cli/tests/testdata/worker_drop_handle_race_terminate.js.out b/cli/tests/testdata/run/worker_drop_handle_race_terminate.js.out similarity index 100% rename from cli/tests/testdata/worker_drop_handle_race_terminate.js.out rename to cli/tests/testdata/run/worker_drop_handle_race_terminate.js.out diff --git a/cli/tests/testdata/worker_event_handler_test.js b/cli/tests/testdata/run/worker_event_handler_test.js similarity index 51% rename from cli/tests/testdata/worker_event_handler_test.js rename to cli/tests/testdata/run/worker_event_handler_test.js index c4e816a4d9..a91b0ec0b1 100644 --- a/cli/tests/testdata/worker_event_handler_test.js +++ b/cli/tests/testdata/run/worker_event_handler_test.js @@ -1,5 +1,5 @@ const w = new Worker( - import.meta.resolve("./workers/worker_event_handlers.js"), + import.meta.resolve("../workers/worker_event_handlers.js"), { type: "module" }, ); w.postMessage({}); diff --git a/cli/tests/testdata/worker_event_handler_test.js.out b/cli/tests/testdata/run/worker_event_handler_test.js.out similarity index 100% rename from cli/tests/testdata/worker_event_handler_test.js.out rename to cli/tests/testdata/run/worker_event_handler_test.js.out diff --git a/cli/tests/testdata/worker_message_before_close.js b/cli/tests/testdata/run/worker_message_before_close.js similarity index 89% rename from cli/tests/testdata/worker_message_before_close.js rename to cli/tests/testdata/run/worker_message_before_close.js index a5769af604..569388b9bb 100644 --- a/cli/tests/testdata/worker_message_before_close.js +++ b/cli/tests/testdata/run/worker_message_before_close.js @@ -2,7 +2,7 @@ const messagesReceived = new Set(); for (let i = 0; i < 4; i++) { const worker = new Worker( - import.meta.resolve("./workers/message_before_close.js"), + import.meta.resolve("../workers/message_before_close.js"), { type: "module", name: String(i) }, ); diff --git a/cli/tests/testdata/worker_message_before_close.js.out b/cli/tests/testdata/run/worker_message_before_close.js.out similarity index 100% rename from cli/tests/testdata/worker_message_before_close.js.out rename to cli/tests/testdata/run/worker_message_before_close.js.out diff --git a/cli/tests/testdata/esm_imports_a.js b/cli/tests/testdata/runtime/esm_imports_a.js similarity index 100% rename from cli/tests/testdata/esm_imports_a.js rename to cli/tests/testdata/runtime/esm_imports_a.js diff --git a/cli/tests/testdata/esm_imports_b.js b/cli/tests/testdata/runtime/esm_imports_b.js similarity index 100% rename from cli/tests/testdata/esm_imports_b.js rename to cli/tests/testdata/runtime/esm_imports_b.js diff --git a/cli/tests/testdata/standalone_dynamic_imports.ts b/cli/tests/testdata/standalone_dynamic_imports.ts deleted file mode 100644 index d4dc551524..0000000000 --- a/cli/tests/testdata/standalone_dynamic_imports.ts +++ /dev/null @@ -1,15 +0,0 @@ -(async () => { - const { returnsHi, returnsFoo2, printHello3 } = await import( - "./subdir/mod1.ts" - ); - - printHello3(); - - if (returnsHi() !== "Hi") { - throw Error("Unexpected"); - } - - if (returnsFoo2() !== "Foo") { - throw Error("Unexpected"); - } -})(); diff --git a/cli/tests/testdata/standalone_import.ts b/cli/tests/testdata/standalone_import.ts deleted file mode 100644 index 804102a535..0000000000 --- a/cli/tests/testdata/standalone_import.ts +++ /dev/null @@ -1,2 +0,0 @@ -console.log("start"); -await import("./001_hello.js"); diff --git a/cli/tests/testdata/standalone_import_map.json b/cli/tests/testdata/standalone_import_map.json deleted file mode 100644 index 6f978d6bec..0000000000 --- a/cli/tests/testdata/standalone_import_map.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "imports": { - "hello": "./001_hello.js" - } -} diff --git a/cli/tests/testdata/std_lint.out b/cli/tests/testdata/std_lint.out deleted file mode 100644 index 9d62fcc674..0000000000 --- a/cli/tests/testdata/std_lint.out +++ /dev/null @@ -1,3 +0,0 @@ -[WILDCARD] - -Found [WILDCARD] problems \ No newline at end of file diff --git a/cli/tests/testdata/test/resource_sanitizer.ts b/cli/tests/testdata/test/resource_sanitizer.ts index c1291b89a6..93c9222c51 100644 --- a/cli/tests/testdata/test/resource_sanitizer.ts +++ b/cli/tests/testdata/test/resource_sanitizer.ts @@ -1,4 +1,4 @@ Deno.test("leak", function () { - Deno.openSync("001_hello.js"); + Deno.openSync("run/001_hello.js"); Deno.stdin.close(); }); diff --git a/cli/tests/testdata/ts_import_from_js.js b/cli/tests/testdata/ts_import_from_js.js deleted file mode 100644 index f912c27234..0000000000 --- a/cli/tests/testdata/ts_import_from_js.js +++ /dev/null @@ -1,3 +0,0 @@ -import { printHello } from "./ts_import_from_js.deps.js"; -printHello(); -console.log("success"); diff --git a/cli/tests/testdata/ts_with_generic.ts b/cli/tests/testdata/ts_with_generic.ts deleted file mode 100644 index 1e3591f40f..0000000000 --- a/cli/tests/testdata/ts_with_generic.ts +++ /dev/null @@ -1,3 +0,0 @@ -// deno-lint-ignore-file - -const foo = { delete() {} }; diff --git a/cli/tests/testdata/type_definitions.ts b/cli/tests/testdata/type_definitions.ts deleted file mode 100644 index a1bb37a65d..0000000000 --- a/cli/tests/testdata/type_definitions.ts +++ /dev/null @@ -1,12 +0,0 @@ -// deno-lint-ignore-file - -// @deno-types="./type_definitions/foo.d.ts" -import { foo } from "./type_definitions/foo.js"; -// @deno-types="./type_definitions/fizz.d.ts" -import "./type_definitions/fizz.js"; - -import * as qat from "./type_definitions/qat.ts"; - -console.log(foo); -console.log(fizz); -console.log(qat.qat); diff --git a/cli/tests/testdata/type_directives_02.ts b/cli/tests/testdata/type_directives_02.ts deleted file mode 100644 index f7274bf26d..0000000000 --- a/cli/tests/testdata/type_directives_02.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as foo from "./subdir/type_reference.js"; - -console.log(foo.foo); diff --git a/cli/tests/testdata/type_directives_js_main.js b/cli/tests/testdata/type_directives_js_main.js deleted file mode 100644 index f7274bf26d..0000000000 --- a/cli/tests/testdata/type_directives_js_main.js +++ /dev/null @@ -1,3 +0,0 @@ -import * as foo from "./subdir/type_reference.js"; - -console.log(foo.foo); diff --git a/cli/tests/testdata/type_directives_redirect.ts b/cli/tests/testdata/type_directives_redirect.ts deleted file mode 100644 index 1756d5af9d..0000000000 --- a/cli/tests/testdata/type_directives_redirect.ts +++ /dev/null @@ -1 +0,0 @@ -import "http://localhost:4545/type_directives_redirect.js"; diff --git a/cli/tests/testdata/type_headers_deno_types.ts.out b/cli/tests/testdata/type_headers_deno_types.ts.out deleted file mode 100644 index f1e4ca1f87..0000000000 --- a/cli/tests/testdata/type_headers_deno_types.ts.out +++ /dev/null @@ -1,5 +0,0 @@ -Download http://[WILDCARD]:4545/type_headers_deno_types.foo.js -Download http://[WILDCARD]:4545/type_headers_deno_types.foo.d.ts -Download http://[WILDCARD]:4545/type_headers_deno_types.d.ts -Check [WILDCARD]/type_headers_deno_types.ts -hello diff --git a/cli/tests/testdata/types.out b/cli/tests/testdata/types/types.out similarity index 100% rename from cli/tests/testdata/types.out rename to cli/tests/testdata/types/types.out diff --git a/cli/tests/testdata/unhandled_rejection.ts.out b/cli/tests/testdata/unhandled_rejection.ts.out deleted file mode 100644 index 6addab20a9..0000000000 --- a/cli/tests/testdata/unhandled_rejection.ts.out +++ /dev/null @@ -1,9 +0,0 @@ -[WILDCARD] -unhandled rejection at: Promise { - Error: bar not available - at new Foo (file:///[WILDCARD]/testdata/unhandled_rejection.ts:8:20) - at file:///[WILDCARD]/testdata/unhandled_rejection.ts:12:1 -} reason: Error: bar not available - at new Foo (file:///[WILDCARD]/testdata/unhandled_rejection.ts:8:20) - at file:///[WILDCARD]/testdata/unhandled_rejection.ts:12:1 -unhandled rejection at: Promise { undefined } reason: undefined diff --git a/cli/tests/testdata/unhandled_rejection_sync_error.ts.out b/cli/tests/testdata/unhandled_rejection_sync_error.ts.out deleted file mode 100644 index 2703198248..0000000000 --- a/cli/tests/testdata/unhandled_rejection_sync_error.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -[WILDCARD] -unhandled rejection at: Promise { - Error: boom! - at file:///[WILDCARD]testdata/unhandled_rejection_sync_error.ts:6:7 -} reason: Error: boom! - at file:///[WILDCARD]testdata/unhandled_rejection_sync_error.ts:6:7 diff --git a/cli/tests/testdata/webgpu_computepass_shader.wgsl b/cli/tests/testdata/webgpu/computepass_shader.wgsl similarity index 100% rename from cli/tests/testdata/webgpu_computepass_shader.wgsl rename to cli/tests/testdata/webgpu/computepass_shader.wgsl diff --git a/cli/tests/testdata/webgpu_hellotriangle.out b/cli/tests/testdata/webgpu/hellotriangle.out similarity index 100% rename from cli/tests/testdata/webgpu_hellotriangle.out rename to cli/tests/testdata/webgpu/hellotriangle.out diff --git a/cli/tests/testdata/webgpu_hellotriangle_shader.wgsl b/cli/tests/testdata/webgpu/hellotriangle_shader.wgsl similarity index 100% rename from cli/tests/testdata/webgpu_hellotriangle_shader.wgsl rename to cli/tests/testdata/webgpu/hellotriangle_shader.wgsl diff --git a/cli/tests/testdata/084_worker_custom_inspect.ts.out b/cli/tests/testdata/workers/custom_inspect/main.out similarity index 100% rename from cli/tests/testdata/084_worker_custom_inspect.ts.out rename to cli/tests/testdata/workers/custom_inspect/main.out diff --git a/cli/tests/testdata/workers/custom_inspect/main.ts b/cli/tests/testdata/workers/custom_inspect/main.ts new file mode 100644 index 0000000000..93d4eec2d5 --- /dev/null +++ b/cli/tests/testdata/workers/custom_inspect/main.ts @@ -0,0 +1,4 @@ +new Worker( + import.meta.resolve("./worker.ts"), + { type: "module" }, +); diff --git a/cli/tests/testdata/084_worker_custom_inspect_worker.ts b/cli/tests/testdata/workers/custom_inspect/worker.ts similarity index 100% rename from cli/tests/testdata/084_worker_custom_inspect_worker.ts rename to cli/tests/testdata/workers/custom_inspect/worker.ts diff --git a/cli/tests/testdata/workers/error_worker_permissions_local.ts b/cli/tests/testdata/workers/error_worker_permissions_local.ts new file mode 100644 index 0000000000..1a4b4c0a95 --- /dev/null +++ b/cli/tests/testdata/workers/error_worker_permissions_local.ts @@ -0,0 +1,4 @@ +new Worker( + import.meta.resolve("../subdir/worker_types.ts"), + { type: "module" }, +); diff --git a/cli/tests/testdata/error_worker_permissions_local.ts.out b/cli/tests/testdata/workers/error_worker_permissions_local.ts.out similarity index 100% rename from cli/tests/testdata/error_worker_permissions_local.ts.out rename to cli/tests/testdata/workers/error_worker_permissions_local.ts.out diff --git a/cli/tests/testdata/error_worker_permissions_remote.ts b/cli/tests/testdata/workers/error_worker_permissions_remote.ts similarity index 100% rename from cli/tests/testdata/error_worker_permissions_remote.ts rename to cli/tests/testdata/workers/error_worker_permissions_remote.ts diff --git a/cli/tests/testdata/error_worker_permissions_remote.ts.out b/cli/tests/testdata/workers/error_worker_permissions_remote.ts.out similarity index 100% rename from cli/tests/testdata/error_worker_permissions_remote.ts.out rename to cli/tests/testdata/workers/error_worker_permissions_remote.ts.out diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts index cbb2cd6809..096ea5ab07 100644 --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -93,40 +93,40 @@ Deno.test( ); Deno.test({ permissions: { net: true } }, async function fetchJsonSuccess() { - const response = await fetch("http://localhost:4545/fixture.json"); + const response = await fetch("http://localhost:4545/assets/fixture.json"); const json = await response.json(); assertEquals(json.name, "deno"); }); Deno.test({ permissions: { net: false } }, async function fetchPerm() { await assertRejects(async () => { - await fetch("http://localhost:4545/fixture.json"); + await fetch("http://localhost:4545/assets/fixture.json"); }, Deno.errors.PermissionDenied); }); Deno.test({ permissions: { net: true } }, async function fetchUrl() { - const response = await fetch("http://localhost:4545/fixture.json"); - assertEquals(response.url, "http://localhost:4545/fixture.json"); + const response = await fetch("http://localhost:4545/assets/fixture.json"); + assertEquals(response.url, "http://localhost:4545/assets/fixture.json"); const _json = await response.json(); }); Deno.test({ permissions: { net: true } }, async function fetchURL() { const response = await fetch( - new URL("http://localhost:4545/fixture.json"), + new URL("http://localhost:4545/assets/fixture.json"), ); - assertEquals(response.url, "http://localhost:4545/fixture.json"); + assertEquals(response.url, "http://localhost:4545/assets/fixture.json"); const _json = await response.json(); }); Deno.test({ permissions: { net: true } }, async function fetchHeaders() { - const response = await fetch("http://localhost:4545/fixture.json"); + const response = await fetch("http://localhost:4545/assets/fixture.json"); const headers = response.headers; assertEquals(headers.get("Content-Type"), "application/json"); const _json = await response.json(); }); Deno.test({ permissions: { net: true } }, async function fetchBlob() { - const response = await fetch("http://localhost:4545/fixture.json"); + const response = await fetch("http://localhost:4545/assets/fixture.json"); const headers = response.headers; const blob = await response.blob(); assertEquals(blob.type, headers.get("Content-Type")); @@ -137,7 +137,7 @@ Deno.test( { permissions: { net: true } }, async function fetchBodyUsedReader() { const response = await fetch( - "http://localhost:4545/fixture.json", + "http://localhost:4545/assets/fixture.json", ); assert(response.body !== null); @@ -155,7 +155,7 @@ Deno.test( { permissions: { net: true } }, async function fetchBodyUsedCancelStream() { const response = await fetch( - "http://localhost:4545/fixture.json", + "http://localhost:4545/assets/fixture.json", ); assert(response.body !== null); @@ -167,7 +167,7 @@ Deno.test( ); Deno.test({ permissions: { net: true } }, async function fetchAsyncIterator() { - const response = await fetch("http://localhost:4545/fixture.json"); + const response = await fetch("http://localhost:4545/assets/fixture.json"); const headers = response.headers; assert(response.body !== null); @@ -181,7 +181,7 @@ Deno.test({ permissions: { net: true } }, async function fetchAsyncIterator() { }); Deno.test({ permissions: { net: true } }, async function fetchBodyReader() { - const response = await fetch("http://localhost:4545/fixture.json"); + const response = await fetch("http://localhost:4545/assets/fixture.json"); const headers = response.headers; assert(response.body !== null); const reader = response.body.getReader(); @@ -220,7 +220,7 @@ Deno.test( ); Deno.test({ permissions: { net: true } }, async function responseClone() { - const response = await fetch("http://localhost:4545/fixture.json"); + const response = await fetch("http://localhost:4545/assets/fixture.json"); const response1 = response.clone(); assert(response !== response1); assertEquals(response.status, response1.status); @@ -359,10 +359,10 @@ Deno.test( permissions: { net: true }, }, async function fetchWithRedirection() { - const response = await fetch("http://localhost:4546/hello.txt"); + const response = await fetch("http://localhost:4546/assets/hello.txt"); assertEquals(response.status, 200); assertEquals(response.statusText, "OK"); - assertEquals(response.url, "http://localhost:4545/hello.txt"); + assertEquals(response.url, "http://localhost:4545/assets/hello.txt"); const body = await response.text(); assert(body.includes("Hello world!")); }, @@ -374,7 +374,7 @@ Deno.test( }, async function fetchWithRelativeRedirection() { const response = await fetch( - "http://localhost:4545/001_hello.js", + "http://localhost:4545/run/001_hello.js", ); assertEquals(response.status, 200); assertEquals(response.statusText, "OK"); @@ -449,7 +449,7 @@ Deno.test( { permissions: { net: true } }, async function fetchSeparateInit() { // related to: https://github.com/denoland/deno/issues/10396 - const req = new Request("http://localhost:4545/001_hello.js"); + const req = new Request("http://localhost:4545/run/001_hello.js"); const init = { method: "GET", }; @@ -901,7 +901,7 @@ Deno.test(async function responseWithoutBody() { }); Deno.test({ permissions: { net: true } }, async function fetchBodyReadTwice() { - const response = await fetch("http://localhost:4545/fixture.json"); + const response = await fetch("http://localhost:4545/assets/fixture.json"); // Read body const _json = await response.json(); @@ -925,7 +925,7 @@ Deno.test( { permissions: { net: true } }, async function fetchBodyReaderAfterRead() { const response = await fetch( - "http://localhost:4545/fixture.json", + "http://localhost:4545/assets/fixture.json", ); assert(response.body !== null); const reader = await response.body.getReader(); @@ -1005,7 +1005,7 @@ Deno.test( Deno.test( { permissions: { net: true } }, async function fetchResourceCloseAfterStreamCancel() { - const res = await fetch("http://localhost:4545/fixture.json"); + const res = await fetch("http://localhost:4545/assets/fixture.json"); assert(res.body !== null); // After ReadableStream.cancel is called, resource handle must be closed @@ -1113,7 +1113,7 @@ Deno.test( > { const caCert = Deno.readTextFileSync("cli/tests/testdata/tls/RootCA.pem"); const client = Deno.createHttpClient({ caCerts: [caCert] }); - const response = await fetch("https://localhost:5545/fixture.json", { + const response = await fetch("https://localhost:5545/assets/fixture.json", { client, }); const json = await response.json(); @@ -1286,7 +1286,7 @@ Deno.test( "cli/tests/testdata/tls/localhost.key", ), }); - await fetch("https://localhost:5552/fixture.json", { + await fetch("https://localhost:5552/assets/fixture.json", { client, }); }, Deno.errors.InvalidData); @@ -1303,7 +1303,7 @@ Deno.test( ), privateKey: "bad data", }); - await fetch("https://localhost:5552/fixture.json", { + await fetch("https://localhost:5552/assets/fixture.json", { client, }); }, Deno.errors.InvalidData); @@ -1320,7 +1320,7 @@ Deno.test( ), privateKey: "", }); - await fetch("https://localhost:5552/fixture.json", { + await fetch("https://localhost:5552/assets/fixture.json", { client, }); }, Deno.errors.InvalidData); diff --git a/cli/tests/unit/files_test.ts b/cli/tests/unit/files_test.ts index d15f1f5385..bb095072ce 100644 --- a/cli/tests/unit/files_test.ts +++ b/cli/tests/unit/files_test.ts @@ -17,7 +17,7 @@ Deno.test(function filesStdioFileDescriptors() { }); Deno.test({ permissions: { read: true } }, async function filesCopyToStdout() { - const filename = "cli/tests/testdata/fixture.json"; + const filename = "cli/tests/testdata/assets/fixture.json"; const file = await Deno.open(filename); assert(file.rid > 2); const bytesWritten = await copy(file, Deno.stdout); @@ -27,7 +27,7 @@ Deno.test({ permissions: { read: true } }, async function filesCopyToStdout() { }); Deno.test({ permissions: { read: true } }, async function filesIter() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = await Deno.open(filename); let totalSize = 0; @@ -42,7 +42,7 @@ Deno.test({ permissions: { read: true } }, async function filesIter() { Deno.test( { permissions: { read: true } }, async function filesIterCustomBufSize() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = await Deno.open(filename); let totalSize = 0; @@ -59,7 +59,7 @@ Deno.test( ); Deno.test({ permissions: { read: true } }, function filesIterSync() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = Deno.openSync(filename); let totalSize = 0; @@ -74,7 +74,7 @@ Deno.test({ permissions: { read: true } }, function filesIterSync() { Deno.test( { permissions: { read: true } }, function filesIterSyncCustomBufSize() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = Deno.openSync(filename); let totalSize = 0; @@ -264,7 +264,7 @@ Deno.test( ); Deno.test(async function openOptions() { - const filename = "cli/tests/testdata/fixture.json"; + const filename = "cli/tests/testdata/assets/fixture.json"; await assertRejects( async () => { await Deno.open(filename, { write: false }); @@ -558,7 +558,7 @@ Deno.test( ); Deno.test({ permissions: { read: true } }, async function seekStart() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = await Deno.open(filename); const seekPosition = 6; // Deliberately move 1 step forward @@ -575,7 +575,7 @@ Deno.test({ permissions: { read: true } }, async function seekStart() { }); Deno.test({ permissions: { read: true } }, function seekSyncStart() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = Deno.openSync(filename); const seekPosition = 6; // Deliberately move 1 step forward @@ -592,7 +592,7 @@ Deno.test({ permissions: { read: true } }, function seekSyncStart() { }); Deno.test({ permissions: { read: true } }, async function seekCurrent() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = await Deno.open(filename); // Deliberately move 1 step forward await file.read(new Uint8Array(1)); // "H" @@ -609,7 +609,7 @@ Deno.test({ permissions: { read: true } }, async function seekCurrent() { }); Deno.test({ permissions: { read: true } }, function seekSyncCurrent() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = Deno.openSync(filename); // Deliberately move 1 step forward file.readSync(new Uint8Array(1)); // "H" @@ -626,7 +626,7 @@ Deno.test({ permissions: { read: true } }, function seekSyncCurrent() { }); Deno.test({ permissions: { read: true } }, async function seekEnd() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = await Deno.open(filename); const seekPosition = -6; // seek from end of file that has 12 chars, 12 - 6 = 6 @@ -640,7 +640,7 @@ Deno.test({ permissions: { read: true } }, async function seekEnd() { }); Deno.test({ permissions: { read: true } }, function seekSyncEnd() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = Deno.openSync(filename); const seekPosition = -6; // seek from end of file that has 12 chars, 12 - 6 = 6 @@ -654,7 +654,7 @@ Deno.test({ permissions: { read: true } }, function seekSyncEnd() { }); Deno.test({ permissions: { read: true } }, async function seekMode() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = await Deno.open(filename); await assertRejects( async () => { @@ -747,7 +747,7 @@ Deno.test(async function fileStatSuccess() { }); Deno.test({ permissions: { read: true } }, async function readableStream() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = await Deno.open(filename); assert(file.readable instanceof ReadableStream); const chunks = []; @@ -761,7 +761,7 @@ Deno.test({ permissions: { read: true } }, async function readableStream() { Deno.test( { permissions: { read: true } }, async function readableStreamTextEncoderPipe() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = await Deno.open(filename); const readable = file.readable.pipeThrough(new TextDecoderStream()); const chunks = []; diff --git a/cli/tests/unit/flock_test.ts b/cli/tests/unit/flock_test.ts index fbc061593d..7ece1695ca 100644 --- a/cli/tests/unit/flock_test.ts +++ b/cli/tests/unit/flock_test.ts @@ -108,7 +108,7 @@ async function checkFirstBlocksSecond(opts: { } function runFlockTestProcess(opts: { exclusive: boolean; sync: boolean }) { - const path = "cli/tests/testdata/fixture.json"; + const path = "cli/tests/testdata/assets/fixture.json"; const scriptText = ` const { rid } = Deno.openSync("${path}"); diff --git a/cli/tests/unit/net_test.ts b/cli/tests/unit/net_test.ts index c7a081bf4c..10fed0c470 100644 --- a/cli/tests/unit/net_test.ts +++ b/cli/tests/unit/net_test.ts @@ -778,7 +778,7 @@ Deno.test({ permissions: { net: true } }, async function whatwgStreams() { Deno.test( { permissions: { read: true } }, async function readableStreamTextEncoderPipe() { - const filename = "cli/tests/testdata/hello.txt"; + const filename = "cli/tests/testdata/assets/hello.txt"; const file = await Deno.open(filename); const readable = file.readable.pipeThrough(new TextDecoderStream()); const chunks = []; diff --git a/cli/tests/unit/read_dir_test.ts b/cli/tests/unit/read_dir_test.ts index fecddd6c41..1c81e860a6 100644 --- a/cli/tests/unit/read_dir_test.ts +++ b/cli/tests/unit/read_dir_test.ts @@ -41,10 +41,10 @@ Deno.test({ permissions: { read: false } }, function readDirSyncPerm() { Deno.test({ permissions: { read: true } }, function readDirSyncNotDir() { assertThrows( () => { - Deno.readDirSync("cli/tests/testdata/fixture.json"); + Deno.readDirSync("cli/tests/testdata/assets/fixture.json"); }, Error, - `readdir 'cli/tests/testdata/fixture.json'`, + `readdir 'cli/tests/testdata/assets/fixture.json'`, ); }); diff --git a/cli/tests/unit/read_file_test.ts b/cli/tests/unit/read_file_test.ts index 07935b7fbb..c18cdf0590 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"; Deno.test({ permissions: { read: true } }, function readFileSyncSuccess() { - const data = Deno.readFileSync("cli/tests/testdata/fixture.json"); + const data = Deno.readFileSync("cli/tests/testdata/assets/fixture.json"); assert(data.byteLength > 0); const decoder = new TextDecoder("utf-8"); const json = decoder.decode(data); @@ -19,7 +19,7 @@ Deno.test({ permissions: { read: true } }, function readFileSyncSuccess() { Deno.test({ permissions: { read: true } }, function readFileSyncUrl() { const data = Deno.readFileSync( - pathToAbsoluteFileUrl("cli/tests/testdata/fixture.json"), + pathToAbsoluteFileUrl("cli/tests/testdata/assets/fixture.json"), ); assert(data.byteLength > 0); const decoder = new TextDecoder("utf-8"); @@ -30,7 +30,7 @@ Deno.test({ permissions: { read: true } }, function readFileSyncUrl() { Deno.test({ permissions: { read: false } }, function readFileSyncPerm() { assertThrows(() => { - Deno.readFileSync("cli/tests/testdata/fixture.json"); + Deno.readFileSync("cli/tests/testdata/assets/fixture.json"); }, Deno.errors.PermissionDenied); }); @@ -42,7 +42,7 @@ Deno.test({ permissions: { read: true } }, function readFileSyncNotFound() { Deno.test({ permissions: { read: true } }, async function readFileUrl() { const data = await Deno.readFile( - pathToAbsoluteFileUrl("cli/tests/testdata/fixture.json"), + pathToAbsoluteFileUrl("cli/tests/testdata/assets/fixture.json"), ); assert(data.byteLength > 0); const decoder = new TextDecoder("utf-8"); @@ -52,7 +52,7 @@ Deno.test({ permissions: { read: true } }, async function readFileUrl() { }); Deno.test({ permissions: { read: true } }, async function readFileSuccess() { - const data = await Deno.readFile("cli/tests/testdata/fixture.json"); + const data = await Deno.readFile("cli/tests/testdata/assets/fixture.json"); assert(data.byteLength > 0); const decoder = new TextDecoder("utf-8"); const json = decoder.decode(data); @@ -62,13 +62,13 @@ Deno.test({ permissions: { read: true } }, async function readFileSuccess() { Deno.test({ permissions: { read: false } }, async function readFilePerm() { await assertRejects(async () => { - await Deno.readFile("cli/tests/testdata/fixture.json"); + await Deno.readFile("cli/tests/testdata/assets/fixture.json"); }, Deno.errors.PermissionDenied); }); Deno.test({ permissions: { read: true } }, function readFileSyncLoop() { for (let i = 0; i < 256; i++) { - Deno.readFileSync("cli/tests/testdata/fixture.json"); + Deno.readFileSync("cli/tests/testdata/assets/fixture.json"); } }); @@ -97,7 +97,7 @@ Deno.test( queueMicrotask(() => ac.abort()); await assertRejects( async () => { - await Deno.readFile("cli/tests/testdata/fixture.json", { + await Deno.readFile("cli/tests/testdata/assets/fixture.json", { signal: ac.signal, }); }, @@ -117,7 +117,7 @@ Deno.test( queueMicrotask(() => ac.abort(abortReason)); await assertRejects( async () => { - await Deno.readFile("cli/tests/testdata/fixture.json", { + await Deno.readFile("cli/tests/testdata/assets/fixture.json", { signal: ac.signal, }); }, @@ -134,7 +134,7 @@ Deno.test( const ac = new AbortController(); queueMicrotask(() => ac.abort("Some string")); try { - await Deno.readFile("cli/tests/testdata/fixture.json", { + await Deno.readFile("cli/tests/testdata/assets/fixture.json", { signal: ac.signal, }); unreachable(); diff --git a/cli/tests/unit/read_text_file_test.ts b/cli/tests/unit/read_text_file_test.ts index 48d246dad1..119c650b60 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"; Deno.test({ permissions: { read: true } }, function readTextFileSyncSuccess() { - const data = Deno.readTextFileSync("cli/tests/testdata/fixture.json"); + const data = Deno.readTextFileSync("cli/tests/testdata/assets/fixture.json"); assert(data.length > 0); const pkg = JSON.parse(data); assertEquals(pkg.name, "deno"); @@ -16,7 +16,7 @@ Deno.test({ permissions: { read: true } }, function readTextFileSyncSuccess() { Deno.test({ permissions: { read: true } }, function readTextFileSyncByUrl() { const data = Deno.readTextFileSync( - pathToAbsoluteFileUrl("cli/tests/testdata/fixture.json"), + pathToAbsoluteFileUrl("cli/tests/testdata/assets/fixture.json"), ); assert(data.length > 0); const pkg = JSON.parse(data); @@ -25,7 +25,7 @@ Deno.test({ permissions: { read: true } }, function readTextFileSyncByUrl() { Deno.test({ permissions: { read: false } }, function readTextFileSyncPerm() { assertThrows(() => { - Deno.readTextFileSync("cli/tests/testdata/fixture.json"); + Deno.readTextFileSync("cli/tests/testdata/assets/fixture.json"); }, Deno.errors.PermissionDenied); }); @@ -38,7 +38,9 @@ Deno.test({ permissions: { read: true } }, function readTextFileSyncNotFound() { Deno.test( { permissions: { read: true } }, async function readTextFileSuccess() { - const data = await Deno.readTextFile("cli/tests/testdata/fixture.json"); + const data = await Deno.readTextFile( + "cli/tests/testdata/assets/fixture.json", + ); assert(data.length > 0); const pkg = JSON.parse(data); assertEquals(pkg.name, "deno"); @@ -47,7 +49,7 @@ Deno.test( Deno.test({ permissions: { read: true } }, async function readTextFileByUrl() { const data = await Deno.readTextFile( - pathToAbsoluteFileUrl("cli/tests/testdata/fixture.json"), + pathToAbsoluteFileUrl("cli/tests/testdata/assets/fixture.json"), ); assert(data.length > 0); const pkg = JSON.parse(data); @@ -56,13 +58,13 @@ Deno.test({ permissions: { read: true } }, async function readTextFileByUrl() { Deno.test({ permissions: { read: false } }, async function readTextFilePerm() { await assertRejects(async () => { - await Deno.readTextFile("cli/tests/testdata/fixture.json"); + await Deno.readTextFile("cli/tests/testdata/assets/fixture.json"); }, Deno.errors.PermissionDenied); }); Deno.test({ permissions: { read: true } }, function readTextFileSyncLoop() { for (let i = 0; i < 256; i++) { - Deno.readTextFileSync("cli/tests/testdata/fixture.json"); + Deno.readTextFileSync("cli/tests/testdata/assets/fixture.json"); } }); @@ -91,7 +93,7 @@ Deno.test( queueMicrotask(() => ac.abort()); await assertRejects( async () => { - await Deno.readFile("cli/tests/testdata/fixture.json", { + await Deno.readFile("cli/tests/testdata/assets/fixture.json", { signal: ac.signal, }); }, @@ -111,7 +113,7 @@ Deno.test( queueMicrotask(() => ac.abort(abortReason)); await assertRejects( async () => { - await Deno.readFile("cli/tests/testdata/fixture.json", { + await Deno.readFile("cli/tests/testdata/assets/fixture.json", { signal: ac.signal, }); }, @@ -128,7 +130,7 @@ Deno.test( const ac = new AbortController(); queueMicrotask(() => ac.abort("Some string")); try { - await Deno.readFile("cli/tests/testdata/fixture.json", { + await Deno.readFile("cli/tests/testdata/assets/fixture.json", { signal: ac.signal, }); unreachable(); diff --git a/cli/tests/unit/real_path_test.ts b/cli/tests/unit/real_path_test.ts index 2dfb5d2140..5297c2b766 100644 --- a/cli/tests/unit/real_path_test.ts +++ b/cli/tests/unit/real_path_test.ts @@ -9,7 +9,7 @@ import { } from "./test_util.ts"; Deno.test({ permissions: { read: true } }, function realPathSyncSuccess() { - const relative = "cli/tests/testdata/fixture.json"; + const relative = "cli/tests/testdata/assets/fixture.json"; const realPath = Deno.realPathSync(relative); if (Deno.build.os !== "windows") { assert(realPath.startsWith("/")); @@ -21,7 +21,7 @@ Deno.test({ permissions: { read: true } }, function realPathSyncSuccess() { }); Deno.test({ permissions: { read: true } }, function realPathSyncUrl() { - const relative = "cli/tests/testdata/fixture.json"; + const relative = "cli/tests/testdata/assets/fixture.json"; const url = pathToAbsoluteFileUrl(relative); assertEquals(Deno.realPathSync(relative), Deno.realPathSync(url)); }); @@ -60,7 +60,7 @@ Deno.test({ permissions: { read: true } }, function realPathSyncNotFound() { }); Deno.test({ permissions: { read: true } }, async function realPathSuccess() { - const relativePath = "cli/tests/testdata/fixture.json"; + const relativePath = "cli/tests/testdata/assets/fixture.json"; const realPath = await Deno.realPath(relativePath); if (Deno.build.os !== "windows") { assert(realPath.startsWith("/")); @@ -74,7 +74,7 @@ Deno.test({ permissions: { read: true } }, async function realPathSuccess() { Deno.test( { permissions: { read: true } }, async function realPathUrl() { - const relative = "cli/tests/testdata/fixture.json"; + const relative = "cli/tests/testdata/assets/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 08fbfafc48..60325b91d0 100644 --- a/cli/tests/unit/resources_test.ts +++ b/cli/tests/unit/resources_test.ts @@ -37,7 +37,7 @@ Deno.test({ permissions: { net: true } }, async function resourcesNet() { Deno.test({ permissions: { read: true } }, async function resourcesFile() { const resourcesBefore = Deno.resources(); - const f = await Deno.open("cli/tests/testdata/hello.txt"); + const f = await Deno.open("cli/tests/testdata/assets/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 f39b3be2c5..9a504b4fc8 100644 --- a/cli/tests/unit/stat_test.ts +++ b/cli/tests/unit/stat_test.ts @@ -146,7 +146,7 @@ Deno.test({ permissions: { read: true } }, function lstatSyncSuccess() { Deno.test({ permissions: { read: false } }, function lstatSyncPerm() { assertThrows(() => { - Deno.lstatSync("hello.txt"); + Deno.lstatSync("assets/hello.txt"); }, Deno.errors.PermissionDenied); }); diff --git a/cli/tests/unit/tty_test.ts b/cli/tests/unit/tty_test.ts index 9feacdf510..e50443aabb 100644 --- a/cli/tests/unit/tty_test.ts +++ b/cli/tests/unit/tty_test.ts @@ -4,7 +4,7 @@ import { assert, assertThrows } from "./test_util.ts"; // Note tests for Deno.setRaw is in integration tests. Deno.test({ permissions: { read: true } }, function consoleSizeFile() { - const file = Deno.openSync("cli/tests/testdata/hello.txt"); + const file = Deno.openSync("cli/tests/testdata/assets/hello.txt"); assertThrows(() => { Deno.consoleSize(file.rid); }, Error); @@ -20,7 +20,7 @@ Deno.test(function consoleSizeError() { Deno.test({ permissions: { read: true } }, function isatty() { // CI not under TTY, so cannot test stdin/stdout/stderr. - const f = Deno.openSync("cli/tests/testdata/hello.txt"); + const f = Deno.openSync("cli/tests/testdata/assets/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 2bf0a74802..03ed0e2981 100644 --- a/cli/tests/unit/wasm_test.ts +++ b/cli/tests/unit/wasm_test.ts @@ -79,7 +79,7 @@ Deno.test(async function wasmInstantiateStreaming() { Deno.test( { permissions: { read: true } }, async function wasmFileStreaming() { - const url = import.meta.resolve("../testdata/unreachable.wasm"); + const url = import.meta.resolve("../testdata/assets/unreachable.wasm"); assert(url.startsWith("file://")); const { module } = await WebAssembly.instantiateStreaming(fetch(url)); @@ -96,7 +96,7 @@ Deno.test( // 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/deno_dom_0.1.3-alpha2.wasm", + "http://localhost:4545/assets/deno_dom_0.1.3-alpha2.wasm", )); }, ); diff --git a/cli/tests/unit/webgpu_test.ts b/cli/tests/unit/webgpu_test.ts index fa71ffcc81..c903736f8d 100644 --- a/cli/tests/unit/webgpu_test.ts +++ b/cli/tests/unit/webgpu_test.ts @@ -27,7 +27,7 @@ Deno.test({ assert(device); const shaderCode = await Deno.readTextFile( - "cli/tests/testdata/webgpu_computepass_shader.wgsl", + "cli/tests/testdata/webgpu/computepass_shader.wgsl", ); const shaderModule = device.createShaderModule({ @@ -116,7 +116,7 @@ Deno.test({ assert(device); const shaderCode = await Deno.readTextFile( - "cli/tests/testdata/webgpu_hellotriangle_shader.wgsl", + "cli/tests/testdata/webgpu/hellotriangle_shader.wgsl", ); const shaderModule = device.createShaderModule({ @@ -202,7 +202,7 @@ Deno.test({ assertEquals( data, - await Deno.readFile("cli/tests/testdata/webgpu_hellotriangle.out"), + await Deno.readFile("cli/tests/testdata/webgpu/hellotriangle.out"), ); outputBuffer.unmap(); diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 584be9e6b6..f2af48f26b 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -757,8 +757,8 @@ mod test { assert!(is_supported_ext_fmt(Path::new("readme.mdown"))); assert!(is_supported_ext_fmt(Path::new("readme.markdown"))); assert!(is_supported_ext_fmt(Path::new("lib/typescript.d.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("testdata/run/001_hello.js"))); + assert!(is_supported_ext_fmt(Path::new("testdata/run/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/runtime/worker.rs b/runtime/worker.rs index 82b6a589e7..0723cef843 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -540,7 +540,7 @@ mod tests { #[tokio::test] async fn execute_mod_esm_imports_a() { - let p = test_util::testdata_path().join("esm_imports_a.js"); + let p = test_util::testdata_path().join("runtime/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_main_module(&module_specifier).await; @@ -583,7 +583,7 @@ mod tests { // This assumes cwd is project root (an assumption made throughout the // tests). let mut worker = create_test_worker(); - let p = test_util::testdata_path().join("001_hello.js"); + let p = test_util::testdata_path().join("run/001_hello.js"); let module_specifier = resolve_url_or_path(&p.to_string_lossy()).unwrap(); let result = worker.execute_main_module(&module_specifier).await; assert!(result.is_ok()); diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index bf81e01a6a..5a357ee7de 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -690,7 +690,7 @@ async fn main_server( .insert("X-Deno-Warning", HeaderValue::from_static("foobar")); res.headers_mut().insert( "location", - HeaderValue::from_bytes(b"/x_deno_warning_redirect.js").unwrap(), + HeaderValue::from_bytes(b"/lsp/x_deno_warning_redirect.js").unwrap(), ); Ok(res) } @@ -774,7 +774,7 @@ async fn main_server( ); Ok(res) } - (_, "/type_directives_redirect.js") => { + (_, "/run/type_directives_redirect.js") => { let mut res = Response::new(Body::from("export const foo = 'foo';")); res.headers_mut().insert( "Content-type", @@ -788,7 +788,7 @@ async fn main_server( ); Ok(res) } - (_, "/type_headers_deno_types.foo.js") => { + (_, "/run/type_headers_deno_types.foo.js") => { let mut res = Response::new(Body::from( "export function foo(text) { console.log(text); }", )); @@ -799,12 +799,12 @@ async fn main_server( res.headers_mut().insert( "X-TypeScript-Types", HeaderValue::from_static( - "http://localhost:4545/type_headers_deno_types.d.ts", + "http://localhost:4545/run/type_headers_deno_types.d.ts", ), ); Ok(res) } - (_, "/type_headers_deno_types.d.ts") => { + (_, "/run/type_headers_deno_types.d.ts") => { let mut res = Response::new(Body::from("export function foo(text: number): void;")); res.headers_mut().insert( @@ -813,7 +813,7 @@ async fn main_server( ); Ok(res) } - (_, "/type_headers_deno_types.foo.d.ts") => { + (_, "/run/type_headers_deno_types.foo.d.ts") => { let mut res = Response::new(Body::from("export function foo(text: string): void;")); res.headers_mut().insert( @@ -1458,7 +1458,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("/053_import_compression/brotli") { + if p.ends_with("/run/import_compression/brotli") { response .headers_mut() .insert("Content-Encoding", HeaderValue::from_static("br")); @@ -1471,7 +1471,7 @@ fn custom_headers(p: &str, body: Vec) -> Response { .insert("Content-Length", HeaderValue::from_static("26")); return response; } - if p.ends_with("/053_import_compression/gziped") { + if p.ends_with("/run/import_compression/gziped") { response .headers_mut() .insert("Content-Encoding", HeaderValue::from_static("gzip")); diff --git a/tools/lint.js b/tools/lint.js index 7012b8f229..65f8888b70 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -18,7 +18,6 @@ async function dlint() { "*.ts", ":!:.github/mtime_cache/action.js", ":!:cli/tests/testdata/swc_syntax_error.ts", - ":!:cli/tests/testdata/038_checkjs.js", ":!:cli/tests/testdata/error_008_checkjs.js", ":!:cli/bench/http/node*.js", ":!:cli/bench/testdata/npm/*", @@ -31,6 +30,7 @@ async function dlint() { ":!:cli/tests/testdata/fmt/**", ":!:cli/tests/testdata/npm/**", ":!:cli/tests/testdata/lint/**", + ":!:cli/tests/testdata/run/**", ":!:cli/tests/testdata/tsc/**", ":!:cli/tsc/*typescript.js", ":!:cli/tsc/compiler.d.ts",