Skip to content

Commit a455006

Browse files
committed
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: #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>
1 parent 4471369 commit a455006

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/parallel/test-pending-deprecation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ switch (process.argv[2]) {
2525
break;
2626
default:
2727
// Verify that the flag is off by default.
28-
assert.strictEqual(config.pendingDeprecation, undefined);
28+
const envvar = process.env.NODE_PENDING_DEPRECATION;
29+
assert.strictEqual(config.pendingDeprecation, envvar && envvar[0] === '1');
2930

3031
// Test the --pending-deprecation command line switch.
3132
fork(__filename, ['switch'], {

0 commit comments

Comments
 (0)