Skip to content

Commit

Permalink
add alternative exit condition for react setup
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart committed Apr 7, 2021
1 parent 02a0994 commit 5d0e3ea
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions packages/cli-e2e/__tests__/react.specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,24 @@ describe('ui', () => {
projectName
);
console.log('Build ongoing');
await new Promise<void>((resolve) => {
buildProcess.on('exit', async () => {
resolve();
});
});
await Promise.race([
new Promise<void>((resolve) => {
buildProcess.on('exit', async () => {
resolve();
});
}),
new Promise<void>((resolve) => {
buildProcess.stdout.on('data', (data) => {
if (
/Happy hacking!/.test(
stripAnsi(data.toString()).replace('/\n/g', '')
)
) {
resolve();
}
});
}),
]);
console.log('Complete build');
console.log('Start server');
const startServerProcess = processManager.spawn('npm', ['run', 'start'], {
Expand Down

0 comments on commit 5d0e3ea

Please sign in to comment.