mirror of https://github.com/nodejs/corepack.git
test: clear all `COREPACK_*` environment variables (#392)
Co-authored-by: Maël Nison <nison.mael@gmail.com>
This commit is contained in:
parent
00506b2a15
commit
451dcf8229
|
|
@ -6,21 +6,13 @@ const process = require(`process`);
|
|||
jest.retryTimes(2, {logErrorsBeforeRetry: true});
|
||||
|
||||
const OLD_ENV = process.env;
|
||||
const {
|
||||
// To ensure we test the default behavior, we must remove these env vars
|
||||
// in case the local machine already set these values.
|
||||
COREPACK_DEFAULT_TO_LATEST,
|
||||
COREPACK_ENABLE_NETWORK,
|
||||
COREPACK_ENABLE_PROJECT_SPEC,
|
||||
COREPACK_ENABLE_STRICT,
|
||||
COREPACK_HOME,
|
||||
COREPACK_NPM_REGISTRY,
|
||||
COREPACK_NPM_TOKEN,
|
||||
COREPACK_NPM_USERNAME,
|
||||
FORCE_COLOR,
|
||||
// We save the rest to put it into `process.env` for tests.
|
||||
...processEnv
|
||||
} = process.env;
|
||||
// To ensure we test the default behavior, we must remove these env vars
|
||||
// in case the local machine already set these values.
|
||||
const processEnv = Object.fromEntries(
|
||||
Object.entries(process.env).filter(
|
||||
([key]) => key !== `FORCE_COLOR` && !key.startsWith(`COREPACK_`),
|
||||
),
|
||||
);
|
||||
|
||||
switch (process.env.NOCK_ENV || ``) {
|
||||
case `record`:
|
||||
|
|
|
|||
Loading…
Reference in New Issue