Repair grunt express task

This commit is contained in:
Gaël Métais
2014-12-22 22:08:24 +01:00
parent 7aede20819
commit d6f76de349
3 changed files with 19 additions and 23 deletions
+8
View File
@@ -115,6 +115,13 @@ module.exports = function(grunt) {
showStack: true
}
},
test: {
options: {
port: 8387,
server: './coverage/bin/server.js',
showStack: true
}
},
testSuite: {
options: {
port: 8388,
@@ -184,6 +191,7 @@ module.exports = function(grunt) {
'copy-test-server-settings',
'blanket',
'copy:coverage',
'express:test',
'mochaTest:test',
'mochaTest:coverage'
]);
+11 -9
View File
@@ -20,14 +20,16 @@ var frontController = require('../lib/server/controllers/frontController
// Let's start the server!
var settings = require('../server_config/settings.json');
server.listen(settings.serverPort, function() {
console.log('Listening on port %d', server.address().port);
if (!process.env.GRUNTED) {
var settings = require('../server_config/settings.json');
server.listen(settings.serverPort, function() {
console.log('Listening on port %d', server.address().port);
// For the tests
if (server.startTests) {
server.startTests();
}
});
// For the tests
if (server.startTests) {
server.startTests();
}
});
}
module.exports = server;
module.exports = app;
-14
View File
@@ -16,14 +16,6 @@ describe('api', function() {
var syncRunResultUrl;
var asyncRunId;
var apiServer;
// Start the server
before(function(done) {
apiServer = require('../../bin/server.js');
apiServer.startTests = done;
});
it('should refuse a query with an invalid key', function(done) {
@@ -451,10 +443,4 @@ describe('api', function() {
});
});
// Stop the server
after(function() {
console.log('Closing the server');
apiServer.close();
});
});