diff --git a/scripts/test.mjs b/scripts/test.mjs index 6895b046..cb9adcc2 100644 --- a/scripts/test.mjs +++ b/scripts/test.mjs @@ -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) => {