@@ -32,16 +32,21 @@ export function log(message, color = colors.reset) {
3232 * @param {string } command - The command to run
3333 * @param {string[] } args - Command arguments
3434 * @param {string } cwd - Working directory
35+ * @param {Object } options - Additional options
36+ * @param {boolean } options.nonInteractive - Whether to run in non-interactive mode
3537 * @returns {Promise<void> }
3638 */
37- export function runCommand ( command , args , cwd = process . cwd ( ) ) {
39+ export function runCommand ( command , args , cwd = process . cwd ( ) , options = { } ) {
3840 return new Promise ( ( resolve , reject ) => {
3941 log ( `${ colors . cyan } Running: ${ command } ${ args . join ( ' ' ) } ${ colors . reset } ` , colors . cyan ) ;
4042 log ( `${ colors . yellow } Working directory: ${ cwd } ${ colors . reset } ` , colors . yellow ) ;
41-
43+
44+ // Configure stdio based on interactive mode
45+ const stdio = options . nonInteractive ? [ 'ignore' , 'inherit' , 'inherit' ] : 'inherit' ;
46+
4247 const child = spawn ( command , args , {
4348 cwd,
44- stdio : 'inherit' ,
49+ stdio,
4550 shell : process . platform === 'win32'
4651 } ) ;
4752
@@ -217,7 +222,11 @@ export async function runProjectOperations(projects, operation, stopOnFailure =
217222 for ( const project of projects ) {
218223 try {
219224 log ( `${ colors . bright } ${ project . icon || '⚙️' } ${ operation } ${ project . name } ...${ colors . reset } ` , colors . blue ) ;
220- await runCommand ( project . command , project . args , project . path ) ;
225+
226+ // Use non-interactive mode for test operations
227+ const options = operation . toLowerCase ( ) === 'test' ? { nonInteractive : true } : { } ;
228+
229+ await runCommand ( project . command , project . args , project . path , options ) ;
221230 results . push ( { name : project . name , status : 'success' } ) ;
222231 log ( `${ colors . green } ✅ ${ project . name } ${ operation . toLowerCase ( ) } completed${ colors . reset } ` , colors . green ) ;
223232 } catch ( error ) {
@@ -249,22 +258,26 @@ export async function getAvailableProjects(operation = 'build') {
249258
250259 // Client project
251260 if ( directoryExists ( paths . client ) ) {
261+ // Use non-interactive test script for client (vitest run instead of vitest)
262+ const clientOperation = operation === 'test' ? 'test:ci' : operation ;
252263 projects . push ( {
253264 name : 'Client' ,
254265 path : paths . client ,
255266 command : pmConfig . command ,
256- args : [ 'run' , operation ] ,
267+ args : [ 'run' , clientOperation ] ,
257268 icon : '🎨'
258269 } ) ;
259270 }
260271
261272 // Server project
262273 if ( directoryExists ( paths . server ) ) {
274+ // Use non-interactive test script for server (jest --passWithNoTests --ci)
275+ const serverOperation = operation === 'test' ? 'test:ci' : operation ;
263276 projects . push ( {
264277 name : 'Server' ,
265278 path : paths . server ,
266279 command : pmConfig . command ,
267- args : [ 'run' , operation ] ,
280+ args : [ 'run' , serverOperation ] ,
268281 icon : '⚙️'
269282 } ) ;
270283 }
0 commit comments