From a4550069ca1f74bff2286d209e1b8cb23b6b8722 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 25 Feb 2018 23:09:29 +0100 Subject: [PATCH] test: allow running with `NODE_PENDING_DEPRECATION` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Richard Lau Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Gus Caplan Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Luigi Pinca Reviewed-By: Matheus Marchini Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- test/parallel/test-pending-deprecation.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-pending-deprecation.js b/test/parallel/test-pending-deprecation.js index 9b1fd5addfa0c6..f8b4ec8e5b7b94 100644 --- a/test/parallel/test-pending-deprecation.js +++ b/test/parallel/test-pending-deprecation.js @@ -25,7 +25,8 @@ switch (process.argv[2]) { break; 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. fork(__filename, ['switch'], {