summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJuan José Arboleda <soyjuanarbol@gmail.com>2018-11-17 16:38:44 -0500
committerAnna Henningsen <anna@addaleax.net>2018-11-24 10:56:04 +0900
commite0893f03c3e41c32eba29390a866d722fbb1dd7f (patch)
treeefba249becfc2ed2286ae06791dd27b45da61ea9 /test
parent4270c13426fb8d86f1068735006b95bb614e9f38 (diff)
downloadandroid-node-v8-e0893f03c3e41c32eba29390a866d722fbb1dd7f.tar.gz
android-node-v8-e0893f03c3e41c32eba29390a866d722fbb1dd7f.tar.bz2
android-node-v8-e0893f03c3e41c32eba29390a866d722fbb1dd7f.zip
test: use destructuring on require
PR-URL: https://github.com/nodejs/node/pull/24455 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test')
-rw-r--r--test/tick-processor/test-tick-processor-polyfill-brokenfile.js10
1 files 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 d0a6eb9f81..f61bdbe9a1 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