Currently, My react start script is as follows : env-cmd -f .env.local react-scripts start. I want to run some test script before this and if that fails do not run the above.
I have tried "start": "node src/test/test.js --check . && env-cmd -f .env.local react-scripts start" but when there is some error thrown in my test.js(which is handled using try-catch), the start script still runs which I don't want it to.