Skip to content

Commit

Permalink
fixup: don't exhaust exec buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
joaocgreis committed Sep 1, 2018
1 parent e2192a3 commit 7a10600
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/parallel/test-child-process-exec-any-shells-windows.js
Expand Up @@ -43,12 +43,16 @@ test('CMD');
test('powershell');
testCopy('powershell.exe',
`${system32}\\WindowsPowerShell\\v1.0\\powershell.exe`);
cp.exec(`Get-ChildItem "${__dirname}" | Select-Object -Property Name`,
{ shell: 'PowerShell' }, common.mustCall((error, stdout, stderror) => {
assert.ok(!error && !stderror);
assert.ok(stdout.includes(
'test-child-process-exec-any-shells-windows.js'));
}));
fs.writeFile(`${tmpPath}\\test file`, 'Test', common.mustCall((err) => {
assert.ifError(err);
cp.exec(`Get-ChildItem "${tmpPath}" | Select-Object -Property Name`,
{ shell: 'PowerShell' },
common.mustCall((error, stdout, stderror) => {
assert.ok(!error && !stderror);
assert.ok(stdout.includes(
'test file'));
}));
}));

// Test Bash (from WSL and Git), if available
cp.exec('where bash', common.mustCall((error, stdout) => {
Expand Down

0 comments on commit 7a10600

Please sign in to comment.