diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/compile_tests.rs | 33 | ||||
-rw-r--r-- | cli/tests/testdata/standalone_follow_redirects.ts | 2 | ||||
-rw-r--r-- | cli/tests/testdata/standalone_follow_redirects_2.js | 5 |
3 files changed, 40 insertions, 0 deletions
diff --git a/cli/tests/integration/compile_tests.rs b/cli/tests/integration/compile_tests.rs index 9d1001ed6..82a98115a 100644 --- a/cli/tests/integration/compile_tests.rs +++ b/cli/tests/integration/compile_tests.rs @@ -186,6 +186,39 @@ fn standalone_load_datauri() { assert_eq!(output.stdout, b"Hello Deno!\n"); } +// https://github.com/denoland/deno/issues/13704 +#[test] +fn standalone_follow_redirects() { + let dir = TempDir::new().unwrap(); + let exe = if cfg!(windows) { + dir.path().join("follow_redirects.exe") + } else { + dir.path().join("follow_redirects") + }; + let output = util::deno_cmd() + .current_dir(util::testdata_path()) + .arg("compile") + .arg("--unstable") + .arg("--output") + .arg(&exe) + .arg("./standalone_follow_redirects.ts") + .stdout(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); + let output = Command::new(exe) + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::piped()) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); + assert!(output.status.success()); + assert_eq!(output.stdout, b"Hello\n"); +} + #[test] fn standalone_compiler_ops() { let dir = TempDir::new().unwrap(); diff --git a/cli/tests/testdata/standalone_follow_redirects.ts b/cli/tests/testdata/standalone_follow_redirects.ts new file mode 100644 index 000000000..f0957bc3d --- /dev/null +++ b/cli/tests/testdata/standalone_follow_redirects.ts @@ -0,0 +1,2 @@ +import "./standalone_follow_redirects_2.js"; +console.log("Hello"); diff --git a/cli/tests/testdata/standalone_follow_redirects_2.js b/cli/tests/testdata/standalone_follow_redirects_2.js new file mode 100644 index 000000000..c0130ef5a --- /dev/null +++ b/cli/tests/testdata/standalone_follow_redirects_2.js @@ -0,0 +1,5 @@ +// unversioned import redirects with dependencies. +import { + assertNotEquals as _a, + assertStrictEquals as _b, +} from "https://deno.land/std/testing/asserts.ts"; |