I'm writing end to end tests for an express site, and I want to add a "test" command into package.js
This command needs to:
- run eslint
- compile typescript
- start node server
- run unit tests against that server and show output.
- once done testing, close the server.
I know how to execute all those commands individually, but not all at once.
What I have now is :
npm run compile && npm run build && node ./dist/server.js --db=test && npm run test
It works to the point of: "&& npm run test" since node server is running, it won't continue on to the next command, and if it closes then tests wouldn't run.
Any help is appreciated.