The test itself starts the server in a before hook

This commit is contained in:
Gaël Métais
2014-12-13 13:56:21 +01:00
parent 3ad6cdef51
commit 8abfe93df7
4 changed files with 24 additions and 23 deletions
+10 -2
View File
@@ -14,7 +14,12 @@ var wwwUrl = 'http://localhost:8388';
describe('api', function() {
var runId;
var apiServer;
before(function(done) {
apiServer = require('../../bin/server.js');
apiServer.startTests = done;
});
it('should refuse a query with an invalid key', function(done) {
this.timeout(5000);
@@ -67,7 +72,7 @@ describe('api', function() {
});
it('should accept up to 10 anonymous runs to the API', function(done) {
this.timeout(15000);
this.timeout(5000);
function launchRun() {
var deferred = Q.defer();
@@ -126,5 +131,8 @@ describe('api', function() {
});
after(function() {
console.log('Closing the server');
apiServer.close();
});
});