Skip to content

Commit

Permalink
test: ensure NODE_EXTRA_CA_CERTS not set before tests
Browse files Browse the repository at this point in the history
The 'test-tls-env-extra-ca-file-load.js' test assumes that
NODE_EXTRA_CA_CERTS is not set. If the build environment
happens to have it set, this test will fail. This change
deletes that env var before running the test.

PR-URL: #43858
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
KrayzeeKev committed Jul 20, 2022
1 parent c52b722 commit 3473d1b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/parallel/test-tls-env-extra-ca-file-load.js
Expand Up @@ -20,6 +20,8 @@ if (process.argv[2] !== 'child') {
const NODE_EXTRA_CA_CERTS = fixtures.path('keys', 'ca1-cert.pem');
const extendsEnv = (obj) => ({ ...process.env, ...obj });

// Remove any pre-existing extra CA certs.
delete process.env.NODE_EXTRA_CA_CERTS;
[
extendsEnv({ CHILD_USE_EXTRA_CA_CERTS: 'yes', NODE_EXTRA_CA_CERTS }),
extendsEnv({ CHILD_USE_EXTRA_CA_CERTS: 'no' }),
Expand Down

0 comments on commit 3473d1b

Please sign in to comment.