Skip to content

Commit 363d3c6

Browse files
juanarbolrvagg
authored andcommitted
test: use destructuring on require
PR-URL: #24455 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 34b40af commit 363d3c6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/tick-processor/test-tick-processor-polyfill-brokenfile.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ if (isCPPSymbolsNotMapped) {
1717

1818

1919
const assert = require('assert');
20-
const cp = require('child_process');
20+
const { spawn, spawnSync } = require('child_process');
2121
const path = require('path');
22-
const fs = require('fs');
22+
const { writeFileSync } = require('fs');
2323

2424
const LOG_FILE = path.join(tmpdir.path, 'tick-processor.log');
2525
const RETRY_TIMEOUT = 150;
@@ -33,7 +33,7 @@ const code = `function f() {
3333
};
3434
f();`;
3535

36-
const proc = cp.spawn(process.execPath, [
36+
const proc = spawn(process.execPath, [
3737
'--no_logfile_per_isolate',
3838
'--logfile=-',
3939
'--prof',
@@ -49,8 +49,8 @@ proc.stdout.on('data', (chunk) => ticks += chunk);
4949
function runPolyfill(content) {
5050
proc.kill();
5151
content += BROKEN_PART;
52-
fs.writeFileSync(LOG_FILE, content);
53-
const child = cp.spawnSync(
52+
writeFileSync(LOG_FILE, content);
53+
const child = spawnSync(
5454
`${process.execPath}`,
5555
[
5656
'--prof-process', LOG_FILE

0 commit comments

Comments
 (0)