The error message is telling you the address your server is trying to listen to is already in use EADDRINUSE: address already in use :::5000, probably you have another instance from a previous test running?
To test, try changing the port your server is listening to. Modify the line:
var server = app.listen(5000, function () {
to
var server = app.listen(5001, function () {