test: allow running with NODE_PENDING_DEPRECATION
Make the test for pending deprecations work when the env var is set during the whole test suite run. PR-URL: https://github.com/nodejs/node/pull/18991 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
d1bc6f0780
commit
67b7d54041
@ -25,7 +25,8 @@ switch (process.argv[2]) {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// Verify that the flag is off by default.
|
// Verify that the flag is off by default.
|
||||||
assert.strictEqual(config.pendingDeprecation, undefined);
|
const envvar = process.env.NODE_PENDING_DEPRECATION;
|
||||||
|
assert.strictEqual(config.pendingDeprecation, envvar && envvar[0] === '1');
|
||||||
|
|
||||||
// Test the --pending-deprecation command line switch.
|
// Test the --pending-deprecation command line switch.
|
||||||
fork(__filename, ['switch'], {
|
fork(__filename, ['switch'], {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user