Here is what i need:
Is there any way I can run app and test in same process?
UPD.
Problem is half-solved: I have use mocha + should + restler to test my app. It is working. But How to set up jenkins to run these tests?
Freestyle Job -> execute shell script ->
npm install
node run.js &
node_pid=$!
sleep 15 // so tests won't fail because server not yet started
./node_modules/.bin/mocha --reporter tap > results/s-api.tap
result=$?
kill $node_pid
sleep 1 // so jenkins won't "scream" about leaked process
return result // we need return code of tests