feat(spawn): support inherited stdio
This commit is contained in:
@@ -80,6 +80,20 @@ tap.test('execSpawn should properly escape arguments', async () => {
|
||||
expect(result.stdout).toContain('$HOME && ls');
|
||||
});
|
||||
|
||||
tap.test('execSpawn should support inherited stdio for interactive CLIs', async () => {
|
||||
const testSmartshell = new smartshell.Smartshell({
|
||||
executor: 'bash',
|
||||
sourceFilePaths: [],
|
||||
});
|
||||
|
||||
const result = await testSmartshell.execSpawn('node', ['-e', 'console.log("inherited stdio works")'], {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
expect(result.exitCode).toEqual(0);
|
||||
expect(result.stdout).toEqual('');
|
||||
expect(result.stderr).toEqual('');
|
||||
});
|
||||
|
||||
tap.test('execSpawn streaming should work', async () => {
|
||||
const testSmartshell = new smartshell.Smartshell({
|
||||
executor: 'bash',
|
||||
|
||||
Reference in New Issue
Block a user