use std::path::PathBuf;
use std::process::Command;
fn fixture(name: &str) -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests/fixtures/unit_isolation/typescript")
.join(name)
}
fn isolation_exit(codebase: &str) -> i32 {
Command::new(env!("CARGO_BIN_EXE_testing-conventions"))
.args(["unit", "isolation", "--language", "typescript"])
.arg(fixture(codebase))
.status()
.expect("the built binary should run")
.code()
.expect("the process should exit with a code")
}
#[test]
fn red_exits_nonzero() {
assert_eq!(isolation_exit("red"), 1);
}
#[test]
fn clean_exits_zero() {
assert_eq!(isolation_exit("clean"), 0);
}
#[test]
fn untyped_red_exits_nonzero() {
assert_eq!(isolation_exit("untyped_mock/red"), 1);
}
#[test]
fn untyped_clean_exits_zero() {
assert_eq!(isolation_exit("untyped_mock/clean"), 0);
}