Skip to content

Commit

Permalink
build: run server on background
Browse files Browse the repository at this point in the history
  • Loading branch information
blaise-favor committed May 15, 2024
1 parent 6bb5d16 commit 3eea5fa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
node-version: 18
- run: find . -name 'package-lock.json' -execdir npm ci \;
- run: npm run dev:test
- run: npm run dev:test &
- run: npx wait-on tcp:9595
- run: npm run test
build-latest:
Expand Down
21 changes: 21 additions & 0 deletions wait-and-run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { spawn } from 'child_process';

console.log('hello');

const child = spawn('npm', ['run', 'vitest']);

child.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});

child.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
});

child.on('error', (error) => {
console.error('Failed to start subprocess.');
});

child.on('close', (code) => {
console.log(`child process exited with code ${code}`);
});

0 comments on commit 3eea5fa

Please sign in to comment.