summaryrefslogtreecommitdiff
path: root/cli/tests/integration/coverage_tests.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-01-10 17:36:58 +0100
committerGitHub <noreply@github.com>2022-01-10 17:36:58 +0100
commita3b3a792b5c8dd2fa3e1b29f7fe5a7f3423f25c0 (patch)
tree4e7eecd4c33a02ada01094d1ac83ab3162bd1695 /cli/tests/integration/coverage_tests.rs
parentd8e96d2742bcbbbc6381b908a68067ec46fc320f (diff)
fix(coverage): don't type check (#13324)
This commit changes "deno coverage" command not to type check. Instead of relying on infrastructure for module loading in "deno run"; the code now directly reaches into cache for original and transpiled sources. In case sources are not available the error is returned to the user, suggesting to first run "deno test --coverage" command.
Diffstat (limited to 'cli/tests/integration/coverage_tests.rs')
-rw-r--r--cli/tests/integration/coverage_tests.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/cli/tests/integration/coverage_tests.rs b/cli/tests/integration/coverage_tests.rs
index feba0769e..637185e29 100644
--- a/cli/tests/integration/coverage_tests.rs
+++ b/cli/tests/integration/coverage_tests.rs
@@ -20,9 +20,11 @@ fn final_blankline() {
}
fn run_coverage_text(test_name: &str, extension: &str) {
+ let deno_dir = TempDir::new().expect("tempdir fail");
let tempdir = TempDir::new().expect("tempdir fail");
let tempdir = tempdir.path().join("cov");
- let status = util::deno_cmd()
+
+ let status = util::deno_cmd_with_deno_dir(deno_dir.path())
.current_dir(util::testdata_path())
.arg("test")
.arg("--quiet")
@@ -36,17 +38,19 @@ fn run_coverage_text(test_name: &str, extension: &str) {
assert!(status.success());
- let output = util::deno_cmd()
+ let output = util::deno_cmd_with_deno_dir(deno_dir.path())
.current_dir(util::testdata_path())
.arg("coverage")
- .arg("--quiet")
.arg("--unstable")
.arg(format!("{}/", tempdir.to_str().unwrap()))
.stdout(std::process::Stdio::piped())
- .stderr(std::process::Stdio::inherit())
+ .stderr(std::process::Stdio::piped())
.output()
.expect("failed to spawn coverage reporter");
+ // Verify there's no "Check" being printed
+ assert!(output.stderr.is_empty());
+
let actual =
util::strip_ansi_codes(std::str::from_utf8(&output.stdout).unwrap())
.to_string();
@@ -64,7 +68,7 @@ fn run_coverage_text(test_name: &str, extension: &str) {
assert!(output.status.success());
- let output = util::deno_cmd()
+ let output = util::deno_cmd_with_deno_dir(deno_dir.path())
.current_dir(util::testdata_path())
.arg("coverage")
.arg("--quiet")