1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-26 16:09:27 -05:00
denoland-deno/cli/tests/std_tests.rs
Bartek Iwańczuk 74c37e759a
remove std/testing/runner.ts, use deno test for std/ tests (#4397)
This introduces BREAKING CHANGE by removing "std/testing/runner.ts".

Std tests are now run using "deno test" subcommand.
2020-03-19 14:49:06 +01:00

29 lines
855 B
Rust

// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
mod tests {
extern crate lazy_static;
extern crate tempfile;
use deno::test_util::*;
use std::process::Command;
use tempfile::TempDir;
#[test]
fn std_tests() {
let dir = TempDir::new().expect("tempdir fail");
let mut deno_cmd = Command::new(deno_exe_path());
deno_cmd.env("DENO_DIR", dir.path());
let mut cwd = root_path();
cwd.push("std");
let mut deno = deno_cmd
.current_dir(cwd) // note: std tests expect to run from "std" dir
.arg("test")
.arg("--seed=86") // Some tests rely on specific random numbers.
.arg("-A")
// .arg("-Ldebug")
.spawn()
.expect("failed to spawn script");
let status = deno.wait().expect("failed to wait for the child process");
assert!(status.success());
}
}