So, my code contains unit tests that require a server. So I have sever up and running, my tests pass, but the problem is that I don't know how to stop server, so my build fails because it gets timed out.
Here is my configuration file
language: node_js
node_js:
- "7.10.0"
services:
- mongodb
env:
- PORT=6655 IP="localhost" NODE_ENV="test"
script:
- npm start &
- sleep 25
- npm test
Now, how do I stop the node server?
Edit: Here are my npm scripts
"scripts": {
"build-js": "webpack --config webpack.config.js",
"test": "node node_modules/.bin/mocha ./server/test --require ./server/test/testHelper.js --watch --reporter spec --timeout 10000 --compilers js:babel-core/register",
"start": "npm run build-js && babel-node app.js myApp --presets es2015,stage-2 && nodemon --watch cms/client",
}