diff options
Diffstat (limited to 'cli/tests/integration/run_tests.rs')
-rw-r--r-- | cli/tests/integration/run_tests.rs | 82 |
1 files changed, 57 insertions, 25 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index d9c20907d..e8bf3682a 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2,8 +2,10 @@ use deno_core::url; use std::process::Command; +use std::process::Stdio; use test_util as util; use test_util::TempDir; +use util::assert_contains; itest!(stdout_write_all { args: "run --quiet stdout_write_all.ts", @@ -268,7 +270,7 @@ fn webstorage_location_shares_origin() { .arg("--location") .arg("https://example.com/a.ts") .arg("webstorage/fixture.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -283,7 +285,7 @@ fn webstorage_location_shares_origin() { .arg("--location") .arg("https://example.com/b.ts") .arg("webstorage/logger.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -305,7 +307,7 @@ fn webstorage_config_file() { .arg("--config") .arg("webstorage/config_a.jsonc") .arg("webstorage/fixture.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -320,7 +322,7 @@ fn webstorage_config_file() { .arg("--config") .arg("webstorage/config_b.jsonc") .arg("webstorage/logger.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -335,7 +337,7 @@ fn webstorage_config_file() { .arg("--config") .arg("webstorage/config_a.jsonc") .arg("webstorage/logger.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -359,7 +361,7 @@ fn webstorage_location_precedes_config() { .arg("--config") .arg("webstorage/config_a.jsonc") .arg("webstorage/fixture.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -376,7 +378,7 @@ fn webstorage_location_precedes_config() { .arg("--config") .arg("webstorage/config_b.jsonc") .arg("webstorage/logger.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -396,7 +398,7 @@ fn webstorage_main_module() { .current_dir(util::testdata_path()) .arg("run") .arg("webstorage/fixture.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -409,7 +411,7 @@ fn webstorage_main_module() { .current_dir(util::testdata_path()) .arg("run") .arg("webstorage/logger.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -422,7 +424,7 @@ fn webstorage_main_module() { .current_dir(util::testdata_path()) .arg("run") .arg("webstorage/fixture.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -1632,8 +1634,8 @@ fn no_validate_asm() { .current_dir(util::testdata_path()) .arg("run") .arg("no_validate_asm.js") - .stderr(std::process::Stdio::piped()) - .stdout(std::process::Stdio::piped()) + .stderr(Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -1650,7 +1652,7 @@ fn exec_path() { .arg("run") .arg("--allow-read") .arg("exec_path.ts") - .stdout(std::process::Stdio::piped()) + .stdout(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -1776,7 +1778,7 @@ fn rust_log() { .current_dir(util::testdata_path()) .arg("run") .arg("001_hello.js") - .stderr(std::process::Stdio::piped()) + .stderr(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -1790,7 +1792,7 @@ fn rust_log() { .arg("run") .arg("001_hello.js") .env("RUST_LOG", "debug") - .stderr(std::process::Stdio::piped()) + .stderr(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -1810,7 +1812,7 @@ fn dont_cache_on_check_fail() { .arg("--check=all") .arg("--reload") .arg("error_003_typescript.ts") - .stderr(std::process::Stdio::piped()) + .stderr(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -1824,7 +1826,7 @@ fn dont_cache_on_check_fail() { .arg("run") .arg("--check=all") .arg("error_003_typescript.ts") - .stderr(std::process::Stdio::piped()) + .stderr(Stdio::piped()) .spawn() .unwrap() .wait_with_output() @@ -2374,8 +2376,8 @@ fn issue12740() { .current_dir(util::testdata_path()) .arg("run") .arg(&mod1_path) - .stderr(std::process::Stdio::null()) - .stdout(std::process::Stdio::null()) + .stderr(Stdio::null()) + .stdout(Stdio::null()) .spawn() .unwrap() .wait() @@ -2387,8 +2389,8 @@ fn issue12740() { .current_dir(util::testdata_path()) .arg("run") .arg(&mod1_path) - .stderr(std::process::Stdio::null()) - .stdout(std::process::Stdio::null()) + .stderr(Stdio::null()) + .stdout(Stdio::null()) .spawn() .unwrap() .wait() @@ -2411,8 +2413,8 @@ fn issue12807() { .arg("run") .arg("--check") .arg(&mod1_path) - .stderr(std::process::Stdio::null()) - .stdout(std::process::Stdio::null()) + .stderr(Stdio::null()) + .stdout(Stdio::null()) .spawn() .unwrap() .wait() @@ -2425,8 +2427,8 @@ fn issue12807() { .arg("run") .arg("--check") .arg(&mod1_path) - .stderr(std::process::Stdio::null()) - .stdout(std::process::Stdio::null()) + .stderr(Stdio::null()) + .stdout(Stdio::null()) .spawn() .unwrap() .wait() @@ -2663,6 +2665,36 @@ itest!(js_root_with_ts_check { exit_code: 1, }); +#[test] +fn check_local_then_remote() { + let _http_guard = util::http_server(); + let deno_dir = util::new_deno_dir(); + let output = util::deno_cmd_with_deno_dir(&deno_dir) + .current_dir(util::testdata_path()) + .arg("run") + .arg("--check") + .arg("run/remote_type_error/main.ts") + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); + let output = util::deno_cmd_with_deno_dir(&deno_dir) + .current_dir(util::testdata_path()) + .arg("run") + .arg("--check=all") + .arg("run/remote_type_error/main.ts") + .env("NO_COLOR", "1") + .stderr(Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(!output.status.success()); + let stderr = std::str::from_utf8(&output.stderr).unwrap(); + assert_contains!(stderr, "Type 'string' is not assignable to type 'number'."); +} + itest!(no_prompt_flag { args: "run --quiet --unstable --no-prompt no_prompt.ts", output_str: Some(""), |