From 3b375e62d8d0ac6a5dc76ce47cd50fd1f66c2939 Mon Sep 17 00:00:00 2001 From: mleanos Date: Wed, 30 Sep 2015 19:50:07 -0700 Subject: [PATCH] Mocha test timeouts [fixes #955] Added a timeout of 10000 ms to each server test file. This is an attempt to solve the timeout issues that we're experiencing with the Mocha tests. Especially, this is hoping to address the build fails that are caused by such timeouts. Issue is described in https://github.com/meanjs/mean/issues/955 --- modules/articles/tests/server/article.server.model.tests.js | 2 ++ modules/articles/tests/server/article.server.routes.tests.js | 2 ++ modules/chat/tests/server/chat.socket.tests.js | 2 ++ modules/core/tests/server/core.server.config.tests.js | 1 + modules/users/tests/server/user.server.model.tests.js | 2 ++ modules/users/tests/server/user.server.routes.tests.js | 2 ++ 6 files changed, 11 insertions(+) diff --git a/modules/articles/tests/server/article.server.model.tests.js b/modules/articles/tests/server/article.server.model.tests.js index aa45237c13..09204da109 100644 --- a/modules/articles/tests/server/article.server.model.tests.js +++ b/modules/articles/tests/server/article.server.model.tests.js @@ -17,6 +17,8 @@ var user, article; * Unit tests */ describe('Article Model Unit Tests:', function () { + this.timeout(10000); + beforeEach(function (done) { user = new User({ firstName: 'Full', diff --git a/modules/articles/tests/server/article.server.routes.tests.js b/modules/articles/tests/server/article.server.routes.tests.js index 87854620ad..fc1bcbff4a 100644 --- a/modules/articles/tests/server/article.server.routes.tests.js +++ b/modules/articles/tests/server/article.server.routes.tests.js @@ -17,6 +17,8 @@ var app, agent, credentials, user, article; * Article routes tests */ describe('Article CRUD tests', function () { + this.timeout(10000); + before(function (done) { // Get application app = express.init(mongoose); diff --git a/modules/chat/tests/server/chat.socket.tests.js b/modules/chat/tests/server/chat.socket.tests.js index 21f94e4056..900bcfb464 100644 --- a/modules/chat/tests/server/chat.socket.tests.js +++ b/modules/chat/tests/server/chat.socket.tests.js @@ -4,5 +4,7 @@ * 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 123df58bfe..64ad6ccb46 100644 --- a/modules/core/tests/server/core.server.config.tests.js +++ b/modules/core/tests/server/core.server.config.tests.js @@ -11,6 +11,7 @@ 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 178d86a189..5c4f9d7272 100644 --- a/modules/users/tests/server/user.server.model.tests.js +++ b/modules/users/tests/server/user.server.model.tests.js @@ -16,6 +16,8 @@ var user1, user2, user3; * Unit tests */ describe('User Model Unit Tests:', function () { + this.timeout(10000); + before(function () { user1 = { firstName: 'Full', diff --git a/modules/users/tests/server/user.server.routes.tests.js b/modules/users/tests/server/user.server.routes.tests.js index a2226fe9ff..6f421fb51a 100644 --- a/modules/users/tests/server/user.server.routes.tests.js +++ b/modules/users/tests/server/user.server.routes.tests.js @@ -16,6 +16,8 @@ var app, agent, credentials, user, _user, admin; * User routes tests */ describe('User CRUD tests', function () { + this.timeout(10000); + before(function (done) { // Get application app = express.init(mongoose);