Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
zxl629 committed Jan 16, 2025
1 parent 9e021d4 commit d2c0b8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ const startSampleAndRun = async () => {
// commands
const runApp =
build === BUILD_TYPE.dev ? runAppOnDev(params) : runAppOnProd(params);
const runTest = `wait-on -t ${defaultTimeout} ${waitOnOption} && curl -o /dev/null -s -w "%{http_code}" http://localhost:3000/main.bundle.js`;
const runTest = `wait-on -t ${defaultTimeout} ${waitOnOption} && curl -o /dev/null -s -w "%{http_code}" http://localhost:3000/main.bundle.js |
xargs -I {} sh -c 'if [ "{}" = "200" ]; then exit 0; else echo "Received status code: {}"; exit 1; fi'`;

const { result } = concurrently([runApp, runTest], {
killOthers: ['success', 'failure'],
successCondition: ['first'],
});
return result
.then((results) => {
Expand Down

0 comments on commit d2c0b8b

Please sign in to comment.