File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -15,22 +15,20 @@ export const captureStandardError = (
15
15
}
16
16
}
17
17
18
- let receivedChunks = false
18
+ let buffer = ''
19
19
20
20
const listener = ( chunk : Buffer ) => {
21
- if ( ! receivedChunks ) {
22
- receivedChunks = true
23
-
24
- systemLog ( `Plugin failed to initialize during the "${ eventName } " phase` )
25
- }
26
-
27
- systemLog ( chunk . toString ( ) . trimEnd ( ) )
21
+ buffer += chunk . toString ( )
28
22
}
29
23
30
24
childProcess . stderr ?. on ( 'data' , listener )
31
25
32
26
const cleanup = ( ) => {
33
27
childProcess . stderr ?. removeListener ( 'data' , listener )
28
+
29
+ if ( buffer . length !== 0 ) {
30
+ systemLog ( `Plugin failed to initialize during the "${ eventName } " phase: ${ buffer . trim ( ) } ` )
31
+ }
34
32
}
35
33
36
34
return cleanup
Original file line number Diff line number Diff line change @@ -360,10 +360,8 @@ test('Plugin errors that occur during the loading phase are piped to system logs
360
360
361
361
if ( platform !== 'win32' ) {
362
362
const systemLog = await fs . readFile ( systemLogFile . path , { encoding : 'utf8' } )
363
- const lines = systemLog . split ( '\n' )
364
363
365
- t . is ( lines [ 0 ] . trim ( ) , 'Plugin failed to initialize during the "load" phase' )
366
- t . is ( lines [ 1 ] . trim ( ) , 'An error message thrown by Node.js' )
364
+ t . is ( systemLog . trim ( ) , `Plugin failed to initialize during the "load" phase: An error message thrown by Node.js` )
367
365
}
368
366
369
367
t . snapshot ( normalizeOutput ( output ) )
You can’t perform that action at this time.
0 commit comments