@@ -72,6 +72,13 @@ describe('shell module', () => {
7272 sinon . match ( { shell : true , env : fakeEnv } ) ,
7373 ) ;
7474 } ) ;
75+ it ( 'should return the command outputs unchanged' , ( ) => {
76+ const fakeCmd = 'echo' ;
77+ const fakeArgs = [ '"greetings"' ] ;
78+ const sh = shell . spawnProcess ( fakeCmd , fakeArgs ) ;
79+ spawnProcess . stdout . emit ( 'data' , 'outputs\r\n' ) ;
80+ assert . equal ( sh . output , 'outputs\r\n' ) ;
81+ } ) ;
7582 it ( 'should raise bubble error details up' , ( ) => {
7683 runSpy . throws ( new Error ( 'this is bat country' ) ) ;
7784 assert . throw ( ( ) => {
@@ -124,6 +131,15 @@ describe('shell module', () => {
124131 sinon . match ( { shell : true , env : fakeEnv } ) ,
125132 ) ;
126133 } ) ;
134+ it ( 'should return the command outputs unchanged' , ( ) => {
135+ const fakeCmd = 'echo' ;
136+ const fakeArgs = [ '"greetings"' ] ;
137+ const sh = shell . spawnProcess ( fakeCmd , fakeArgs ) ;
138+ spawnProcess . stdout . emit ( 'data' , 'outputs\r\n' ) ;
139+ spawnProcess . stderr . emit ( 'data' , 'warning\n' ) ;
140+ spawnProcess . stdout . emit ( 'data' , 'endings\r\n' ) ;
141+ assert . equal ( sh . output , 'outputs\r\nwarning\nendings\r\n' ) ;
142+ } ) ;
127143 it ( 'should raise bubble error details up' , ( ) => {
128144 spawnSpy . throws ( new Error ( 'this is bat country' ) ) ;
129145 assert . throw ( ( ) => {
0 commit comments