diff options
-rw-r--r-- | .eslintignore | 2 | ||||
-rw-r--r-- | .prettierignore | 4 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | cli/Cargo.toml | 13 | ||||
-rw-r--r-- | cli/colors.rs | 1 | ||||
-rw-r--r-- | cli/compilers/ts.rs | 2 | ||||
-rw-r--r-- | cli/lib.rs | 437 | ||||
-rw-r--r-- | cli/main.rs | 439 | ||||
-rw-r--r-- | cli/tests/001_hello.js (renamed from tests/001_hello.js) | 0 | ||||
-rw-r--r-- | cli/tests/001_hello.js.out (renamed from tests/001_hello.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/002_hello.ts (renamed from tests/002_hello.ts) | 0 | ||||
-rw-r--r-- | cli/tests/002_hello.ts.out (renamed from tests/002_hello.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/003_relative_import.ts (renamed from tests/003_relative_import.ts) | 0 | ||||
-rw-r--r-- | cli/tests/003_relative_import.ts.out (renamed from tests/003_relative_import.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/004_set_timeout.ts (renamed from tests/004_set_timeout.ts) | 0 | ||||
-rw-r--r-- | cli/tests/004_set_timeout.ts.out (renamed from tests/004_set_timeout.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/005_more_imports.ts (renamed from tests/005_more_imports.ts) | 0 | ||||
-rw-r--r-- | cli/tests/005_more_imports.ts.out (renamed from tests/005_more_imports.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/006_url_imports.ts (renamed from tests/006_url_imports.ts) | 0 | ||||
-rw-r--r-- | cli/tests/006_url_imports.ts.out (renamed from tests/006_url_imports.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/012_async.ts (renamed from tests/012_async.ts) | 0 | ||||
-rw-r--r-- | cli/tests/012_async.ts.out (renamed from tests/012_async.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/013_dynamic_import.ts (renamed from tests/013_dynamic_import.ts) | 0 | ||||
-rw-r--r-- | cli/tests/013_dynamic_import.ts.out (renamed from tests/013_dynamic_import.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/014_duplicate_import.ts (renamed from tests/014_duplicate_import.ts) | 0 | ||||
-rw-r--r-- | cli/tests/014_duplicate_import.ts.out (renamed from tests/014_duplicate_import.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/015_duplicate_parallel_import.js (renamed from tests/015_duplicate_parallel_import.js) | 0 | ||||
-rw-r--r-- | cli/tests/015_duplicate_parallel_import.js.out (renamed from tests/015_duplicate_parallel_import.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/016_double_await.ts (renamed from tests/016_double_await.ts) | 0 | ||||
-rw-r--r-- | cli/tests/016_double_await.ts.out (renamed from tests/016_double_await.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/017_import_redirect.ts (renamed from tests/017_import_redirect.ts) | 0 | ||||
-rw-r--r-- | cli/tests/017_import_redirect.ts.out (renamed from tests/017_import_redirect.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/018_async_catch.ts (renamed from tests/018_async_catch.ts) | 0 | ||||
-rw-r--r-- | cli/tests/018_async_catch.ts.out (renamed from tests/018_async_catch.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/019_media_types.ts (renamed from tests/019_media_types.ts) | 0 | ||||
-rw-r--r-- | cli/tests/019_media_types.ts.out (renamed from tests/019_media_types.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/020_json_modules.ts (renamed from tests/020_json_modules.ts) | 0 | ||||
-rw-r--r-- | cli/tests/020_json_modules.ts.out (renamed from tests/020_json_modules.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/021_mjs_modules.ts (renamed from tests/021_mjs_modules.ts) | 0 | ||||
-rw-r--r-- | cli/tests/021_mjs_modules.ts.out (renamed from tests/021_mjs_modules.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/022_info_flag_script.out (renamed from tests/022_info_flag_script.out) | 0 | ||||
-rw-r--r-- | cli/tests/023_no_ext_with_headers (renamed from tests/023_no_ext_with_headers) | 0 | ||||
-rw-r--r-- | cli/tests/023_no_ext_with_headers.headers.json (renamed from tests/023_no_ext_with_headers.headers.json) | 0 | ||||
-rw-r--r-- | cli/tests/023_no_ext_with_headers.out (renamed from tests/023_no_ext_with_headers.out) | 0 | ||||
-rw-r--r-- | cli/tests/024_import_no_ext_with_headers.ts (renamed from tests/024_import_no_ext_with_headers.ts) | 0 | ||||
-rw-r--r-- | cli/tests/024_import_no_ext_with_headers.ts.out (renamed from tests/024_import_no_ext_with_headers.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/025_hrtime.ts (renamed from tests/025_hrtime.ts) | 0 | ||||
-rw-r--r-- | cli/tests/025_hrtime.ts.out (renamed from tests/025_hrtime.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/025_reload_js_type_error.js (renamed from tests/025_reload_js_type_error.js) | 0 | ||||
-rw-r--r-- | cli/tests/025_reload_js_type_error.js.out (renamed from tests/025_reload_js_type_error.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/026_redirect_javascript.js (renamed from tests/026_redirect_javascript.js) | 0 | ||||
-rw-r--r-- | cli/tests/026_redirect_javascript.js.out (renamed from tests/026_redirect_javascript.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/026_workers.ts (renamed from tests/026_workers.ts) | 0 | ||||
-rw-r--r-- | cli/tests/026_workers.ts.out (renamed from tests/026_workers.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/027_redirect_typescript.ts (renamed from tests/027_redirect_typescript.ts) | 0 | ||||
-rw-r--r-- | cli/tests/027_redirect_typescript.ts.out (renamed from tests/027_redirect_typescript.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/028_args.ts (renamed from tests/028_args.ts) | 0 | ||||
-rw-r--r-- | cli/tests/028_args.ts.out (renamed from tests/028_args.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/029_eval.out (renamed from tests/029_eval.out) | 0 | ||||
-rw-r--r-- | cli/tests/030_xeval.out (renamed from tests/030_xeval.out) | 0 | ||||
-rw-r--r-- | cli/tests/031_xeval_replvar.out (renamed from tests/031_xeval_replvar.out) | 0 | ||||
-rw-r--r-- | cli/tests/032_xeval_delim.out (renamed from tests/032_xeval_delim.out) | 0 | ||||
-rw-r--r-- | cli/tests/033_import_map.out (renamed from tests/033_import_map.out) | 0 | ||||
-rw-r--r-- | cli/tests/034_onload.out (renamed from tests/034_onload.out) | 0 | ||||
-rw-r--r-- | cli/tests/034_onload/imported.ts (renamed from tests/034_onload/imported.ts) | 0 | ||||
-rw-r--r-- | cli/tests/034_onload/main.ts (renamed from tests/034_onload/main.ts) | 0 | ||||
-rw-r--r-- | cli/tests/034_onload/nest_imported.ts (renamed from tests/034_onload/nest_imported.ts) | 0 | ||||
-rw-r--r-- | cli/tests/034_onload_imported.ts (renamed from tests/034_onload_imported.ts) | 0 | ||||
-rw-r--r-- | cli/tests/035_no_fetch_flag.out (renamed from tests/035_no_fetch_flag.out) | 0 | ||||
-rw-r--r-- | cli/tests/036_import_map_fetch.out (renamed from tests/036_import_map_fetch.out) | 0 | ||||
-rw-r--r-- | cli/tests/038_checkjs.js (renamed from tests/038_checkjs.js) | 0 | ||||
-rw-r--r-- | cli/tests/038_checkjs.js.out (renamed from tests/038_checkjs.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/038_checkjs.tsconfig.json (renamed from tests/038_checkjs.tsconfig.json) | 0 | ||||
-rw-r--r-- | cli/tests/039_worker_deno_ns.ts (renamed from tests/039_worker_deno_ns.ts) | 0 | ||||
-rw-r--r-- | cli/tests/039_worker_deno_ns.ts.out (renamed from tests/039_worker_deno_ns.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/039_worker_deno_ns/has_ns.ts (renamed from tests/039_worker_deno_ns/has_ns.ts) | 0 | ||||
-rw-r--r-- | cli/tests/039_worker_deno_ns/maybe_ns.ts (renamed from tests/039_worker_deno_ns/maybe_ns.ts) | 0 | ||||
-rw-r--r-- | cli/tests/039_worker_deno_ns/no_ns.ts (renamed from tests/039_worker_deno_ns/no_ns.ts) | 0 | ||||
-rw-r--r-- | cli/tests/040_worker_blob.ts (renamed from tests/040_worker_blob.ts) | 0 | ||||
-rw-r--r-- | cli/tests/040_worker_blob.ts.out (renamed from tests/040_worker_blob.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/041_dyn_import_eval.out (renamed from tests/041_dyn_import_eval.out) | 0 | ||||
-rw-r--r-- | cli/tests/041_info_flag.out (renamed from tests/041_info_flag.out) | 0 | ||||
-rw-r--r-- | cli/tests/042_dyn_import_evalcontext.ts (renamed from tests/042_dyn_import_evalcontext.ts) | 0 | ||||
-rw-r--r-- | cli/tests/042_dyn_import_evalcontext.ts.out (renamed from tests/042_dyn_import_evalcontext.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/043_xeval_delim2.out (renamed from tests/043_xeval_delim2.out) | 0 | ||||
-rw-r--r-- | cli/tests/043_xeval_delim2.test (renamed from tests/043_xeval_delim2.test) | 0 | ||||
-rw-r--r-- | cli/tests/044_bad_resource.test (renamed from tests/044_bad_resource.test) | 0 | ||||
-rw-r--r-- | cli/tests/044_bad_resource.ts (renamed from tests/044_bad_resource.ts) | 0 | ||||
-rw-r--r-- | cli/tests/044_bad_resource.ts.out (renamed from tests/044_bad_resource.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/README.md | 7 | ||||
-rw-r--r-- | cli/tests/async_error.ts (renamed from tests/async_error.ts) | 0 | ||||
-rw-r--r-- | cli/tests/async_error.ts.out (renamed from tests/async_error.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/badly_formatted.js (renamed from tests/badly_formatted.js) | 0 | ||||
-rw-r--r-- | cli/tests/badly_formatted_fixed.js (renamed from tests/badly_formatted_fixed.js) | 0 | ||||
-rw-r--r-- | cli/tests/cat.ts (renamed from tests/cat.ts) | 0 | ||||
-rw-r--r-- | cli/tests/circular1.js (renamed from tests/circular1.js) | 0 | ||||
-rw-r--r-- | cli/tests/circular1.js.out (renamed from tests/circular1.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/circular2.js (renamed from tests/circular2.js) | 0 | ||||
-rw-r--r-- | cli/tests/config.ts (renamed from tests/config.ts) | 0 | ||||
-rw-r--r-- | cli/tests/config.ts.out (renamed from tests/config.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/config.tsconfig.json (renamed from tests/config.tsconfig.json) | 0 | ||||
-rw-r--r-- | cli/tests/echo_server.ts (renamed from tests/echo_server.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_001.ts (renamed from tests/error_001.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_001.ts.out (renamed from tests/error_001.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_002.ts (renamed from tests/error_002.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_002.ts.out (renamed from tests/error_002.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_003_typescript.ts (renamed from tests/error_003_typescript.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_003_typescript.ts.out (renamed from tests/error_003_typescript.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_004_missing_module.ts (renamed from tests/error_004_missing_module.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_004_missing_module.ts.out (renamed from tests/error_004_missing_module.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_005_missing_dynamic_import.ts (renamed from tests/error_005_missing_dynamic_import.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_005_missing_dynamic_import.ts.out (renamed from tests/error_005_missing_dynamic_import.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_006_import_ext_failure.ts (renamed from tests/error_006_import_ext_failure.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_006_import_ext_failure.ts.out (renamed from tests/error_006_import_ext_failure.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_007_any.ts (renamed from tests/error_007_any.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_007_any.ts.out (renamed from tests/error_007_any.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_008_checkjs.js (renamed from tests/error_008_checkjs.js) | 0 | ||||
-rw-r--r-- | cli/tests/error_008_checkjs.js.out (renamed from tests/error_008_checkjs.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_009_missing_js_module.disabled (renamed from tests/error_009_missing_js_module.disabled) | 0 | ||||
-rw-r--r-- | cli/tests/error_009_missing_js_module.js (renamed from tests/error_009_missing_js_module.js) | 0 | ||||
-rw-r--r-- | cli/tests/error_009_missing_js_module.js.out (renamed from tests/error_009_missing_js_module.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_010_nonexistent_arg.disabled (renamed from tests/error_010_nonexistent_arg.disabled) | 0 | ||||
-rw-r--r-- | cli/tests/error_010_nonexistent_arg.out (renamed from tests/error_010_nonexistent_arg.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_011_bad_module_specifier.ts (renamed from tests/error_011_bad_module_specifier.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_011_bad_module_specifier.ts.out (renamed from tests/error_011_bad_module_specifier.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_012_bad_dynamic_import_specifier.ts (renamed from tests/error_012_bad_dynamic_import_specifier.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_012_bad_dynamic_import_specifier.ts.out (renamed from tests/error_012_bad_dynamic_import_specifier.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_013_missing_script.out (renamed from tests/error_013_missing_script.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_014_catch_dynamic_import_error.js (renamed from tests/error_014_catch_dynamic_import_error.js) | 0 | ||||
-rw-r--r-- | cli/tests/error_014_catch_dynamic_import_error.js.out (renamed from tests/error_014_catch_dynamic_import_error.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_015_dynamic_import_permissions.js (renamed from tests/error_015_dynamic_import_permissions.js) | 0 | ||||
-rw-r--r-- | cli/tests/error_015_dynamic_import_permissions.out (renamed from tests/error_015_dynamic_import_permissions.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_016_dynamic_import_permissions2.js (renamed from tests/error_016_dynamic_import_permissions2.js) | 0 | ||||
-rw-r--r-- | cli/tests/error_016_dynamic_import_permissions2.out (renamed from tests/error_016_dynamic_import_permissions2.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_stack.ts (renamed from tests/error_stack.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_stack.ts.out (renamed from tests/error_stack.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_syntax.js (renamed from tests/error_syntax.js) | 0 | ||||
-rw-r--r-- | cli/tests/error_syntax.js.out (renamed from tests/error_syntax.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/error_type_definitions.ts (renamed from tests/error_type_definitions.ts) | 0 | ||||
-rw-r--r-- | cli/tests/error_type_definitions.ts.out (renamed from tests/error_type_definitions.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/esm_imports_a.js (renamed from tests/esm_imports_a.js) | 0 | ||||
-rw-r--r-- | cli/tests/esm_imports_b.js (renamed from tests/esm_imports_b.js) | 0 | ||||
-rw-r--r-- | cli/tests/exec_path.ts (renamed from tests/exec_path.ts) | 0 | ||||
-rw-r--r-- | cli/tests/exit_error42.ts (renamed from tests/exit_error42.ts) | 0 | ||||
-rw-r--r-- | cli/tests/exit_error42.ts.out (renamed from tests/exit_error42.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/fetch_deps.ts (renamed from tests/fetch_deps.ts) | 0 | ||||
-rw-r--r-- | cli/tests/hello.txt (renamed from tests/hello.txt) | 0 | ||||
-rw-r--r-- | cli/tests/https_import.ts (renamed from tests/https_import.ts) | 0 | ||||
-rw-r--r-- | cli/tests/https_import.ts.out (renamed from tests/https_import.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/if_main.ts (renamed from tests/if_main.ts) | 0 | ||||
-rw-r--r-- | cli/tests/if_main.ts.out (renamed from tests/if_main.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/import_meta.ts (renamed from tests/import_meta.ts) | 0 | ||||
-rw-r--r-- | cli/tests/import_meta.ts.out (renamed from tests/import_meta.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/import_meta2.ts (renamed from tests/import_meta2.ts) | 0 | ||||
-rw-r--r-- | cli/tests/importmaps/import_map.json (renamed from tests/importmaps/import_map.json) | 0 | ||||
-rw-r--r-- | cli/tests/importmaps/lodash/lodash.ts (renamed from tests/importmaps/lodash/lodash.ts) | 0 | ||||
-rw-r--r-- | cli/tests/importmaps/lodash/other_file.ts (renamed from tests/importmaps/lodash/other_file.ts) | 0 | ||||
-rw-r--r-- | cli/tests/importmaps/moment/moment.ts (renamed from tests/importmaps/moment/moment.ts) | 0 | ||||
-rw-r--r-- | cli/tests/importmaps/moment/other_file.ts (renamed from tests/importmaps/moment/other_file.ts) | 0 | ||||
-rw-r--r-- | cli/tests/importmaps/scope/scoped.ts (renamed from tests/importmaps/scope/scoped.ts) | 0 | ||||
-rw-r--r-- | cli/tests/importmaps/scoped_moment.ts (renamed from tests/importmaps/scoped_moment.ts) | 0 | ||||
-rw-r--r-- | cli/tests/importmaps/test.ts (renamed from tests/importmaps/test.ts) | 0 | ||||
-rw-r--r-- | cli/tests/importmaps/vue.ts (renamed from tests/importmaps/vue.ts) | 0 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs (renamed from cli/integration_tests.rs) | 5 | ||||
-rw-r--r-- | cli/tests/is_tty.ts (renamed from tests/is_tty.ts) | 0 | ||||
-rw-r--r-- | cli/tests/no_color.js (renamed from tests/no_color.js) | 0 | ||||
-rw-r--r-- | cli/tests/seed_random.js (renamed from tests/seed_random.js) | 0 | ||||
-rw-r--r-- | cli/tests/seed_random.js.out (renamed from tests/seed_random.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/auto_print_hello.ts (renamed from tests/subdir/auto_print_hello.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/bench_worker.ts (renamed from tests/subdir/bench_worker.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/config.json (renamed from tests/subdir/config.json) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/evil_remote_import.js (renamed from tests/subdir/evil_remote_import.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/form_urlencoded.txt (renamed from tests/subdir/form_urlencoded.txt) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/indirect_import_error.js (renamed from tests/subdir/indirect_import_error.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/indirect_throws.js (renamed from tests/subdir/indirect_throws.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mismatch_ext.ts (renamed from tests/subdir/mismatch_ext.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mod1.ts (renamed from tests/subdir/mod1.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mod2.ts (renamed from tests/subdir/mod2.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mod3.js (renamed from tests/subdir/mod3.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mod4.js (renamed from tests/subdir/mod4.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mod5.mjs (renamed from tests/subdir/mod5.mjs) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mt_application_ecmascript.j2.js (renamed from tests/subdir/mt_application_ecmascript.j2.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mt_application_x_javascript.j4.js (renamed from tests/subdir/mt_application_x_javascript.j4.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mt_application_x_typescript.t4.ts (renamed from tests/subdir/mt_application_x_typescript.t4.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mt_javascript.js (renamed from tests/subdir/mt_javascript.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mt_text_ecmascript.j3.js (renamed from tests/subdir/mt_text_ecmascript.j3.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mt_text_javascript.j1.js (renamed from tests/subdir/mt_text_javascript.j1.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mt_text_typescript.t1.ts (renamed from tests/subdir/mt_text_typescript.t1.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mt_video_mp2t.t3.ts (renamed from tests/subdir/mt_video_mp2t.t3.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/mt_video_vdn.t2.ts (renamed from tests/subdir/mt_video_vdn.t2.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/no_ext (renamed from tests/subdir/no_ext) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/print_hello.ts (renamed from tests/subdir/print_hello.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/redirects/redirect1.js (renamed from tests/subdir/redirects/redirect1.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/redirects/redirect1.ts (renamed from tests/subdir/redirects/redirect1.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/redirects/redirect2.js (renamed from tests/subdir/redirects/redirect2.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/redirects/redirect3.js (renamed from tests/subdir/redirects/redirect3.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/redirects/redirect4.ts (renamed from tests/subdir/redirects/redirect4.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/subdir2/mod2.ts (renamed from tests/subdir/subdir2/mod2.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/test_worker.js (renamed from tests/subdir/test_worker.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/test_worker.ts (renamed from tests/subdir/test_worker.ts) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/throws.js (renamed from tests/subdir/throws.js) | 0 | ||||
-rw-r--r-- | cli/tests/subdir/unknown_ext.deno (renamed from tests/subdir/unknown_ext.deno) | 0 | ||||
-rw-r--r-- | cli/tests/type_definitions.ts (renamed from tests/type_definitions.ts) | 0 | ||||
-rw-r--r-- | cli/tests/type_definitions.ts.out (renamed from tests/type_definitions.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/type_definitions/bar.d.ts (renamed from tests/type_definitions/bar.d.ts) | 0 | ||||
-rw-r--r-- | cli/tests/type_definitions/fizz.d.ts (renamed from tests/type_definitions/fizz.d.ts) | 0 | ||||
-rw-r--r-- | cli/tests/type_definitions/fizz.js (renamed from tests/type_definitions/fizz.js) | 0 | ||||
-rw-r--r-- | cli/tests/type_definitions/foo.d.ts (renamed from tests/type_definitions/foo.d.ts) | 0 | ||||
-rw-r--r-- | cli/tests/type_definitions/foo.js (renamed from tests/type_definitions/foo.js) | 0 | ||||
-rw-r--r-- | cli/tests/type_definitions/qat.ts (renamed from tests/type_definitions/qat.ts) | 0 | ||||
-rw-r--r-- | cli/tests/types.out (renamed from tests/types.out) | 0 | ||||
-rw-r--r-- | cli/tests/unbuffered_stderr.ts (renamed from tests/unbuffered_stderr.ts) | 0 | ||||
-rw-r--r-- | cli/tests/unbuffered_stderr.ts.out (renamed from tests/unbuffered_stderr.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/unbuffered_stdout.ts (renamed from tests/unbuffered_stdout.ts) | 0 | ||||
-rw-r--r-- | cli/tests/unbuffered_stdout.ts.out (renamed from tests/unbuffered_stdout.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/v8_flags.js (renamed from tests/v8_flags.js) | 0 | ||||
-rw-r--r-- | cli/tests/v8_flags.js.out (renamed from tests/v8_flags.js.out) | 0 | ||||
-rw-r--r-- | cli/tests/v8_help.out (renamed from tests/v8_help.out) | 0 | ||||
-rw-r--r-- | cli/tests/version.out (renamed from tests/version.out) | 0 | ||||
-rw-r--r-- | cli/tests/wasm.ts (renamed from tests/wasm.ts) | 0 | ||||
-rw-r--r-- | cli/tests/wasm.ts.out (renamed from tests/wasm.ts.out) | 0 | ||||
-rw-r--r-- | cli/tests/wasm_async.js (renamed from tests/wasm_async.js) | 0 | ||||
-rw-r--r-- | cli/tests/wasm_async.out (renamed from tests/wasm_async.out) | 0 | ||||
-rw-r--r-- | cli/tests/workers_round_robin_bench.ts (renamed from tests/workers_round_robin_bench.ts) | 0 | ||||
-rw-r--r-- | cli/tests/workers_startup_bench.ts (renamed from tests/workers_startup_bench.ts) | 0 | ||||
-rw-r--r-- | js/stat_test.ts | 18 | ||||
l--------- | tests | 1 | ||||
-rw-r--r-- | tests/README.md | 7 |
228 files changed, 474 insertions, 464 deletions
diff --git a/.eslintignore b/.eslintignore index a76bd6824..1b9e35537 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,2 @@ /js/deps/ -/tests/error_syntax.js +cli/tests/error_syntax.js diff --git a/.prettierignore b/.prettierignore index 695354438..10caa2fbc 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,2 @@ -tests/error_syntax.js -tests/badly_formatted.js +cli/tests/error_syntax.js +cli/tests/badly_formatted.js
\ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index b63359713..9fe95b1fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -266,7 +266,7 @@ dependencies = [ [[package]] name = "deno_cli" -version = "0.18.3" +version = "0.18.4" dependencies = [ "ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index cf51781fa..b9a9c1456 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,11 +1,8 @@ # Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -[[bin]] -name = "deno" -path = "main.rs" [package] name = "deno_cli" -version = "0.18.3" +version = "0.18.4" license = "MIT" authors = ["the Deno authors"] edition = "2018" @@ -13,6 +10,14 @@ description = "Provides the deno executable" repository = "https://github.com/denoland/deno" default-run = "deno" +[lib] +name = "deno_cli" +path = "lib.rs" + +[[bin]] +name = "deno" +path = "main.rs" + [dependencies] deno = { path = "../core", version = "0.18.0" } deno_cli_snapshots = { path = "../js", version = "0.18.3" } diff --git a/cli/colors.rs b/cli/colors.rs index 7ca42e2f5..9c2c7a401 100644 --- a/cli/colors.rs +++ b/cli/colors.rs @@ -21,7 +21,6 @@ lazy_static! { } /// Helper function to strip ansi codes. -#[cfg(test)] pub fn strip_ansi_codes(s: &str) -> std::borrow::Cow<str> { STRIP_ANSI_RE.replace_all(s, "") } diff --git a/cli/compilers/ts.rs b/cli/compilers/ts.rs index 8330d86e9..fc280a898 100644 --- a/cli/compilers/ts.rs +++ b/cli/compilers/ts.rs @@ -670,7 +670,7 @@ mod tests { url: specifier.as_url().clone(), filename: PathBuf::from(p.to_str().unwrap().to_string()), media_type: msg::MediaType::TypeScript, - source_code: include_bytes!("../../tests/002_hello.ts").to_vec(), + source_code: include_bytes!("../tests/002_hello.ts").to_vec(), }; let mock_state = ThreadSafeState::mock(vec![ diff --git a/cli/lib.rs b/cli/lib.rs new file mode 100644 index 000000000..ff8f02239 --- /dev/null +++ b/cli/lib.rs @@ -0,0 +1,437 @@ +// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; +#[macro_use] +extern crate futures; +#[macro_use] +extern crate serde_json; +extern crate clap; +extern crate deno; +extern crate deno_cli_snapshots; +extern crate indexmap; +#[cfg(unix)] +extern crate nix; +extern crate rand; +extern crate serde; +extern crate serde_derive; +extern crate url; + +pub mod colors; +pub mod compilers; +pub mod deno_dir; +pub mod deno_error; +pub mod diagnostics; +mod disk_cache; +mod file_fetcher; +pub mod flags; +pub mod fmt_errors; +mod fs; +mod global_timer; +mod http_body; +mod http_util; +mod import_map; +pub mod msg; +pub mod ops; +pub mod permissions; +mod progress; +mod repl; +pub mod resolve_addr; +pub mod resources; +mod shell; +mod signal; +pub mod source_maps; +mod startup_data; +pub mod state; +mod tokio_read; +mod tokio_util; +mod tokio_write; +pub mod version; +pub mod worker; + +use crate::progress::Progress; +use crate::state::ThreadSafeState; +use crate::worker::Worker; +use deno::v8_set_flags; +use deno::ErrBox; +use deno::ModuleSpecifier; +use flags::DenoFlags; +use flags::DenoSubcommand; +use futures::lazy; +use futures::Future; +use log::Level; +use log::Metadata; +use log::Record; +use std::env; + +static LOGGER: Logger = Logger; + +struct Logger; + +impl log::Log for Logger { + fn enabled(&self, metadata: &Metadata) -> bool { + metadata.level() <= log::max_level() + } + + fn log(&self, record: &Record) { + if self.enabled(record.metadata()) { + let mut target = record.target().to_string(); + + if let Some(line_no) = record.line() { + target.push_str(":"); + target.push_str(&line_no.to_string()); + } + + println!("{} RS - {} - {}", record.level(), target, record.args()); + } + } + fn flush(&self) {} +} + +fn print_err_and_exit(err: ErrBox) { + eprintln!("{}", err.to_string()); + std::process::exit(1); +} + +fn js_check(r: Result<(), ErrBox>) { + if let Err(err) = r { + print_err_and_exit(err); + } +} + +fn create_worker_and_state( + flags: DenoFlags, + argv: Vec<String>, +) -> (Worker, ThreadSafeState) { + use crate::shell::Shell; + use std::sync::Arc; + use std::sync::Mutex; + let shell = Arc::new(Mutex::new(Shell::new())); + let progress = Progress::new(); + progress.set_callback(move |_done, _completed, _total, status, msg| { + if !status.is_empty() { + let mut s = shell.lock().unwrap(); + s.status(status, msg).expect("shell problem"); + } + }); + // TODO(kevinkassimo): maybe make include_deno_namespace also configurable? + let state = ThreadSafeState::new(flags, argv, progress, true) + .map_err(print_err_and_exit) + .unwrap(); + let worker = Worker::new( + "main".to_string(), + startup_data::deno_isolate_init(), + state.clone(), + ); + + (worker, state) +} + +fn types_command() { + let content = deno_cli_snapshots::get_asset("lib.deno_runtime.d.ts").unwrap(); + println!("{}", content); +} + +fn print_cache_info(worker: Worker) { + let state = worker.state; + + println!( + "{} {:?}", + colors::bold("DENO_DIR location:".to_string()), + state.dir.root + ); + println!( + "{} {:?}", + colors::bold("Remote modules cache:".to_string()), + state.dir.deps_cache.location + ); + println!( + "{} {:?}", + colors::bold("TypeScript compiler cache:".to_string()), + state.dir.gen_cache.location + ); +} + +pub fn print_file_info( + worker: Worker, + module_specifier: &ModuleSpecifier, +) -> impl Future<Item = Worker, Error = ()> { + let state_ = worker.state.clone(); + let module_specifier_ = module_specifier.clone(); + + state_ + .file_fetcher + .fetch_source_file_async(&module_specifier) + .map_err(|err| println!("{}", err)) + .and_then(|out| { + println!( + "{} {}", + colors::bold("local:".to_string()), + out.filename.to_str().unwrap() + ); + + println!( + "{} {}", + colors::bold("type:".to_string()), + msg::enum_name_media_type(out.media_type) + ); + + state_ + .clone() + .fetch_compiled_module(&module_specifier_) + .map_err(|e| { + debug!("compiler error exiting!"); + eprintln!("\n{}", e.to_string()); + std::process::exit(1); + }) + .and_then(move |compiled| { + if out.media_type == msg::MediaType::TypeScript + || (out.media_type == msg::MediaType::JavaScript + && state_.ts_compiler.compile_js) + { + let compiled_source_file = state_ + .ts_compiler + .get_compiled_source_file(&out.url) + .unwrap(); + + println!( + "{} {}", + colors::bold("compiled:".to_string()), + compiled_source_file.filename.to_str().unwrap(), + ); + } + + if let Ok(source_map) = state_ + .clone() + .ts_compiler + .get_source_map_file(&module_specifier_) + { + println!( + "{} {}", + colors::bold("map:".to_string()), + source_map.filename.to_str().unwrap() + ); + } + + if let Some(deps) = + worker.state.modules.lock().unwrap().deps(&compiled.name) + { + println!("{}{}", colors::bold("deps:\n".to_string()), deps.name); + if let Some(ref depsdeps) = deps.deps { + for d in depsdeps { + println!("{}", d); + } + } + } else { + println!( + "{} cannot retrieve full dependency graph", + colors::bold("deps:".to_string()), + ); + } + Ok(worker) + }) + }) +} + +fn info_command(flags: DenoFlags, argv: Vec<String>) { + let (mut worker, state) = create_worker_and_state(flags, argv.clone()); + + // If it was just "deno info" print location of caches and exit + if argv.len() == 1 { + return print_cache_info(worker); + } + + let main_module = state.main_module().unwrap(); + let main_future = lazy(move || { + // Setup runtime. + js_check(worker.execute("denoMain()")); + debug!("main_module {}", main_module); + + worker + .execute_mod_async(&main_module, true) + .map_err(print_err_and_exit) + .and_then(move |()| print_file_info(worker, &main_module)) + .and_then(|worker| { + worker.then(|result| { + js_check(result); + Ok(()) + }) + }) + }); + tokio_util::run(main_future); +} + +fn fetch_command(flags: DenoFlags, argv: Vec<String>) { + let (mut worker, state) = create_worker_and_state(flags, argv.clone()); + + let main_module = state.main_module().unwrap(); + let main_future = lazy(move || { + // Setup runtime. + js_check(worker.execute("denoMain()")); + debug!("main_module {}", main_module); + + worker.execute_mod_async(&main_module, true).then(|result| { + js_check(result); + Ok(()) + }) + }); + tokio_util::run(main_future); +} + +fn eval_command(flags: DenoFlags, argv: Vec<String>) { + let (mut worker, state) = create_worker_and_state(flags, argv); + // Wrap provided script in async function so asynchronous methods + // work. This is required until top-level await is not supported. + let js_source = format!( + "async function _topLevelWrapper(){{ + {} + }} + _topLevelWrapper(); + ", + &state.argv[1] + ); + + let main_future = lazy(move || { + js_check(worker.execute("denoMain()")); + // ATM imports in `deno eval` are not allowed + // TODO Support ES modules once Worker supports evaluating anonymous modules. + js_check(worker.execute(&js_source)); + worker.then(|result| { + js_check(result); + Ok(()) + }) + }); + tokio_util::run(main_future); +} + +fn xeval_command(flags: DenoFlags, argv: Vec<String>) { + let xeval_replvar = flags.xeval_replvar.clone().unwrap(); + let (mut worker, state) = create_worker_and_state(flags, argv); + let xeval_source = format!( + "window._xevalWrapper = async function ({}){{ + {} + }}", + &xeval_replvar, &state.argv[1] + ); + + let main_future = lazy(move || { + // Setup runtime. + js_check(worker.execute(&xeval_source)); + js_check(worker.execute("denoMain()")); + worker + .then(|result| { + js_check(result); + Ok(()) + }) + .map_err(print_err_and_exit) + }); + tokio_util::run(main_future); +} + +fn bundle_command(flags: DenoFlags, argv: Vec<String>) { + let (mut _worker, state) = create_worker_and_state(flags, argv); + + let main_module = state.main_module().unwrap(); + assert!(state.argv.len() >= 3); + let out_file = state.argv[2].clone(); + debug!(">>>>> bundle_async START"); + let bundle_future = state + .ts_compiler + .bundle_async(state.clone(), main_module.to_string(), out_file) + .map_err(|err| { + debug!("diagnostics returned, exiting!"); + eprintln!(""); + print_err_and_exit(err); + }) + .and_then(move |_| { + debug!(">>>>> bundle_async END"); + Ok(()) + }); + tokio_util::run(bundle_future); +} + +fn run_repl(flags: DenoFlags, argv: Vec<String>) { + let (mut worker, _state) = create_worker_and_state(flags, argv); + + // REPL situation. + let main_future = lazy(move || { + // Setup runtime. + js_check(worker.execute("denoMain()")); + worker + .then(|result| { + js_check(result); + Ok(()) + }) + .map_err(|(err, _worker): (ErrBox, Worker)| print_err_and_exit(err)) + }); + tokio_util::run(main_future); +} + +fn run_script(flags: DenoFlags, argv: Vec<String>) { + let use_current_thread = flags.current_thread; + let (mut worker, state) = create_worker_and_state(flags, argv); + + let main_module = state.main_module().unwrap(); + // Normal situation of executing a module. + let main_future = lazy(move || { + // Setup runtime. + js_check(worker.execute("denoMain()")); + debug!("main_module {}", main_module); + + worker + .execute_mod_async(&main_module, false) + .and_then(move |()| { + js_check(worker.execute("window.dispatchEvent(new Event('load'))")); + worker.then(|result| { + js_check(result); + Ok(()) + }) + }) + .map_err(print_err_and_exit) + }); + + if use_current_thread { + tokio_util::run_on_current_thread(main_future); + } else { + tokio_util::run(main_future); + } +} + +fn version_command() { + println!("deno: {}", version::DENO); + println!("v8: {}", version::v8()); + println!("typescript: {}", version::TYPESCRIPT); +} + +pub fn main() { + #[cfg(windows)] + ansi_term::enable_ansi_support().ok(); // For Windows 10 + + log::set_logger(&LOGGER).unwrap(); + let args: Vec<String> = env::args().collect(); + let (flags, subcommand, argv) = flags::flags_from_vec(args); + + if let Some(ref v8_flags) = flags.v8_flags { + v8_set_flags(v8_flags.clone()); + } + + let log_level = match flags.log_level { + Some(level) => level, + None => Level::Warn, + }; + log::set_max_level(log_level.to_level_filter()); + + match subcommand { + DenoSubcommand::Bundle => bundle_command(flags, argv), + DenoSubcommand::Completions => {} + DenoSubcommand::Eval => eval_command(flags, argv), + DenoSubcommand::Fetch => fetch_command(flags, argv), + DenoSubcommand::Info => info_command(flags, argv), + DenoSubcommand::Repl => run_repl(flags, argv), + DenoSubcommand::Run => run_script(flags, argv), + DenoSubcommand::Types => types_command(), + DenoSubcommand::Version => version_command(), + DenoSubcommand::Xeval => xeval_command(flags, argv), + } +} diff --git a/cli/main.rs b/cli/main.rs index e535b70bd..b24c61a9b 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -1,440 +1,5 @@ -// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -#[macro_use] -extern crate lazy_static; -#[macro_use] -extern crate log; -#[macro_use] -extern crate futures; -#[macro_use] -extern crate serde_json; -extern crate clap; -extern crate deno; -extern crate deno_cli_snapshots; -extern crate indexmap; -#[cfg(unix)] -extern crate nix; -extern crate rand; -extern crate serde; -extern crate serde_derive; -extern crate url; - -#[cfg(test)] -mod integration_tests; - -mod colors; -pub mod compilers; -pub mod deno_dir; -pub mod deno_error; -pub mod diagnostics; -mod disk_cache; -mod file_fetcher; -pub mod flags; -pub mod fmt_errors; -mod fs; -mod global_timer; -mod http_body; -mod http_util; -mod import_map; -pub mod msg; -pub mod ops; -pub mod permissions; -mod progress; -mod repl; -pub mod resolve_addr; -pub mod resources; -mod shell; -mod signal; -pub mod source_maps; -mod startup_data; -pub mod state; -mod tokio_read; -mod tokio_util; -mod tokio_write; -pub mod version; -pub mod worker; - -use crate::progress::Progress; -use crate::state::ThreadSafeState; -use crate::worker::Worker; -use deno::v8_set_flags; -use deno::ErrBox; -use deno::ModuleSpecifier; -use flags::DenoFlags; -use flags::DenoSubcommand; -use futures::lazy; -use futures::Future; -use log::Level; -use log::Metadata; -use log::Record; -use std::env; - -static LOGGER: Logger = Logger; - -struct Logger; - -impl log::Log for Logger { - fn enabled(&self, metadata: &Metadata) -> bool { - metadata.level() <= log::max_level() - } - - fn log(&self, record: &Record) { - if self.enabled(record.metadata()) { - let mut target = record.target().to_string(); - - if let Some(line_no) = record.line() { - target.push_str(":"); - target.push_str(&line_no.to_string()); - } - - println!("{} RS - {} - {}", record.level(), target, record.args()); - } - } - fn flush(&self) {} -} - -fn print_err_and_exit(err: ErrBox) { - eprintln!("{}", err.to_string()); - std::process::exit(1); -} - -fn js_check(r: Result<(), ErrBox>) { - if let Err(err) = r { - print_err_and_exit(err); - } -} - -fn create_worker_and_state( - flags: DenoFlags, - argv: Vec<String>, -) -> (Worker, ThreadSafeState) { - use crate::shell::Shell; - use std::sync::Arc; - use std::sync::Mutex; - let shell = Arc::new(Mutex::new(Shell::new())); - let progress = Progress::new(); - progress.set_callback(move |_done, _completed, _total, status, msg| { - if !status.is_empty() { - let mut s = shell.lock().unwrap(); - s.status(status, msg).expect("shell problem"); - } - }); - // TODO(kevinkassimo): maybe make include_deno_namespace also configurable? - let state = ThreadSafeState::new(flags, argv, progress, true) - .map_err(print_err_and_exit) - .unwrap(); - let worker = Worker::new( - "main".to_string(), - startup_data::deno_isolate_init(), - state.clone(), - ); - - (worker, state) -} - -fn types_command() { - let content = deno_cli_snapshots::get_asset("lib.deno_runtime.d.ts").unwrap(); - println!("{}", content); -} - -fn print_cache_info(worker: Worker) { - let state = worker.state; - - println!( - "{} {:?}", - colors::bold("DENO_DIR location:".to_string()), - state.dir.root - ); - println!( - "{} {:?}", - colors::bold("Remote modules cache:".to_string()), - state.dir.deps_cache.location - ); - println!( - "{} {:?}", - colors::bold("TypeScript compiler cache:".to_string()), - state.dir.gen_cache.location - ); -} - -pub fn print_file_info( - worker: Worker, - module_specifier: &ModuleSpecifier, -) -> impl Future<Item = Worker, Error = ()> { - let state_ = worker.state.clone(); - let module_specifier_ = module_specifier.clone(); - - state_ - .file_fetcher - .fetch_source_file_async(&module_specifier) - .map_err(|err| println!("{}", err)) - .and_then(|out| { - println!( - "{} {}", - colors::bold("local:".to_string()), - out.filename.to_str().unwrap() - ); - - println!( - "{} {}", - colors::bold("type:".to_string()), - msg::enum_name_media_type(out.media_type) - ); - - state_ - .clone() - .fetch_compiled_module(&module_specifier_) - .map_err(|e| { - debug!("compiler error exiting!"); - eprintln!("\n{}", e.to_string()); - std::process::exit(1); - }) - .and_then(move |compiled| { - if out.media_type == msg::MediaType::TypeScript - || (out.media_type == msg::MediaType::JavaScript - && state_.ts_compiler.compile_js) - { - let compiled_source_file = state_ - .ts_compiler - .get_compiled_source_file(&out.url) - .unwrap(); - - println!( - "{} {}", - colors::bold("compiled:".to_string()), - compiled_source_file.filename.to_str().unwrap(), - ); - } - - if let Ok(source_map) = state_ - .clone() - .ts_compiler - .get_source_map_file(&module_specifier_) - { - println!( - "{} {}", - colors::bold("map:".to_string()), - source_map.filename.to_str().unwrap() - ); - } - - if let Some(deps) = - worker.state.modules.lock().unwrap().deps(&compiled.name) - { - println!("{}{}", colors::bold("deps:\n".to_string()), deps.name); - if let Some(ref depsdeps) = deps.deps { - for d in depsdeps { - println!("{}", d); - } - } - } else { - println!( - "{} cannot retrieve full dependency graph", - colors::bold("deps:".to_string()), - ); - } - Ok(worker) - }) - }) -} - -fn info_command(flags: DenoFlags, argv: Vec<String>) { - let (mut worker, state) = create_worker_and_state(flags, argv.clone()); - - // If it was just "deno info" print location of caches and exit - if argv.len() == 1 { - return print_cache_info(worker); - } - - let main_module = state.main_module().unwrap(); - let main_future = lazy(move || { - // Setup runtime. - js_check(worker.execute("denoMain()")); - debug!("main_module {}", main_module); - - worker - .execute_mod_async(&main_module, true) - .map_err(print_err_and_exit) - .and_then(move |()| print_file_info(worker, &main_module)) - .and_then(|worker| { - worker.then(|result| { - js_check(result); - Ok(()) - }) - }) - }); - tokio_util::run(main_future); -} - -fn fetch_command(flags: DenoFlags, argv: Vec<String>) { - let (mut worker, state) = create_worker_and_state(flags, argv.clone()); - - let main_module = state.main_module().unwrap(); - let main_future = lazy(move || { - // Setup runtime. - js_check(worker.execute("denoMain()")); - debug!("main_module {}", main_module); - - worker.execute_mod_async(&main_module, true).then(|result| { - js_check(result); - Ok(()) - }) - }); - tokio_util::run(main_future); -} - -fn eval_command(flags: DenoFlags, argv: Vec<String>) { - let (mut worker, state) = create_worker_and_state(flags, argv); - // Wrap provided script in async function so asynchronous methods - // work. This is required until top-level await is not supported. - let js_source = format!( - "async function _topLevelWrapper(){{ - {} - }} - _topLevelWrapper(); - ", - &state.argv[1] - ); - - let main_future = lazy(move || { - js_check(worker.execute("denoMain()")); - // ATM imports in `deno eval` are not allowed - // TODO Support ES modules once Worker supports evaluating anonymous modules. - js_check(worker.execute(&js_source)); - worker.then(|result| { - js_check(result); - Ok(()) - }) - }); - tokio_util::run(main_future); -} - -fn xeval_command(flags: DenoFlags, argv: Vec<String>) { - let xeval_replvar = flags.xeval_replvar.clone().unwrap(); - let (mut worker, state) = create_worker_and_state(flags, argv); - let xeval_source = format!( - "window._xevalWrapper = async function ({}){{ - {} - }}", - &xeval_replvar, &state.argv[1] - ); - - let main_future = lazy(move || { - // Setup runtime. - js_check(worker.execute(&xeval_source)); - js_check(worker.execute("denoMain()")); - worker - .then(|result| { - js_check(result); - Ok(()) - }) - .map_err(print_err_and_exit) - }); - tokio_util::run(main_future); -} - -fn bundle_command(flags: DenoFlags, argv: Vec<String>) { - let (mut _worker, state) = create_worker_and_state(flags, argv); - - let main_module = state.main_module().unwrap(); - assert!(state.argv.len() >= 3); - let out_file = state.argv[2].clone(); - debug!(">>>>> bundle_async START"); - let bundle_future = state - .ts_compiler - .bundle_async(state.clone(), main_module.to_string(), out_file) - .map_err(|err| { - debug!("diagnostics returned, exiting!"); - eprintln!(""); - print_err_and_exit(err); - }) - .and_then(move |_| { - debug!(">>>>> bundle_async END"); - Ok(()) - }); - tokio_util::run(bundle_future); -} - -fn run_repl(flags: DenoFlags, argv: Vec<String>) { - let (mut worker, _state) = create_worker_and_state(flags, argv); - - // REPL situation. - let main_future = lazy(move || { - // Setup runtime. - js_check(worker.execute("denoMain()")); - worker - .then(|result| { - js_check(result); - Ok(()) - }) - .map_err(|(err, _worker): (ErrBox, Worker)| print_err_and_exit(err)) - }); - tokio_util::run(main_future); -} - -fn run_script(flags: DenoFlags, argv: Vec<String>) { - let use_current_thread = flags.current_thread; - let (mut worker, state) = create_worker_and_state(flags, argv); - - let main_module = state.main_module().unwrap(); - // Normal situation of executing a module. - let main_future = lazy(move || { - // Setup runtime. - js_check(worker.execute("denoMain()")); - debug!("main_module {}", main_module); - - worker - .execute_mod_async(&main_module, false) - .and_then(move |()| { - js_check(worker.execute("window.dispatchEvent(new Event('load'))")); - worker.then(|result| { - js_check(result); - Ok(()) - }) - }) - .map_err(print_err_and_exit) - }); - - if use_current_thread { - tokio_util::run_on_current_thread(main_future); - } else { - tokio_util::run(main_future); - } -} - -fn version_command() { - println!("deno: {}", version::DENO); - println!("v8: {}", version::v8()); - println!("typescript: {}", version::TYPESCRIPT); -} +extern crate deno_cli; fn main() { - #[cfg(windows)] - ansi_term::enable_ansi_support().ok(); // For Windows 10 - - log::set_logger(&LOGGER).unwrap(); - let args: Vec<String> = env::args().collect(); - let (flags, subcommand, argv) = flags::flags_from_vec(args); - - if let Some(ref v8_flags) = flags.v8_flags { - v8_set_flags(v8_flags.clone()); - } - - let log_level = match flags.log_level { - Some(level) => level, - None => Level::Warn, - }; - log::set_max_level(log_level.to_level_filter()); - - match subcommand { - DenoSubcommand::Bundle => bundle_command(flags, argv), - DenoSubcommand::Completions => {} - DenoSubcommand::Eval => eval_command(flags, argv), - DenoSubcommand::Fetch => fetch_command(flags, argv), - DenoSubcommand::Info => info_command(flags, argv), - DenoSubcommand::Repl => run_repl(flags, argv), - DenoSubcommand::Run => run_script(flags, argv), - DenoSubcommand::Types => types_command(), - DenoSubcommand::Version => version_command(), - DenoSubcommand::Xeval => xeval_command(flags, argv), - } + deno_cli::main(); } diff --git a/tests/001_hello.js b/cli/tests/001_hello.js index accefceba..accefceba 100644 --- a/tests/001_hello.js +++ b/cli/tests/001_hello.js diff --git a/tests/001_hello.js.out b/cli/tests/001_hello.js.out index 557db03de..557db03de 100644 --- a/tests/001_hello.js.out +++ b/cli/tests/001_hello.js.out diff --git a/tests/002_hello.ts b/cli/tests/002_hello.ts index accefceba..accefceba 100644 --- a/tests/002_hello.ts +++ b/cli/tests/002_hello.ts diff --git a/tests/002_hello.ts.out b/cli/tests/002_hello.ts.out index 557db03de..557db03de 100644 --- a/tests/002_hello.ts.out +++ b/cli/tests/002_hello.ts.out diff --git a/tests/003_relative_import.ts b/cli/tests/003_relative_import.ts index 01d5d7faa..01d5d7faa 100644 --- a/tests/003_relative_import.ts +++ b/cli/tests/003_relative_import.ts diff --git a/tests/003_relative_import.ts.out b/cli/tests/003_relative_import.ts.out index e965047ad..e965047ad 100644 --- a/tests/003_relative_import.ts.out +++ b/cli/tests/003_relative_import.ts.out diff --git a/tests/004_set_timeout.ts b/cli/tests/004_set_timeout.ts index 58f899ee3..58f899ee3 100644 --- a/tests/004_set_timeout.ts +++ b/cli/tests/004_set_timeout.ts diff --git a/tests/004_set_timeout.ts.out b/cli/tests/004_set_timeout.ts.out index f9264f7fb..f9264f7fb 100644 --- a/tests/004_set_timeout.ts.out +++ b/cli/tests/004_set_timeout.ts.out diff --git a/tests/005_more_imports.ts b/cli/tests/005_more_imports.ts index 52dd1df7b..52dd1df7b 100644 --- a/tests/005_more_imports.ts +++ b/cli/tests/005_more_imports.ts diff --git a/tests/005_more_imports.ts.out b/cli/tests/005_more_imports.ts.out index e965047ad..e965047ad 100644 --- a/tests/005_more_imports.ts.out +++ b/cli/tests/005_more_imports.ts.out diff --git a/tests/006_url_imports.ts b/cli/tests/006_url_imports.ts index b2c7db270..b2c7db270 100644 --- a/tests/006_url_imports.ts +++ b/cli/tests/006_url_imports.ts diff --git a/tests/006_url_imports.ts.out b/cli/tests/006_url_imports.ts.out index 989ce33e9..989ce33e9 100644 --- a/tests/006_url_imports.ts.out +++ b/cli/tests/006_url_imports.ts.out diff --git a/tests/012_async.ts b/cli/tests/012_async.ts index 1f1822c04..1f1822c04 100644 --- a/tests/012_async.ts +++ b/cli/tests/012_async.ts diff --git a/tests/012_async.ts.out b/cli/tests/012_async.ts.out index 01e79c32a..01e79c32a 100644 --- a/tests/012_async.ts.out +++ b/cli/tests/012_async.ts.out diff --git a/tests/013_dynamic_import.ts b/cli/tests/013_dynamic_import.ts index 6bbce3132..6bbce3132 100644 --- a/tests/013_dynamic_import.ts +++ b/cli/tests/013_dynamic_import.ts diff --git a/tests/013_dynamic_import.ts.out b/cli/tests/013_dynamic_import.ts.out index e965047ad..e965047ad 100644 --- a/tests/013_dynamic_import.ts.out +++ b/cli/tests/013_dynamic_import.ts.out diff --git a/tests/014_duplicate_import.ts b/cli/tests/014_duplicate_import.ts index 97864fea7..97864fea7 100644 --- a/tests/014_duplicate_import.ts +++ b/cli/tests/014_duplicate_import.ts diff --git a/tests/014_duplicate_import.ts.out b/cli/tests/014_duplicate_import.ts.out index 4effa19f4..4effa19f4 100644 --- a/tests/014_duplicate_import.ts.out +++ b/cli/tests/014_duplicate_import.ts.out diff --git a/tests/015_duplicate_parallel_import.js b/cli/tests/015_duplicate_parallel_import.js index 37033cfa2..37033cfa2 100644 --- a/tests/015_duplicate_parallel_import.js +++ b/cli/tests/015_duplicate_parallel_import.js diff --git a/tests/015_duplicate_parallel_import.js.out b/cli/tests/015_duplicate_parallel_import.js.out index e965047ad..e965047ad 100644 --- a/tests/015_duplicate_parallel_import.js.out +++ b/cli/tests/015_duplicate_parallel_import.js.out diff --git a/tests/016_double_await.ts b/cli/tests/016_double_await.ts index 9b4801567..9b4801567 100644 --- a/tests/016_double_await.ts +++ b/cli/tests/016_double_await.ts diff --git a/tests/016_double_await.ts.out b/cli/tests/016_double_await.ts.out index da29283aa..da29283aa 100644 --- a/tests/016_double_await.ts.out +++ b/cli/tests/016_double_await.ts.out diff --git a/tests/017_import_redirect.ts b/cli/tests/017_import_redirect.ts index 1265dd4ed..1265dd4ed 100644 --- a/tests/017_import_redirect.ts +++ b/cli/tests/017_import_redirect.ts diff --git a/tests/017_import_redirect.ts.out b/cli/tests/017_import_redirect.ts.out index e965047ad..e965047ad 100644 --- a/tests/017_import_redirect.ts.out +++ b/cli/tests/017_import_redirect.ts.out diff --git a/tests/018_async_catch.ts b/cli/tests/018_async_catch.ts index 0d034d798..0d034d798 100644 --- a/tests/018_async_catch.ts +++ b/cli/tests/018_async_catch.ts diff --git a/tests/018_async_catch.ts.out b/cli/tests/018_async_catch.ts.out index 4fc219973..4fc219973 100644 --- a/tests/018_async_catch.ts.out +++ b/cli/tests/018_async_catch.ts.out diff --git a/tests/019_media_types.ts b/cli/tests/019_media_types.ts index 5f1f862a0..5f1f862a0 100644 --- a/tests/019_media_types.ts +++ b/cli/tests/019_media_types.ts diff --git a/tests/019_media_types.ts.out b/cli/tests/019_media_types.ts.out index 7b5fdd44f..7b5fdd44f 100644 --- a/tests/019_media_types.ts.out +++ b/cli/tests/019_media_types.ts.out diff --git a/tests/020_json_modules.ts b/cli/tests/020_json_modules.ts index fdc85c440..fdc85c440 100644 --- a/tests/020_json_modules.ts +++ b/cli/tests/020_json_modules.ts diff --git a/tests/020_json_modules.ts.out b/cli/tests/020_json_modules.ts.out index 5d1623e6b..5d1623e6b 100644 --- a/tests/020_json_modules.ts.out +++ b/cli/tests/020_json_modules.ts.out diff --git a/tests/021_mjs_modules.ts b/cli/tests/021_mjs_modules.ts index 6052b9081..6052b9081 100644 --- a/tests/021_mjs_modules.ts +++ b/cli/tests/021_mjs_modules.ts diff --git a/tests/021_mjs_modules.ts.out b/cli/tests/021_mjs_modules.ts.out index 27ba77dda..27ba77dda 100644 --- a/tests/021_mjs_modules.ts.out +++ b/cli/tests/021_mjs_modules.ts.out diff --git a/tests/022_info_flag_script.out b/cli/tests/022_info_flag_script.out index 519e7cf6b..519e7cf6b 100644 --- a/tests/022_info_flag_script.out +++ b/cli/tests/022_info_flag_script.out diff --git a/tests/023_no_ext_with_headers b/cli/tests/023_no_ext_with_headers index 87951d835..87951d835 100644 --- a/tests/023_no_ext_with_headers +++ b/cli/tests/023_no_ext_with_headers diff --git a/tests/023_no_ext_with_headers.headers.json b/cli/tests/023_no_ext_with_headers.headers.json index 5b6f09aeb..5b6f09aeb 100644 --- a/tests/023_no_ext_with_headers.headers.json +++ b/cli/tests/023_no_ext_with_headers.headers.json diff --git a/tests/023_no_ext_with_headers.out b/cli/tests/023_no_ext_with_headers.out index e427984d4..e427984d4 100644 --- a/tests/023_no_ext_with_headers.out +++ b/cli/tests/023_no_ext_with_headers.out diff --git a/tests/024_import_no_ext_with_headers.ts b/cli/tests/024_import_no_ext_with_headers.ts index c8621d0e6..c8621d0e6 100644 --- a/tests/024_import_no_ext_with_headers.ts +++ b/cli/tests/024_import_no_ext_with_headers.ts diff --git a/tests/024_import_no_ext_with_headers.ts.out b/cli/tests/024_import_no_ext_with_headers.ts.out index e427984d4..e427984d4 100644 --- a/tests/024_import_no_ext_with_headers.ts.out +++ b/cli/tests/024_import_no_ext_with_headers.ts.out diff --git a/tests/025_hrtime.ts b/cli/tests/025_hrtime.ts index 417ca6982..417ca6982 100644 --- a/tests/025_hrtime.ts +++ b/cli/tests/025_hrtime.ts diff --git a/tests/025_hrtime.ts.out b/cli/tests/025_hrtime.ts.out index bb101b641..bb101b641 100644 --- a/tests/025_hrtime.ts.out +++ b/cli/tests/025_hrtime.ts.out diff --git a/tests/025_reload_js_type_error.js b/cli/tests/025_reload_js_type_error.js index 8d6e4b415..8d6e4b415 100644 --- a/tests/025_reload_js_type_error.js +++ b/cli/tests/025_reload_js_type_error.js diff --git a/tests/025_reload_js_type_error.js.out b/cli/tests/025_reload_js_type_error.js.out index ce0136250..ce0136250 100644 --- a/tests/025_reload_js_type_error.js.out +++ b/cli/tests/025_reload_js_type_error.js.out diff --git a/tests/026_redirect_javascript.js b/cli/tests/026_redirect_javascript.js index 226a6b622..226a6b622 100644 --- a/tests/026_redirect_javascript.js +++ b/cli/tests/026_redirect_javascript.js diff --git a/tests/026_redirect_javascript.js.out b/cli/tests/026_redirect_javascript.js.out index 290864299..290864299 100644 --- a/tests/026_redirect_javascript.js.out +++ b/cli/tests/026_redirect_javascript.js.out diff --git a/tests/026_workers.ts b/cli/tests/026_workers.ts index f45fc4b77..f45fc4b77 100644 --- a/tests/026_workers.ts +++ b/cli/tests/026_workers.ts diff --git a/tests/026_workers.ts.out b/cli/tests/026_workers.ts.out index 7538cc867..7538cc867 100644 --- a/tests/026_workers.ts.out +++ b/cli/tests/026_workers.ts.out diff --git a/tests/027_redirect_typescript.ts b/cli/tests/027_redirect_typescript.ts index 584341975..584341975 100644 --- a/tests/027_redirect_typescript.ts +++ b/cli/tests/027_redirect_typescript.ts diff --git a/tests/027_redirect_typescript.ts.out b/cli/tests/027_redirect_typescript.ts.out index 480d4e8ca..480d4e8ca 100644 --- a/tests/027_redirect_typescript.ts.out +++ b/cli/tests/027_redirect_typescript.ts.out diff --git a/tests/028_args.ts b/cli/tests/028_args.ts index 51c5cb14b..51c5cb14b 100644 --- a/tests/028_args.ts +++ b/cli/tests/028_args.ts diff --git a/tests/028_args.ts.out b/cli/tests/028_args.ts.out index fa36f6e4c..fa36f6e4c 100644 --- a/tests/028_args.ts.out +++ b/cli/tests/028_args.ts.out diff --git a/tests/029_eval.out b/cli/tests/029_eval.out index ce0136250..ce0136250 100644 --- a/tests/029_eval.out +++ b/cli/tests/029_eval.out diff --git a/tests/030_xeval.out b/cli/tests/030_xeval.out index b1e67221a..b1e67221a 100644 --- a/tests/030_xeval.out +++ b/cli/tests/030_xeval.out diff --git a/tests/031_xeval_replvar.out b/cli/tests/031_xeval_replvar.out index b1e67221a..b1e67221a 100644 --- a/tests/031_xeval_replvar.out +++ b/cli/tests/031_xeval_replvar.out diff --git a/tests/032_xeval_delim.out b/cli/tests/032_xeval_delim.out index b1e67221a..b1e67221a 100644 --- a/tests/032_xeval_delim.out +++ b/cli/tests/032_xeval_delim.out diff --git a/tests/033_import_map.out b/cli/tests/033_import_map.out index e9b9160e9..e9b9160e9 100644 --- a/tests/033_import_map.out +++ b/cli/tests/033_import_map.out diff --git a/tests/034_onload.out b/cli/tests/034_onload.out index 0939be8cd..0939be8cd 100644 --- a/tests/034_onload.out +++ b/cli/tests/034_onload.out diff --git a/tests/034_onload/imported.ts b/cli/tests/034_onload/imported.ts index 5cf2d7b4c..5cf2d7b4c 100644 --- a/tests/034_onload/imported.ts +++ b/cli/tests/034_onload/imported.ts diff --git a/tests/034_onload/main.ts b/cli/tests/034_onload/main.ts index 68851950a..68851950a 100644 --- a/tests/034_onload/main.ts +++ b/cli/tests/034_onload/main.ts diff --git a/tests/034_onload/nest_imported.ts b/cli/tests/034_onload/nest_imported.ts index 2e2bee1d5..2e2bee1d5 100644 --- a/tests/034_onload/nest_imported.ts +++ b/cli/tests/034_onload/nest_imported.ts diff --git a/tests/034_onload_imported.ts b/cli/tests/034_onload_imported.ts index d97aabeca..d97aabeca 100644 --- a/tests/034_onload_imported.ts +++ b/cli/tests/034_onload_imported.ts diff --git a/tests/035_no_fetch_flag.out b/cli/tests/035_no_fetch_flag.out index 0c835830c..0c835830c 100644 --- a/tests/035_no_fetch_flag.out +++ b/cli/tests/035_no_fetch_flag.out diff --git a/tests/036_import_map_fetch.out b/cli/tests/036_import_map_fetch.out index e69de29bb..e69de29bb 100644 --- a/tests/036_import_map_fetch.out +++ b/cli/tests/036_import_map_fetch.out diff --git a/tests/038_checkjs.js b/cli/tests/038_checkjs.js index 628d3e376..628d3e376 100644 --- a/tests/038_checkjs.js +++ b/cli/tests/038_checkjs.js diff --git a/tests/038_checkjs.js.out b/cli/tests/038_checkjs.js.out index deaf77211..deaf77211 100644 --- a/tests/038_checkjs.js.out +++ b/cli/tests/038_checkjs.js.out diff --git a/tests/038_checkjs.tsconfig.json b/cli/tests/038_checkjs.tsconfig.json index 08ac60b6c..08ac60b6c 100644 --- a/tests/038_checkjs.tsconfig.json +++ b/cli/tests/038_checkjs.tsconfig.json diff --git a/tests/039_worker_deno_ns.ts b/cli/tests/039_worker_deno_ns.ts index 80ada4343..80ada4343 100644 --- a/tests/039_worker_deno_ns.ts +++ b/cli/tests/039_worker_deno_ns.ts diff --git a/tests/039_worker_deno_ns.ts.out b/cli/tests/039_worker_deno_ns.ts.out index 9b2f90099..9b2f90099 100644 --- a/tests/039_worker_deno_ns.ts.out +++ b/cli/tests/039_worker_deno_ns.ts.out diff --git a/tests/039_worker_deno_ns/has_ns.ts b/cli/tests/039_worker_deno_ns/has_ns.ts index 8d2507122..8d2507122 100644 --- a/tests/039_worker_deno_ns/has_ns.ts +++ b/cli/tests/039_worker_deno_ns/has_ns.ts diff --git a/tests/039_worker_deno_ns/maybe_ns.ts b/cli/tests/039_worker_deno_ns/maybe_ns.ts index 0bcbd1f97..0bcbd1f97 100644 --- a/tests/039_worker_deno_ns/maybe_ns.ts +++ b/cli/tests/039_worker_deno_ns/maybe_ns.ts diff --git a/tests/039_worker_deno_ns/no_ns.ts b/cli/tests/039_worker_deno_ns/no_ns.ts index 0489a00a3..0489a00a3 100644 --- a/tests/039_worker_deno_ns/no_ns.ts +++ b/cli/tests/039_worker_deno_ns/no_ns.ts diff --git a/tests/040_worker_blob.ts b/cli/tests/040_worker_blob.ts index 1ba4528cf..1ba4528cf 100644 --- a/tests/040_worker_blob.ts +++ b/cli/tests/040_worker_blob.ts diff --git a/tests/040_worker_blob.ts.out b/cli/tests/040_worker_blob.ts.out index f49b8f3d6..f49b8f3d6 100644 --- a/tests/040_worker_blob.ts.out +++ b/cli/tests/040_worker_blob.ts.out diff --git a/tests/041_dyn_import_eval.out b/cli/tests/041_dyn_import_eval.out index 1dfef2e98..1dfef2e98 100644 --- a/tests/041_dyn_import_eval.out +++ b/cli/tests/041_dyn_import_eval.out diff --git a/tests/041_info_flag.out b/cli/tests/041_info_flag.out index c384fa892..c384fa892 100644 --- a/tests/041_info_flag.out +++ b/cli/tests/041_info_flag.out diff --git a/tests/042_dyn_import_evalcontext.ts b/cli/tests/042_dyn_import_evalcontext.ts index 124a406d2..124a406d2 100644 --- a/tests/042_dyn_import_evalcontext.ts +++ b/cli/tests/042_dyn_import_evalcontext.ts diff --git a/tests/042_dyn_import_evalcontext.ts.out b/cli/tests/042_dyn_import_evalcontext.ts.out index 1dfef2e98..1dfef2e98 100644 --- a/tests/042_dyn_import_evalcontext.ts.out +++ b/cli/tests/042_dyn_import_evalcontext.ts.out diff --git a/tests/043_xeval_delim2.out b/cli/tests/043_xeval_delim2.out index 312bdb964..312bdb964 100644 --- a/tests/043_xeval_delim2.out +++ b/cli/tests/043_xeval_delim2.out diff --git a/tests/043_xeval_delim2.test b/cli/tests/043_xeval_delim2.test index 1f009b3a7..1f009b3a7 100644 --- a/tests/043_xeval_delim2.test +++ b/cli/tests/043_xeval_delim2.test diff --git a/tests/044_bad_resource.test b/cli/tests/044_bad_resource.test index 8804fde1b..8804fde1b 100644 --- a/tests/044_bad_resource.test +++ b/cli/tests/044_bad_resource.test diff --git a/tests/044_bad_resource.ts b/cli/tests/044_bad_resource.ts index d2fc828f0..d2fc828f0 100644 --- a/tests/044_bad_resource.ts +++ b/cli/tests/044_bad_resource.ts diff --git a/tests/044_bad_resource.ts.out b/cli/tests/044_bad_resource.ts.out index 155e4396f..155e4396f 100644 --- a/tests/044_bad_resource.ts.out +++ b/cli/tests/044_bad_resource.ts.out diff --git a/cli/tests/README.md b/cli/tests/README.md new file mode 100644 index 000000000..dc199196d --- /dev/null +++ b/cli/tests/README.md @@ -0,0 +1,7 @@ +# Integration Tests + +This path contains integration tests. See integration_tests.rs for the index. + +TODO(ry) Currently //tests is a symlink to //cli/tests, to simplify transition. +In the future //tests should be removed when all references to //tests are +updated. diff --git a/tests/async_error.ts b/cli/tests/async_error.ts index 81c983a50..81c983a50 100644 --- a/tests/async_error.ts +++ b/cli/tests/async_error.ts diff --git a/tests/async_error.ts.out b/cli/tests/async_error.ts.out index d07ba8cfe..d07ba8cfe 100644 --- a/tests/async_error.ts.out +++ b/cli/tests/async_error.ts.out diff --git a/tests/badly_formatted.js b/cli/tests/badly_formatted.js index 17e3e6be0..17e3e6be0 100644 --- a/tests/badly_formatted.js +++ b/cli/tests/badly_formatted.js diff --git a/tests/badly_formatted_fixed.js b/cli/tests/badly_formatted_fixed.js index accefceba..accefceba 100644 --- a/tests/badly_formatted_fixed.js +++ b/cli/tests/badly_formatted_fixed.js diff --git a/tests/cat.ts b/cli/tests/cat.ts index 756238be6..756238be6 100644 --- a/tests/cat.ts +++ b/cli/tests/cat.ts diff --git a/tests/circular1.js b/cli/tests/circular1.js index 8b2cc4960..8b2cc4960 100644 --- a/tests/circular1.js +++ b/cli/tests/circular1.js diff --git a/tests/circular1.js.out b/cli/tests/circular1.js.out index 21f7fd585..21f7fd585 100644 --- a/tests/circular1.js.out +++ b/cli/tests/circular1.js.out diff --git a/tests/circular2.js b/cli/tests/circular2.js index 62127e04d..62127e04d 100644 --- a/tests/circular2.js +++ b/cli/tests/circular2.js diff --git a/tests/config.ts b/cli/tests/config.ts index e08061e77..e08061e77 100644 --- a/tests/config.ts +++ b/cli/tests/config.ts diff --git a/tests/config.ts.out b/cli/tests/config.ts.out index db5a8340e..db5a8340e 100644 --- a/tests/config.ts.out +++ b/cli/tests/config.ts.out diff --git a/tests/config.tsconfig.json b/cli/tests/config.tsconfig.json index 074d7ac0b..074d7ac0b 100644 --- a/tests/config.tsconfig.json +++ b/cli/tests/config.tsconfig.json diff --git a/tests/echo_server.ts b/cli/tests/echo_server.ts index 73995eab5..73995eab5 100644 --- a/tests/echo_server.ts +++ b/cli/tests/echo_server.ts diff --git a/tests/error_001.ts b/cli/tests/error_001.ts index f06f80cb4..f06f80cb4 100644 --- a/tests/error_001.ts +++ b/cli/tests/error_001.ts diff --git a/tests/error_001.ts.out b/cli/tests/error_001.ts.out index 3c7e2828e..3c7e2828e 100644 --- a/tests/error_001.ts.out +++ b/cli/tests/error_001.ts.out diff --git a/tests/error_002.ts b/cli/tests/error_002.ts index eb66764b7..eb66764b7 100644 --- a/tests/error_002.ts +++ b/cli/tests/error_002.ts diff --git a/tests/error_002.ts.out b/cli/tests/error_002.ts.out index 292544a33..292544a33 100644 --- a/tests/error_002.ts.out +++ b/cli/tests/error_002.ts.out diff --git a/tests/error_003_typescript.ts b/cli/tests/error_003_typescript.ts index 6fb077ea0..6fb077ea0 100644 --- a/tests/error_003_typescript.ts +++ b/cli/tests/error_003_typescript.ts diff --git a/tests/error_003_typescript.ts.out b/cli/tests/error_003_typescript.ts.out index f00a935e4..f00a935e4 100644 --- a/tests/error_003_typescript.ts.out +++ b/cli/tests/error_003_typescript.ts.out diff --git a/tests/error_004_missing_module.ts b/cli/tests/error_004_missing_module.ts index 24ae52cf7..24ae52cf7 100644 --- a/tests/error_004_missing_module.ts +++ b/cli/tests/error_004_missing_module.ts diff --git a/tests/error_004_missing_module.ts.out b/cli/tests/error_004_missing_module.ts.out index c2a0d0208..c2a0d0208 100644 --- a/tests/error_004_missing_module.ts.out +++ b/cli/tests/error_004_missing_module.ts.out diff --git a/tests/error_005_missing_dynamic_import.ts b/cli/tests/error_005_missing_dynamic_import.ts index 4c09feb5f..4c09feb5f 100644 --- a/tests/error_005_missing_dynamic_import.ts +++ b/cli/tests/error_005_missing_dynamic_import.ts diff --git a/tests/error_005_missing_dynamic_import.ts.out b/cli/tests/error_005_missing_dynamic_import.ts.out index ec1468b09..ec1468b09 100644 --- a/tests/error_005_missing_dynamic_import.ts.out +++ b/cli/tests/error_005_missing_dynamic_import.ts.out diff --git a/tests/error_006_import_ext_failure.ts b/cli/tests/error_006_import_ext_failure.ts index 3c32303a3..3c32303a3 100644 --- a/tests/error_006_import_ext_failure.ts +++ b/cli/tests/error_006_import_ext_failure.ts diff --git a/tests/error_006_import_ext_failure.ts.out b/cli/tests/error_006_import_ext_failure.ts.out index aa82c10aa..aa82c10aa 100644 --- a/tests/error_006_import_ext_failure.ts.out +++ b/cli/tests/error_006_import_ext_failure.ts.out diff --git a/tests/error_007_any.ts b/cli/tests/error_007_any.ts index 778886fcb..778886fcb 100644 --- a/tests/error_007_any.ts +++ b/cli/tests/error_007_any.ts diff --git a/tests/error_007_any.ts.out b/cli/tests/error_007_any.ts.out index 45dbffd04..45dbffd04 100644 --- a/tests/error_007_any.ts.out +++ b/cli/tests/error_007_any.ts.out diff --git a/tests/error_008_checkjs.js b/cli/tests/error_008_checkjs.js index 628d3e376..628d3e376 100644 --- a/tests/error_008_checkjs.js +++ b/cli/tests/error_008_checkjs.js diff --git a/tests/error_008_checkjs.js.out b/cli/tests/error_008_checkjs.js.out index 5c50e8513..5c50e8513 100644 --- a/tests/error_008_checkjs.js.out +++ b/cli/tests/error_008_checkjs.js.out diff --git a/tests/error_009_missing_js_module.disabled b/cli/tests/error_009_missing_js_module.disabled index b16bb232b..b16bb232b 100644 --- a/tests/error_009_missing_js_module.disabled +++ b/cli/tests/error_009_missing_js_module.disabled diff --git a/tests/error_009_missing_js_module.js b/cli/tests/error_009_missing_js_module.js index e6ca88934..e6ca88934 100644 --- a/tests/error_009_missing_js_module.js +++ b/cli/tests/error_009_missing_js_module.js diff --git a/tests/error_009_missing_js_module.js.out b/cli/tests/error_009_missing_js_module.js.out index edb08da1c..edb08da1c 100644 --- a/tests/error_009_missing_js_module.js.out +++ b/cli/tests/error_009_missing_js_module.js.out diff --git a/tests/error_010_nonexistent_arg.disabled b/cli/tests/error_010_nonexistent_arg.disabled index 9d183107c..9d183107c 100644 --- a/tests/error_010_nonexistent_arg.disabled +++ b/cli/tests/error_010_nonexistent_arg.disabled diff --git a/tests/error_010_nonexistent_arg.out b/cli/tests/error_010_nonexistent_arg.out index ef4f7b041..ef4f7b041 100644 --- a/tests/error_010_nonexistent_arg.out +++ b/cli/tests/error_010_nonexistent_arg.out diff --git a/tests/error_011_bad_module_specifier.ts b/cli/tests/error_011_bad_module_specifier.ts index e74d6b821..e74d6b821 100644 --- a/tests/error_011_bad_module_specifier.ts +++ b/cli/tests/error_011_bad_module_specifier.ts diff --git a/tests/error_011_bad_module_specifier.ts.out b/cli/tests/error_011_bad_module_specifier.ts.out index 97f59f2ca..97f59f2ca 100644 --- a/tests/error_011_bad_module_specifier.ts.out +++ b/cli/tests/error_011_bad_module_specifier.ts.out diff --git a/tests/error_012_bad_dynamic_import_specifier.ts b/cli/tests/error_012_bad_dynamic_import_specifier.ts index 0420a80bf..0420a80bf 100644 --- a/tests/error_012_bad_dynamic_import_specifier.ts +++ b/cli/tests/error_012_bad_dynamic_import_specifier.ts diff --git a/tests/error_012_bad_dynamic_import_specifier.ts.out b/cli/tests/error_012_bad_dynamic_import_specifier.ts.out index 97f59f2ca..97f59f2ca 100644 --- a/tests/error_012_bad_dynamic_import_specifier.ts.out +++ b/cli/tests/error_012_bad_dynamic_import_specifier.ts.out diff --git a/tests/error_013_missing_script.out b/cli/tests/error_013_missing_script.out index 9836c361f..9836c361f 100644 --- a/tests/error_013_missing_script.out +++ b/cli/tests/error_013_missing_script.out diff --git a/tests/error_014_catch_dynamic_import_error.js b/cli/tests/error_014_catch_dynamic_import_error.js index ad3735fc3..ad3735fc3 100644 --- a/tests/error_014_catch_dynamic_import_error.js +++ b/cli/tests/error_014_catch_dynamic_import_error.js diff --git a/tests/error_014_catch_dynamic_import_error.js.out b/cli/tests/error_014_catch_dynamic_import_error.js.out index c18b680a1..c18b680a1 100644 --- a/tests/error_014_catch_dynamic_import_error.js.out +++ b/cli/tests/error_014_catch_dynamic_import_error.js.out diff --git a/tests/error_015_dynamic_import_permissions.js b/cli/tests/error_015_dynamic_import_permissions.js index 3460ca787..3460ca787 100644 --- a/tests/error_015_dynamic_import_permissions.js +++ b/cli/tests/error_015_dynamic_import_permissions.js diff --git a/tests/error_015_dynamic_import_permissions.out b/cli/tests/error_015_dynamic_import_permissions.out index 90ccd0d1a..90ccd0d1a 100644 --- a/tests/error_015_dynamic_import_permissions.out +++ b/cli/tests/error_015_dynamic_import_permissions.out diff --git a/tests/error_016_dynamic_import_permissions2.js b/cli/tests/error_016_dynamic_import_permissions2.js index 71c70815c..71c70815c 100644 --- a/tests/error_016_dynamic_import_permissions2.js +++ b/cli/tests/error_016_dynamic_import_permissions2.js diff --git a/tests/error_016_dynamic_import_permissions2.out b/cli/tests/error_016_dynamic_import_permissions2.out index f52186481..f52186481 100644 --- a/tests/error_016_dynamic_import_permissions2.out +++ b/cli/tests/error_016_dynamic_import_permissions2.out diff --git a/tests/error_stack.ts b/cli/tests/error_stack.ts index f2125d662..f2125d662 100644 --- a/tests/error_stack.ts +++ b/cli/tests/error_stack.ts diff --git a/tests/error_stack.ts.out b/cli/tests/error_stack.ts.out index 2bb629e2d..2bb629e2d 100644 --- a/tests/error_stack.ts.out +++ b/cli/tests/error_stack.ts.out diff --git a/tests/error_syntax.js b/cli/tests/error_syntax.js index 0c0c09855..0c0c09855 100644 --- a/tests/error_syntax.js +++ b/cli/tests/error_syntax.js diff --git a/tests/error_syntax.js.out b/cli/tests/error_syntax.js.out index 6253f3dd5..6253f3dd5 100644 --- a/tests/error_syntax.js.out +++ b/cli/tests/error_syntax.js.out diff --git a/tests/error_type_definitions.ts b/cli/tests/error_type_definitions.ts index ceb11787e..ceb11787e 100644 --- a/tests/error_type_definitions.ts +++ b/cli/tests/error_type_definitions.ts diff --git a/tests/error_type_definitions.ts.out b/cli/tests/error_type_definitions.ts.out index cc09c149d..cc09c149d 100644 --- a/tests/error_type_definitions.ts.out +++ b/cli/tests/error_type_definitions.ts.out diff --git a/tests/esm_imports_a.js b/cli/tests/esm_imports_a.js index 673cd9aa3..673cd9aa3 100644 --- a/tests/esm_imports_a.js +++ b/cli/tests/esm_imports_a.js diff --git a/tests/esm_imports_b.js b/cli/tests/esm_imports_b.js index 321dfc05a..321dfc05a 100644 --- a/tests/esm_imports_b.js +++ b/cli/tests/esm_imports_b.js diff --git a/tests/exec_path.ts b/cli/tests/exec_path.ts index b70b23237..b70b23237 100644 --- a/tests/exec_path.ts +++ b/cli/tests/exec_path.ts diff --git a/tests/exit_error42.ts b/cli/tests/exit_error42.ts index e4db41f3a..e4db41f3a 100644 --- a/tests/exit_error42.ts +++ b/cli/tests/exit_error42.ts diff --git a/tests/exit_error42.ts.out b/cli/tests/exit_error42.ts.out index 90be1f305..90be1f305 100644 --- a/tests/exit_error42.ts.out +++ b/cli/tests/exit_error42.ts.out diff --git a/tests/fetch_deps.ts b/cli/tests/fetch_deps.ts index 370a8c561..370a8c561 100644 --- a/tests/fetch_deps.ts +++ b/cli/tests/fetch_deps.ts diff --git a/tests/hello.txt b/cli/tests/hello.txt index 6769dd60b..6769dd60b 100644 --- a/tests/hello.txt +++ b/cli/tests/hello.txt diff --git a/tests/https_import.ts b/cli/tests/https_import.ts index faaf2175f..faaf2175f 100644 --- a/tests/https_import.ts +++ b/cli/tests/https_import.ts diff --git a/tests/https_import.ts.out b/cli/tests/https_import.ts.out index e965047ad..e965047ad 100644 --- a/tests/https_import.ts.out +++ b/cli/tests/https_import.ts.out diff --git a/tests/if_main.ts b/cli/tests/if_main.ts index b47066b2d..b47066b2d 100644 --- a/tests/if_main.ts +++ b/cli/tests/if_main.ts diff --git a/tests/if_main.ts.out b/cli/tests/if_main.ts.out index ba2906d06..ba2906d06 100644 --- a/tests/if_main.ts.out +++ b/cli/tests/if_main.ts.out diff --git a/tests/import_meta.ts b/cli/tests/import_meta.ts index d111059ea..d111059ea 100644 --- a/tests/import_meta.ts +++ b/cli/tests/import_meta.ts diff --git a/tests/import_meta.ts.out b/cli/tests/import_meta.ts.out index f38aa98ea..f38aa98ea 100644 --- a/tests/import_meta.ts.out +++ b/cli/tests/import_meta.ts.out diff --git a/tests/import_meta2.ts b/cli/tests/import_meta2.ts index 7f59a5a46..7f59a5a46 100644 --- a/tests/import_meta2.ts +++ b/cli/tests/import_meta2.ts diff --git a/tests/importmaps/import_map.json b/cli/tests/importmaps/import_map.json index 601874aab..601874aab 100644 --- a/tests/importmaps/import_map.json +++ b/cli/tests/importmaps/import_map.json diff --git a/tests/importmaps/lodash/lodash.ts b/cli/tests/importmaps/lodash/lodash.ts index 2ec04ed3c..2ec04ed3c 100644 --- a/tests/importmaps/lodash/lodash.ts +++ b/cli/tests/importmaps/lodash/lodash.ts diff --git a/tests/importmaps/lodash/other_file.ts b/cli/tests/importmaps/lodash/other_file.ts index 714adae3f..714adae3f 100644 --- a/tests/importmaps/lodash/other_file.ts +++ b/cli/tests/importmaps/lodash/other_file.ts diff --git a/tests/importmaps/moment/moment.ts b/cli/tests/importmaps/moment/moment.ts index 2b54a431e..2b54a431e 100644 --- a/tests/importmaps/moment/moment.ts +++ b/cli/tests/importmaps/moment/moment.ts diff --git a/tests/importmaps/moment/other_file.ts b/cli/tests/importmaps/moment/other_file.ts index 24f3a0226..24f3a0226 100644 --- a/tests/importmaps/moment/other_file.ts +++ b/cli/tests/importmaps/moment/other_file.ts diff --git a/tests/importmaps/scope/scoped.ts b/cli/tests/importmaps/scope/scoped.ts index 9a0b5d8e3..9a0b5d8e3 100644 --- a/tests/importmaps/scope/scoped.ts +++ b/cli/tests/importmaps/scope/scoped.ts diff --git a/tests/importmaps/scoped_moment.ts b/cli/tests/importmaps/scoped_moment.ts index 9f67f88d4..9f67f88d4 100644 --- a/tests/importmaps/scoped_moment.ts +++ b/cli/tests/importmaps/scoped_moment.ts diff --git a/tests/importmaps/test.ts b/cli/tests/importmaps/test.ts index 9b09e9953..9b09e9953 100644 --- a/tests/importmaps/test.ts +++ b/cli/tests/importmaps/test.ts diff --git a/tests/importmaps/vue.ts b/cli/tests/importmaps/vue.ts index 76dbe1917..76dbe1917 100644 --- a/tests/importmaps/vue.ts +++ b/cli/tests/importmaps/vue.ts diff --git a/cli/integration_tests.rs b/cli/tests/integration_tests.rs index b03f69596..86de4fa6a 100644 --- a/cli/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1,5 +1,8 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -use crate::colors::strip_ansi_codes; +#[macro_use] +extern crate log; + +use deno_cli::colors::strip_ansi_codes; use os_pipe::pipe; use std::env; use std::io::Read; diff --git a/tests/is_tty.ts b/cli/tests/is_tty.ts index 2e3fdb49f..2e3fdb49f 100644 --- a/tests/is_tty.ts +++ b/cli/tests/is_tty.ts diff --git a/tests/no_color.js b/cli/tests/no_color.js index cea11a52f..cea11a52f 100644 --- a/tests/no_color.js +++ b/cli/tests/no_color.js diff --git a/tests/seed_random.js b/cli/tests/seed_random.js index 7f6e336df..7f6e336df 100644 --- a/tests/seed_random.js +++ b/cli/tests/seed_random.js diff --git a/tests/seed_random.js.out b/cli/tests/seed_random.js.out index c65e40f97..c65e40f97 100644 --- a/tests/seed_random.js.out +++ b/cli/tests/seed_random.js.out diff --git a/tests/subdir/auto_print_hello.ts b/cli/tests/subdir/auto_print_hello.ts index 5efa72e03..5efa72e03 100644 --- a/tests/subdir/auto_print_hello.ts +++ b/cli/tests/subdir/auto_print_hello.ts diff --git a/tests/subdir/bench_worker.ts b/cli/tests/subdir/bench_worker.ts index 094cefb80..094cefb80 100644 --- a/tests/subdir/bench_worker.ts +++ b/cli/tests/subdir/bench_worker.ts diff --git a/tests/subdir/config.json b/cli/tests/subdir/config.json index 01c3b5e79..01c3b5e79 100644 --- a/tests/subdir/config.json +++ b/cli/tests/subdir/config.json diff --git a/tests/subdir/evil_remote_import.js b/cli/tests/subdir/evil_remote_import.js index 4ff7d1b97..4ff7d1b97 100644 --- a/tests/subdir/evil_remote_import.js +++ b/cli/tests/subdir/evil_remote_import.js diff --git a/tests/subdir/form_urlencoded.txt b/cli/tests/subdir/form_urlencoded.txt index 70e087c20..70e087c20 100644 --- a/tests/subdir/form_urlencoded.txt +++ b/cli/tests/subdir/form_urlencoded.txt diff --git a/tests/subdir/indirect_import_error.js b/cli/tests/subdir/indirect_import_error.js index 84011d291..84011d291 100644 --- a/tests/subdir/indirect_import_error.js +++ b/cli/tests/subdir/indirect_import_error.js diff --git a/tests/subdir/indirect_throws.js b/cli/tests/subdir/indirect_throws.js index e1810a66c..e1810a66c 100644 --- a/tests/subdir/indirect_throws.js +++ b/cli/tests/subdir/indirect_throws.js diff --git a/tests/subdir/mismatch_ext.ts b/cli/tests/subdir/mismatch_ext.ts index e67d2a017..e67d2a017 100644 --- a/tests/subdir/mismatch_ext.ts +++ b/cli/tests/subdir/mismatch_ext.ts diff --git a/tests/subdir/mod1.ts b/cli/tests/subdir/mod1.ts index 393535588..393535588 100644 --- a/tests/subdir/mod1.ts +++ b/cli/tests/subdir/mod1.ts diff --git a/tests/subdir/mod2.ts b/cli/tests/subdir/mod2.ts index ce1adc0e8..ce1adc0e8 100644 --- a/tests/subdir/mod2.ts +++ b/cli/tests/subdir/mod2.ts diff --git a/tests/subdir/mod3.js b/cli/tests/subdir/mod3.js index ce534f570..ce534f570 100644 --- a/tests/subdir/mod3.js +++ b/cli/tests/subdir/mod3.js diff --git a/tests/subdir/mod4.js b/cli/tests/subdir/mod4.js index 71332dbc4..71332dbc4 100644 --- a/tests/subdir/mod4.js +++ b/cli/tests/subdir/mod4.js diff --git a/tests/subdir/mod5.mjs b/cli/tests/subdir/mod5.mjs index f21d8862b..f21d8862b 100644 --- a/tests/subdir/mod5.mjs +++ b/cli/tests/subdir/mod5.mjs diff --git a/tests/subdir/mt_application_ecmascript.j2.js b/cli/tests/subdir/mt_application_ecmascript.j2.js index e67d2a017..e67d2a017 100644 --- a/tests/subdir/mt_application_ecmascript.j2.js +++ b/cli/tests/subdir/mt_application_ecmascript.j2.js diff --git a/tests/subdir/mt_application_x_javascript.j4.js b/cli/tests/subdir/mt_application_x_javascript.j4.js index e67d2a017..e67d2a017 100644 --- a/tests/subdir/mt_application_x_javascript.j4.js +++ b/cli/tests/subdir/mt_application_x_javascript.j4.js diff --git a/tests/subdir/mt_application_x_typescript.t4.ts b/cli/tests/subdir/mt_application_x_typescript.t4.ts index e67d2a017..e67d2a017 100644 --- a/tests/subdir/mt_application_x_typescript.t4.ts +++ b/cli/tests/subdir/mt_application_x_typescript.t4.ts diff --git a/tests/subdir/mt_javascript.js b/cli/tests/subdir/mt_javascript.js index e67d2a017..e67d2a017 100644 --- a/tests/subdir/mt_javascript.js +++ b/cli/tests/subdir/mt_javascript.js diff --git a/tests/subdir/mt_text_ecmascript.j3.js b/cli/tests/subdir/mt_text_ecmascript.j3.js index e67d2a017..e67d2a017 100644 --- a/tests/subdir/mt_text_ecmascript.j3.js +++ b/cli/tests/subdir/mt_text_ecmascript.j3.js diff --git a/tests/subdir/mt_text_javascript.j1.js b/cli/tests/subdir/mt_text_javascript.j1.js index e67d2a017..e67d2a017 100644 --- a/tests/subdir/mt_text_javascript.j1.js +++ b/cli/tests/subdir/mt_text_javascript.j1.js diff --git a/tests/subdir/mt_text_typescript.t1.ts b/cli/tests/subdir/mt_text_typescript.t1.ts index e67d2a017..e67d2a017 100644 --- a/tests/subdir/mt_text_typescript.t1.ts +++ b/cli/tests/subdir/mt_text_typescript.t1.ts diff --git a/tests/subdir/mt_video_mp2t.t3.ts b/cli/tests/subdir/mt_video_mp2t.t3.ts index e67d2a017..e67d2a017 100644 --- a/tests/subdir/mt_video_mp2t.t3.ts +++ b/cli/tests/subdir/mt_video_mp2t.t3.ts diff --git a/tests/subdir/mt_video_vdn.t2.ts b/cli/tests/subdir/mt_video_vdn.t2.ts index e67d2a017..e67d2a017 100644 --- a/tests/subdir/mt_video_vdn.t2.ts +++ b/cli/tests/subdir/mt_video_vdn.t2.ts diff --git a/tests/subdir/no_ext b/cli/tests/subdir/no_ext index e67d2a017..e67d2a017 100644 --- a/tests/subdir/no_ext +++ b/cli/tests/subdir/no_ext diff --git a/tests/subdir/print_hello.ts b/cli/tests/subdir/print_hello.ts index 7ecce5040..7ecce5040 100644 --- a/tests/subdir/print_hello.ts +++ b/cli/tests/subdir/print_hello.ts diff --git a/tests/subdir/redirects/redirect1.js b/cli/tests/subdir/redirects/redirect1.js index d674be88c..d674be88c 100644 --- a/tests/subdir/redirects/redirect1.js +++ b/cli/tests/subdir/redirects/redirect1.js diff --git a/tests/subdir/redirects/redirect1.ts b/cli/tests/subdir/redirects/redirect1.ts index d674be88c..d674be88c 100644 --- a/tests/subdir/redirects/redirect1.ts +++ b/cli/tests/subdir/redirects/redirect1.ts diff --git a/tests/subdir/redirects/redirect2.js b/cli/tests/subdir/redirects/redirect2.js index e4244f638..e4244f638 100644 --- a/tests/subdir/redirects/redirect2.js +++ b/cli/tests/subdir/redirects/redirect2.js diff --git a/tests/subdir/redirects/redirect3.js b/cli/tests/subdir/redirects/redirect3.js index e24f2af32..e24f2af32 100644 --- a/tests/subdir/redirects/redirect3.js +++ b/cli/tests/subdir/redirects/redirect3.js diff --git a/tests/subdir/redirects/redirect4.ts b/cli/tests/subdir/redirects/redirect4.ts index 45c65c5eb..45c65c5eb 100644 --- a/tests/subdir/redirects/redirect4.ts +++ b/cli/tests/subdir/redirects/redirect4.ts diff --git a/tests/subdir/subdir2/mod2.ts b/cli/tests/subdir/subdir2/mod2.ts index c88d4708c..c88d4708c 100644 --- a/tests/subdir/subdir2/mod2.ts +++ b/cli/tests/subdir/subdir2/mod2.ts diff --git a/tests/subdir/test_worker.js b/cli/tests/subdir/test_worker.js index 53d38ba96..53d38ba96 100644 --- a/tests/subdir/test_worker.js +++ b/cli/tests/subdir/test_worker.js diff --git a/tests/subdir/test_worker.ts b/cli/tests/subdir/test_worker.ts index c8109d131..c8109d131 100644 --- a/tests/subdir/test_worker.ts +++ b/cli/tests/subdir/test_worker.ts diff --git a/tests/subdir/throws.js b/cli/tests/subdir/throws.js index b77e7104f..b77e7104f 100644 --- a/tests/subdir/throws.js +++ b/cli/tests/subdir/throws.js diff --git a/tests/subdir/unknown_ext.deno b/cli/tests/subdir/unknown_ext.deno index e67d2a017..e67d2a017 100644 --- a/tests/subdir/unknown_ext.deno +++ b/cli/tests/subdir/unknown_ext.deno diff --git a/tests/type_definitions.ts b/cli/tests/type_definitions.ts index ecf3ae0b2..ecf3ae0b2 100644 --- a/tests/type_definitions.ts +++ b/cli/tests/type_definitions.ts diff --git a/tests/type_definitions.ts.out b/cli/tests/type_definitions.ts.out index b4fa88c50..b4fa88c50 100644 --- a/tests/type_definitions.ts.out +++ b/cli/tests/type_definitions.ts.out diff --git a/tests/type_definitions/bar.d.ts b/cli/tests/type_definitions/bar.d.ts index d43335dbb..d43335dbb 100644 --- a/tests/type_definitions/bar.d.ts +++ b/cli/tests/type_definitions/bar.d.ts diff --git a/tests/type_definitions/fizz.d.ts b/cli/tests/type_definitions/fizz.d.ts index 34eb41b96..34eb41b96 100644 --- a/tests/type_definitions/fizz.d.ts +++ b/cli/tests/type_definitions/fizz.d.ts diff --git a/tests/type_definitions/fizz.js b/cli/tests/type_definitions/fizz.js index 852162c94..852162c94 100644 --- a/tests/type_definitions/fizz.js +++ b/cli/tests/type_definitions/fizz.js diff --git a/tests/type_definitions/foo.d.ts b/cli/tests/type_definitions/foo.d.ts index ce39201e1..ce39201e1 100644 --- a/tests/type_definitions/foo.d.ts +++ b/cli/tests/type_definitions/foo.d.ts diff --git a/tests/type_definitions/foo.js b/cli/tests/type_definitions/foo.js index 61d366eb2..61d366eb2 100644 --- a/tests/type_definitions/foo.js +++ b/cli/tests/type_definitions/foo.js diff --git a/tests/type_definitions/qat.ts b/cli/tests/type_definitions/qat.ts index 6196c9d38..6196c9d38 100644 --- a/tests/type_definitions/qat.ts +++ b/cli/tests/type_definitions/qat.ts diff --git a/tests/types.out b/cli/tests/types.out index 2d5a39e64..2d5a39e64 100644 --- a/tests/types.out +++ b/cli/tests/types.out diff --git a/tests/unbuffered_stderr.ts b/cli/tests/unbuffered_stderr.ts index f4bceb1fc..f4bceb1fc 100644 --- a/tests/unbuffered_stderr.ts +++ b/cli/tests/unbuffered_stderr.ts diff --git a/tests/unbuffered_stderr.ts.out b/cli/tests/unbuffered_stderr.ts.out index 500019738..500019738 100644 --- a/tests/unbuffered_stderr.ts.out +++ b/cli/tests/unbuffered_stderr.ts.out diff --git a/tests/unbuffered_stdout.ts b/cli/tests/unbuffered_stdout.ts index fdb1a0e23..fdb1a0e23 100644 --- a/tests/unbuffered_stdout.ts +++ b/cli/tests/unbuffered_stdout.ts diff --git a/tests/unbuffered_stdout.ts.out b/cli/tests/unbuffered_stdout.ts.out index 2e65efe2a..2e65efe2a 100644 --- a/tests/unbuffered_stdout.ts.out +++ b/cli/tests/unbuffered_stdout.ts.out diff --git a/tests/v8_flags.js b/cli/tests/v8_flags.js index f7999c4af..f7999c4af 100644 --- a/tests/v8_flags.js +++ b/cli/tests/v8_flags.js diff --git a/tests/v8_flags.js.out b/cli/tests/v8_flags.js.out index e2dbde096..e2dbde096 100644 --- a/tests/v8_flags.js.out +++ b/cli/tests/v8_flags.js.out diff --git a/tests/v8_help.out b/cli/tests/v8_help.out index 3d7aac28d..3d7aac28d 100644 --- a/tests/v8_help.out +++ b/cli/tests/v8_help.out diff --git a/tests/version.out b/cli/tests/version.out index de13d769f..de13d769f 100644 --- a/tests/version.out +++ b/cli/tests/version.out diff --git a/tests/wasm.ts b/cli/tests/wasm.ts index 26ad7ba28..26ad7ba28 100644 --- a/tests/wasm.ts +++ b/cli/tests/wasm.ts diff --git a/tests/wasm.ts.out b/cli/tests/wasm.ts.out index d81cc0710..d81cc0710 100644 --- a/tests/wasm.ts.out +++ b/cli/tests/wasm.ts.out diff --git a/tests/wasm_async.js b/cli/tests/wasm_async.js index 98a178aad..98a178aad 100644 --- a/tests/wasm_async.js +++ b/cli/tests/wasm_async.js diff --git a/tests/wasm_async.out b/cli/tests/wasm_async.out index 5cdf17de7..5cdf17de7 100644 --- a/tests/wasm_async.out +++ b/cli/tests/wasm_async.out diff --git a/tests/workers_round_robin_bench.ts b/cli/tests/workers_round_robin_bench.ts index 7c34e75e5..7c34e75e5 100644 --- a/tests/workers_round_robin_bench.ts +++ b/cli/tests/workers_round_robin_bench.ts diff --git a/tests/workers_startup_bench.ts b/cli/tests/workers_startup_bench.ts index fbea4dc40..fbea4dc40 100644 --- a/tests/workers_startup_bench.ts +++ b/cli/tests/workers_startup_bench.ts diff --git a/js/stat_test.ts b/js/stat_test.ts index 1de98f984..1542f1080 100644 --- a/js/stat_test.ts +++ b/js/stat_test.ts @@ -54,9 +54,9 @@ testPerm({ read: true }, async function lstatSyncSuccess(): Promise<void> { assert(!modulesInfo.isDirectory()); assert(modulesInfo.isSymlink()); - const testsInfo = Deno.lstatSync("tests"); - assert(testsInfo.isDirectory()); - assert(!testsInfo.isSymlink()); + const i = Deno.lstatSync("website"); + assert(i.isDirectory()); + assert(!i.isSymlink()); }); testPerm({ read: false }, async function lstatSyncPerm(): Promise<void> { @@ -96,9 +96,9 @@ testPerm({ read: true }, async function statSuccess(): Promise<void> { assert(modulesInfo.isDirectory()); assert(!modulesInfo.isSymlink()); - const testsInfo = await Deno.stat("tests"); - assert(testsInfo.isDirectory()); - assert(!testsInfo.isSymlink()); + const i = await Deno.stat("tests"); + assert(i.isDirectory()); + assert(!i.isSymlink()); }); testPerm({ read: false }, async function statPerm(): Promise<void> { @@ -138,9 +138,9 @@ testPerm({ read: true }, async function lstatSuccess(): Promise<void> { assert(!modulesInfo.isDirectory()); assert(modulesInfo.isSymlink()); - const testsInfo = await Deno.lstat("tests"); - assert(testsInfo.isDirectory()); - assert(!testsInfo.isSymlink()); + const i = await Deno.lstat("website"); + assert(i.isDirectory()); + assert(!i.isSymlink()); }); testPerm({ read: false }, async function lstatPerm(): Promise<void> { @@ -0,0 +1 @@ +cli/tests
\ No newline at end of file diff --git a/tests/README.md b/tests/README.md deleted file mode 100644 index 2bd294932..000000000 --- a/tests/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Integration Tests - -This path contains integration tests. See cli/integration_tests.rs for the -index. - -TODO(ry): Move integration_tests.rs to this directory as described in -https://doc.rust-lang.org/rust-by-example/testing/integration_testing.html |