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

Commit

Permalink
fix: properly remove environment variable (#173)
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
addaleax committed Sep 21, 2020
1 parent ab15950 commit 173c0da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mocha/after.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function mongodb_runner_mocha_after(opts) {
return function(done) {
if (process.env.MONGODB_RUNNER_MOCHA_SKIP_STOP) {
debug('not stopping mongodb as it was not started by mocha/before');
process.env.MONGODB_RUNNER_MOCHA_SKIP_STOP = undefined;
delete process.env.MONGODB_RUNNER_MOCHA_SKIP_STOP;
done();
return;
}
Expand Down

0 comments on commit 173c0da

Please sign in to comment.