From 037878b4ba94c49ca406e12e083658f5563c9795 Mon Sep 17 00:00:00 2001 From: mleanos Date: Sat, 10 Oct 2015 13:11:42 -0700 Subject: [PATCH] Global Mocha timeout Added the timeout option to the Mocha grunt task; set to 10000. Removed the individual test suite timeouts, for all server tests. Also, added global timeout for Mocha gulp task. --- gruntfile.js | 3 ++- gulpfile.js | 3 ++- modules/articles/tests/server/article.server.model.tests.js | 1 - modules/articles/tests/server/article.server.routes.tests.js | 1 - modules/chat/tests/server/chat.socket.tests.js | 1 - modules/core/tests/server/core.server.config.tests.js | 1 - modules/users/tests/server/user.server.model.tests.js | 1 - modules/users/tests/server/user.server.routes.tests.js | 1 - 8 files changed, 4 insertions(+), 8 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index 978f245678..9564b81dfd 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -173,7 +173,8 @@ module.exports = function (grunt) { mochaTest: { src: testAssets.tests.server, options: { - reporter: 'spec' + reporter: 'spec', + timeout: 10000 } }, mocha_istanbul: { diff --git a/gulpfile.js b/gulpfile.js index 2dfb51b6f9..84e0cb6a64 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -172,7 +172,8 @@ gulp.task('mocha', function (done) { // Run the tests gulp.src(testAssets.tests.server) .pipe(plugins.mocha({ - reporter: 'spec' + reporter: 'spec', + timeout: 10000 })) .on('error', function (err) { // If an error occurs, save it diff --git a/modules/articles/tests/server/article.server.model.tests.js b/modules/articles/tests/server/article.server.model.tests.js index 09204da109..d6d265bde1 100644 --- a/modules/articles/tests/server/article.server.model.tests.js +++ b/modules/articles/tests/server/article.server.model.tests.js @@ -17,7 +17,6 @@ var user, article; * Unit tests */ describe('Article Model Unit Tests:', function () { - this.timeout(10000); beforeEach(function (done) { user = new User({ diff --git a/modules/articles/tests/server/article.server.routes.tests.js b/modules/articles/tests/server/article.server.routes.tests.js index fc1bcbff4a..572d626f74 100644 --- a/modules/articles/tests/server/article.server.routes.tests.js +++ b/modules/articles/tests/server/article.server.routes.tests.js @@ -17,7 +17,6 @@ var app, agent, credentials, user, article; * Article routes tests */ describe('Article CRUD tests', function () { - this.timeout(10000); before(function (done) { // Get application diff --git a/modules/chat/tests/server/chat.socket.tests.js b/modules/chat/tests/server/chat.socket.tests.js index 900bcfb464..7f12af1ee8 100644 --- a/modules/chat/tests/server/chat.socket.tests.js +++ b/modules/chat/tests/server/chat.socket.tests.js @@ -4,7 +4,6 @@ * Chat socket tests */ describe('Chat Socket Tests:', function () { - this.timeout(10000); // TODO: Add chat socket tests }); diff --git a/modules/core/tests/server/core.server.config.tests.js b/modules/core/tests/server/core.server.config.tests.js index 837652ad9d..8d1aeedc69 100644 --- a/modules/core/tests/server/core.server.config.tests.js +++ b/modules/core/tests/server/core.server.config.tests.js @@ -11,7 +11,6 @@ var should = require('should'), seed = require(path.resolve('./config/lib/seed')); describe('Configuration Tests:', function () { - this.timeout(10000); describe('Testing default seedDB', function () { before(function(done) { diff --git a/modules/users/tests/server/user.server.model.tests.js b/modules/users/tests/server/user.server.model.tests.js index 5c4f9d7272..f5bfd39656 100644 --- a/modules/users/tests/server/user.server.model.tests.js +++ b/modules/users/tests/server/user.server.model.tests.js @@ -16,7 +16,6 @@ var user1, user2, user3; * Unit tests */ describe('User Model Unit Tests:', function () { - this.timeout(10000); before(function () { user1 = { diff --git a/modules/users/tests/server/user.server.routes.tests.js b/modules/users/tests/server/user.server.routes.tests.js index e104ba7152..04a0e50470 100644 --- a/modules/users/tests/server/user.server.routes.tests.js +++ b/modules/users/tests/server/user.server.routes.tests.js @@ -16,7 +16,6 @@ var app, agent, credentials, user, _user, admin; * User routes tests */ describe('User CRUD tests', function () { - this.timeout(10000); before(function (done) { // Get application