Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Commit 173c0da

Browse files
authored
fix: properly remove environment variable (#173)
`process.env.FOO = undefined` sets the env var to `'undefined'` as a string, but removing it entirely was almost certainly the intent here. Using `delete` here resolves that and stops Node.js from warning about it when `--pending-deprecation` is enabled. Refs: https://nodejs.org/api/deprecations.html#DEP0104
1 parent ab15950 commit 173c0da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mocha/after.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function mongodb_runner_mocha_after(opts) {
3030
return function(done) {
3131
if (process.env.MONGODB_RUNNER_MOCHA_SKIP_STOP) {
3232
debug('not stopping mongodb as it was not started by mocha/before');
33-
process.env.MONGODB_RUNNER_MOCHA_SKIP_STOP = undefined;
33+
delete process.env.MONGODB_RUNNER_MOCHA_SKIP_STOP;
3434
done();
3535
return;
3636
}

0 commit comments

Comments
 (0)