diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js index 6194f66b55d987..f48e8257e6c421 100644 --- a/benchmark/child_process/child-process-exec-stdout.js +++ b/benchmark/child_process/child-process-exec-stdout.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common.js'); -var messagesLength = [64, 256, 1024, 4096]; +const messagesLength = [64, 256, 1024, 4096]; // Windows does not support that long arguments if (process.platform !== 'win32') messagesLength.push(32768); diff --git a/benchmark/child_process/child-process-read.js b/benchmark/child_process/child-process-read.js index b0128eb7969056..58f016c764ae0b 100644 --- a/benchmark/child_process/child-process-read.js +++ b/benchmark/child_process/child-process-read.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const os = require('os'); -var messagesLength = [64, 256, 1024, 4096]; +const messagesLength = [64, 256, 1024, 4096]; // Windows does not support that long arguments if (os.platform() !== 'win32') messagesLength.push(32768); diff --git a/test/parallel/test-child-process-exec-data-buffer.js b/test/parallel/test-child-process-exec-data-buffer.js new file mode 100644 index 00000000000000..0854203d0ef335 --- /dev/null +++ b/test/parallel/test-child-process-exec-data-buffer.js @@ -0,0 +1,15 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const exec = require('child_process').exec; + +const expectedCalls = 2; + +const cb = common.mustCall((data) => { + assert(data instanceof Buffer); +}, expectedCalls); + +const command = common.isWindows ? 'dir' : 'ls'; +exec(command).stdout.on('data', cb); + +exec('fhqwhgads').stderr.on('data', cb);