Skip to content

Commit

Permalink
chore(cb2-11221): try exec with logging
Browse files Browse the repository at this point in the history
  • Loading branch information
shivangidas committed Mar 19, 2024
1 parent 3a37cc3 commit 4ab6204
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { spawn } from 'child_process';
import { exec } from 'child_process';

// We hook to serverless offline when firing its process
const SERVER_OK = `Server ready: http://localhost:3006 🚀`;
Expand Down Expand Up @@ -37,7 +37,14 @@ const setupServer = (process: any) => new Promise((resolve, reject) => {
});
});

const server = spawn('npm', ['run', 'start', '&'], {});
const server = exec('npm run start &', (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.error(`stderr: ${stderr}`);
});

module.exports = async () => {
console.log(`\nSetting up Integration tests...\n\n`);
Expand Down

0 comments on commit 4ab6204

Please sign in to comment.