summaryrefslogtreecommitdiff
path: root/cli/tests/integration/coverage_tests.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-08-29 13:02:54 -0600
committerGitHub <noreply@github.com>2023-08-29 13:02:54 -0600
commit64045ebc7a4e1c9f77204ffe35563134a453a7c6 (patch)
treec6710acf89e7019fd203d1667edc1a7798850c1d /cli/tests/integration/coverage_tests.rs
parent441b860978afd0160a459aee7e42ccc97263dc23 (diff)
chore(cli): use NPM_CONFIG_REGISTRY for all tests (#20320)
We never want tests to hit the real npm registry because this causes test flakes. In addition, we set a sentinal "unset" value for `NPM_CONFIG_REGISTRY` to ensure that all tests requiring npm go through the test server.
Diffstat (limited to 'cli/tests/integration/coverage_tests.rs')
-rw-r--r--cli/tests/integration/coverage_tests.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/tests/integration/coverage_tests.rs b/cli/tests/integration/coverage_tests.rs
index f256d0121..a8b3ec3a1 100644
--- a/cli/tests/integration/coverage_tests.rs
+++ b/cli/tests/integration/coverage_tests.rs
@@ -3,6 +3,7 @@
use std::fs;
use test_util as util;
use test_util::TempDir;
+use util::env_vars_for_npm_tests;
use util::TestContext;
use util::TestContextBuilder;
@@ -326,7 +327,7 @@ fn no_tests_included(test_name: &str, extension: &str) {
#[test]
fn no_npm_cache_coverage() {
- let context = TestContext::default();
+ let context = TestContext::with_http_server();
let tempdir = context.temp_dir();
let tempdir = tempdir.path().join("cov");
@@ -339,6 +340,7 @@ fn no_npm_cache_coverage() {
format!("--coverage={}", tempdir),
format!("coverage/no_npm_coverage/no_npm_coverage_test.ts"),
])
+ .envs(env_vars_for_npm_tests())
.run();
output.assert_exit_code(0);