diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-01-07 18:06:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-07 19:06:08 +0100 |
commit | e61e81eb57351782862aa50775ce4348f10b1856 (patch) | |
tree | 6099aa60857f586774a195034f18ac1fb10ca519 /cli/tests/integration_tests.rs | |
parent | c347dfcd565c3a396ae84dff46e7374851913462 (diff) |
feat: add --location=<href> and globalThis.location (#7369)
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r-- | cli/tests/integration_tests.rs | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 68cfe0b50..aabeb1f77 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1246,7 +1246,7 @@ fn bundle_import_map_no_check() { .current_dir(util::root_path()) .arg("bundle") .arg("--no-check") - .arg("--importmap") + .arg("--import-map") .arg(import_map_path) .arg("--unstable") .arg(import) @@ -1689,7 +1689,7 @@ fn repl_test_pty_bad_input() { #[test] #[ignore] -fn run_watch_with_importmap_and_relative_paths() { +fn run_watch_with_import_map_and_relative_paths() { fn create_relative_tmp_file( directory: &TempDir, filename: &'static str, @@ -1722,7 +1722,7 @@ fn run_watch_with_importmap_and_relative_paths() { .arg("run") .arg("--unstable") .arg("--watch") - .arg("--importmap") + .arg("--import-map") .arg(&import_map_path) .arg(&file_to_watch) .env("NO_COLOR", "1") @@ -2307,6 +2307,8 @@ fn workers() { .current_dir(util::tests_path()) .arg("test") .arg("--reload") + .arg("--location") + .arg("http://127.0.0.1:4545/cli/tests/") .arg("--allow-net") .arg("--allow-read") .arg("--unstable") @@ -2548,6 +2550,23 @@ itest!(_067_test_no_run_type_error { exit_code: 1, }); +itest!(_070_location { + args: "run --location https://foo/bar?baz#bat 070_location.ts", + output: "070_location.ts.out", +}); + +itest!(_071_location_unset { + args: "run 071_location_unset.ts", + output: "071_location_unset.ts.out", + exit_code: 1, +}); + +itest!(_072_location_relative_fetch { + args: "run --location http://127.0.0.1:4545/cli/tests/ --allow-net 072_location_relative_fetch.ts", + output: "072_location_relative_fetch.ts.out", + http_server: true, +}); + itest!(_073_worker_error { args: "run -A 073_worker_error.ts", output: "073_worker_error.ts.out", @@ -2570,6 +2589,12 @@ itest!(_076_info_json_deps_order { output: "076_info_json_deps_order.out", }); +itest!(_077_fetch_empty { + args: "run -A 077_fetch_empty.ts", + output: "077_fetch_empty.ts.out", + exit_code: 1, +}); + itest!(js_import_detect { args: "run --quiet --reload js_import_detect.ts", output: "js_import_detect.ts.out", @@ -5200,16 +5225,14 @@ fn web_platform_tests() { .tempfile() .unwrap(); - let bundle = concat_bundle( - files, - file.path(), - format!("window.location = {{search: \"{}\"}};\n", variant), - ); + let bundle = concat_bundle(files, file.path(), "".to_string()); file.write_all(bundle.as_bytes()).unwrap(); let child = util::deno_cmd() .current_dir(test_file_path.parent().unwrap()) .arg("run") + .arg("--location") + .arg(&format!("http://web-platform-tests/?{}", variant)) .arg("-A") .arg(file.path()) .arg(deno_core::serde_json::to_string(&expect_fail).unwrap()) |