I want to test that my server can actually start in a build step so one step runs sails lift
(I'm using a sails.js app). The sails server then starts fine but it times out after 5 minutes causing the build to fail.
Is there anyway I can still get the build to pass. Maybe after 30 seconds, which would mean the server started fine, to exit myself and return true?
I think you can't do that. If you just wanna check that you server will lift before deploy, I recommend you to write one test. Sails integrate a
boostrap.test.js
file which follow this step :1. your sails app lift
2. your test is runned
3. your sails app lower
Here is the file
bootstrap.test.js
which do that :Follow the recommendation of the sails documentation testing section and you will able to organize your tests and write one.
You will run your test with mocha
You can had a shortcut with
npm test
command by editing your package.json :Concerning Wercker, you will have to install mocha in one of your steps before running your tests with something like that: