From e0893f03c3e41c32eba29390a866d722fbb1dd7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Arboleda?= Date: Sat, 17 Nov 2018 16:38:44 -0500 Subject: [PATCH] test: use destructuring on require PR-URL: https://github.com/nodejs/node/pull/24455 Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Anna Henningsen --- .../test-tick-processor-polyfill-brokenfile.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/tick-processor/test-tick-processor-polyfill-brokenfile.js b/test/tick-processor/test-tick-processor-polyfill-brokenfile.js index d0a6eb9f81806e..f61bdbe9a12510 100644 --- a/test/tick-processor/test-tick-processor-polyfill-brokenfile.js +++ b/test/tick-processor/test-tick-processor-polyfill-brokenfile.js @@ -17,9 +17,9 @@ if (isCPPSymbolsNotMapped) { const assert = require('assert'); -const cp = require('child_process'); +const { spawn, spawnSync } = require('child_process'); const path = require('path'); -const fs = require('fs'); +const { writeFileSync } = require('fs'); const LOG_FILE = path.join(tmpdir.path, 'tick-processor.log'); const RETRY_TIMEOUT = 150; @@ -33,7 +33,7 @@ const code = `function f() { }; f();`; -const proc = cp.spawn(process.execPath, [ +const proc = spawn(process.execPath, [ '--no_logfile_per_isolate', '--logfile=-', '--prof', @@ -49,8 +49,8 @@ proc.stdout.on('data', (chunk) => ticks += chunk); function runPolyfill(content) { proc.kill(); content += BROKEN_PART; - fs.writeFileSync(LOG_FILE, content); - const child = cp.spawnSync( + writeFileSync(LOG_FILE, content); + const child = spawnSync( `${process.execPath}`, [ '--prof-process', LOG_FILE