@@ -122,48 +122,28 @@ describe('postprocessOutput', () => {
122122 ) . toThrow ( 'Post-processor "My Formatter" failed to run: spawnSync my-formatter ENOENT' ) ;
123123 } ) ;
124124
125- it ( 'should warn when the process exits with a non-zero status code' , ( ) => {
126- mockSync . mockReturnValue ( { error : undefined , status : 1 , stderr : Buffer . from ( '' ) } as any ) ;
127- const warnSpy = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } ) ;
128-
129- postprocessOutput (
130- { ...baseConfig , postProcess : [ { args : [ '{{path}}' ] , command : 'prettier' } ] } ,
131- noopPostProcessors ,
132- '' ,
133- ) ;
134-
135- expect ( warnSpy ) . toHaveBeenCalledWith (
136- expect . stringContaining ( 'Post-processor "prettier" exited with code 1' ) ,
137- ) ;
138- warnSpy . mockRestore ( ) ;
139- } ) ;
140-
141- it ( 'should include stderr in warning when process exits with non-zero status' , ( ) => {
125+ it ( 'should silently ignore non-zero exit codes' , ( ) => {
142126 mockSync . mockReturnValue ( {
143127 error : undefined ,
144- status : 2 ,
145- stderr : Buffer . from ( 'error: file not found ' ) ,
128+ status : 1 ,
129+ stderr : Buffer . from ( 'some error ' ) ,
146130 } as any ) ;
147131 const warnSpy = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } ) ;
148132
149133 postprocessOutput (
150- { ...baseConfig , postProcess : [ { args : [ '{{path}}' ] , command : 'biome ' } ] } ,
134+ { ...baseConfig , postProcess : [ { args : [ '{{path}}' ] , command : 'prettier ' } ] } ,
151135 noopPostProcessors ,
152136 '' ,
153137 ) ;
154138
155- expect ( warnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
156- const warnArg = warnSpy . mock . calls [ 0 ] ! [ 0 ] as string ;
157- expect ( warnArg ) . toContain ( 'Post-processor "biome" exited with code 2:' ) ;
158- expect ( warnArg ) . toContain ( 'error: file not found' ) ;
139+ expect ( warnSpy ) . not . toHaveBeenCalled ( ) ;
159140 warnSpy . mockRestore ( ) ;
160141 } ) ;
161142
162143 it ( 'should continue processing after a non-zero exit code' , ( ) => {
163144 mockSync
164145 . mockReturnValueOnce ( { error : undefined , status : 1 , stderr : Buffer . from ( '' ) } as any )
165146 . mockReturnValueOnce ( { error : undefined , status : 0 } as any ) ;
166- vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } ) ;
167147
168148 postprocessOutput (
169149 {
0 commit comments