@@ -148,20 +148,26 @@ async function getReportersMap(reporters, destinations) {
148148
149149
150150async function setupTestReporters ( testsStream ) {
151- const destinations = getOptionValue ( '--test-reporter-destination' ) ;
152- const reporters = getOptionValue ( '--test-reporter' ) ;
153-
154- if ( reporters . length === 0 && destinations . length === 0 ) {
155- ArrayPrototypePush ( reporters , kDefaultReporter ) ;
156- }
151+ let destinations = getOptionValue ( '--test-reporter-destination' ) ;
152+ let reporters = getOptionValue ( '--test-reporter' ) ;
153+ const isChildProcess = getOptionValue ( '--test-child-process' ) ;
154+
155+ if ( isChildProcess ) {
156+ reporters = [ kDefaultReporter ] ;
157+ destinations = [ kDefaultDestination ] ;
158+ } else {
159+ if ( reporters . length === 0 && destinations . length === 0 ) {
160+ ArrayPrototypePush ( reporters , kDefaultReporter ) ;
161+ }
157162
158- if ( reporters . length === 1 && destinations . length === 0 ) {
159- ArrayPrototypePush ( destinations , kDefaultDestination ) ;
160- }
163+ if ( reporters . length === 1 && destinations . length === 0 ) {
164+ ArrayPrototypePush ( destinations , kDefaultDestination ) ;
165+ }
161166
162- if ( destinations . length !== reporters . length ) {
163- throw new ERR_INVALID_ARG_VALUE ( '--test-reporter' , reporters ,
164- 'must match the number of specified \'--test-reporter-destination\'' ) ;
167+ if ( destinations . length !== reporters . length ) {
168+ throw new ERR_INVALID_ARG_VALUE ( '--test-reporter' , reporters ,
169+ 'must match the number of specified \'--test-reporter-destination\'' ) ;
170+ }
165171 }
166172
167173 const reportersMap = await getReportersMap ( reporters , destinations ) ;
0 commit comments