From b6d2819b9348e5e1786122f2b20c724e4b692e92 Mon Sep 17 00:00:00 2001 From: razvanbh Date: Tue, 6 Nov 2018 19:27:01 +0200 Subject: [PATCH] test: add process no deprecation PR-URL: https://github.com/nodejs/node/pull/24196 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Richard Lau Reviewed-By: Ruben Bridgewater --- .../parallel/test-child-process-no-deprecation.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/parallel/test-child-process-no-deprecation.js diff --git a/test/parallel/test-child-process-no-deprecation.js b/test/parallel/test-child-process-no-deprecation.js new file mode 100644 index 00000000000000..d12e5b882f6375 --- /dev/null +++ b/test/parallel/test-child-process-no-deprecation.js @@ -0,0 +1,15 @@ +'use strict'; +const common = require('../common'); +process.noDeprecation = true; + +if (process.argv[2] === 'child') { + process.emitWarning('Something else is deprecated.', 'DeprecationWarning'); +} else { + // parent process + const spawn = require('child_process').spawn; + + // spawn self as child + const child = spawn(process.execPath, [process.argv[1], 'child']); + + child.stderr.on('data', common.mustNotCall()); +}