0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

refactor(cli/tests): change std_path to root_path in std_tests() (#7438)

This commit is contained in:
tokiedokie 2020-09-15 13:26:57 +09:00 committed by GitHub
parent f457ff9157
commit 04d3472257
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -13,11 +13,10 @@ use tempfile::TempDir;
#[test]
fn std_tests() {
let dir = TempDir::new().expect("tempdir fail");
let std_path = util::root_path().join("std");
let std_config = std_path.join("tsconfig_test.json");
let std_config = util::root_path().join("std/tsconfig_test.json");
let status = util::deno_cmd()
.env("DENO_DIR", dir.path())
.current_dir(std_path) // TODO(ry) change this to root_path
.current_dir(util::root_path())
.arg("test")
.arg("--unstable")
.arg("--seed=86") // Some tests rely on specific random numbers.
@ -25,6 +24,7 @@ fn std_tests() {
.arg("--config")
.arg(std_config.to_str().unwrap())
// .arg("-Ldebug")
.arg("std/")
.spawn()
.unwrap()
.wait()

View file

@ -32,6 +32,8 @@ Deno.test({
fn() {
assertEquals(process.cwd(), Deno.cwd());
const currentDir = Deno.cwd(); // to unchange current directory after this test
const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
process.chdir(path.resolve(moduleDir, ".."));
@ -40,6 +42,7 @@ Deno.test({
assert(process.cwd().match(/\Wnode$/));
process.chdir("..");
assert(process.cwd().match(/\Wstd$/));
process.chdir(currentDir); // to unchange current directory after this test
},
});