Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port TestFetch to Rust #3887

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions cli/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,36 @@ fn deno_dir_test() {
drop(g);
}

// TODO(#2933): Rewrite this test in rust.
#[test]
fn fetch_test() {
pub use deno::test_util::*;
use std::process::Command;
use tempfile::TempDir;

let g = util::http_server();
util::run_python_script("tools/fetch_test.py");

let deno_dir = TempDir::new().expect("tempdir fail");
let t = util::root_path().join("cli/tests/006_url_imports.ts");

let output = Command::new(deno_exe_path())
.env("DENO_DIR", deno_dir.path())
.current_dir(util::root_path())
.arg("fetch")
.arg(t)
.output()
.expect("Failed to spawn script");

let code = output.status.code();
let out = std::str::from_utf8(&output.stdout).unwrap();

assert_eq!(Some(0), code);
assert_eq!(out, "");

let expected_path = deno_dir
.path()
.join("deps/http/localhost_PORT4545/cli/tests/subdir/mod2.ts");
assert_eq!(expected_path.exists(), true);

drop(g);
}

Expand Down
32 changes: 0 additions & 32 deletions tools/fetch_test.py

This file was deleted.