Skip to content

Commit

Permalink
Increase timeouts for test to 10 seconds to avoid failing travis builds
Browse files Browse the repository at this point in the history
  • Loading branch information
saintedlama committed Oct 25, 2017
1 parent b6086d5 commit 74eb7b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 30 deletions.
10 changes: 2 additions & 8 deletions test/alternative-query-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ var passportLocalMongoose = require('../');
var mongotest = require('./helpers/mongotest');

describe('alternative query field', function() {
this.timeout(10000); // Ten seconds - mongo db access needed

beforeEach(mongotest.prepareDb('mongodb://localhost/passportlocalmongooseissues'));
afterEach(mongotest.disconnect());

it('should find an existing user by alternative query field', function(done) {
this.timeout(5000); // Five seconds - mongo db access needed

var UserSchema = new Schema({
email: String
});
Expand All @@ -33,8 +33,6 @@ describe('alternative query field', function() {
});

it('should authenticate an existing user by alternative query field', function(done) {
this.timeout(5000); // Five seconds - mongo db access needed

var UserSchema = new Schema({
email: String
});
Expand All @@ -57,8 +55,6 @@ describe('alternative query field', function() {
});

it('should authenticate an existing user by default username field', function(done) {
this.timeout(5000); // Five seconds - mongo db access needed

var UserSchema = new Schema({
email: String
});
Expand All @@ -81,8 +77,6 @@ describe('alternative query field', function() {
});

it('should not authenticate an existing user by unconfigured alternative query field', function(done) {
this.timeout(5000); // Five seconds - mongo db access needed

var UserSchema = new Schema({
email: String
});
Expand Down
2 changes: 1 addition & 1 deletion test/issues.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var passportLocalMongoose = require('../');
var mongotest = require('./helpers/mongotest');

describe('issues', function() {
this.timeout(5000); // Five seconds - mongodb access needed
this.timeout(10000); // Ten seconds - mongodb access needed

beforeEach(mongotest.prepareDb('mongodb://localhost/passportlocalmongooseissues'));
afterEach(mongotest.disconnect());
Expand Down
24 changes: 3 additions & 21 deletions test/passport-local-mongoose.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ DefaultUserSchema.plugin(passportLocalMongoose);
var DefaultUser = mongoose.model('DefaultUser', DefaultUserSchema);

describe('passportLocalMongoose', function() {
this.timeout(10000); // Ten seconds - mongo db access needed

it('should expose errors', function() {
expect(passportLocalMongoose.errors).to.exist;
});
Expand Down Expand Up @@ -127,8 +129,6 @@ describe('passportLocalMongoose', function() {
});

describe('#setPassword()', function() {
this.timeout(5000); // Five seconds - heavy crypto in background

it('should set yield an error if password is undefined', function(done) {
var user = new DefaultUser();

Expand Down Expand Up @@ -163,8 +163,6 @@ describe('passportLocalMongoose', function() {
});

describe('#changePassword()', function() {
this.timeout(5000); // Five seconds - heavy crypto in background

beforeEach(mongotest.prepareDb('mongodb://localhost/passportlocalmongoosetests'));
afterEach(mongotest.disconnect());

Expand Down Expand Up @@ -245,8 +243,6 @@ describe('passportLocalMongoose', function() {
beforeEach(mongotest.prepareDb('mongodb://localhost/passportlocalmongoosetests'));
afterEach(mongotest.disconnect());

this.timeout(5000); // Five seconds - heavy crypto in background

it('should yield false in case user cannot be authenticated', function(done) {
var user = new DefaultUser();

Expand All @@ -270,8 +266,6 @@ describe('passportLocalMongoose', function() {
});

it('should supply message when limiting attempts and authenticating too soon', function(done) {
this.timeout(5000); // Five seconds - mongo db access needed

var UserSchema = new Schema({});
UserSchema.plugin(passportLocalMongoose, {
limitAttempts: true,
Expand Down Expand Up @@ -301,8 +295,6 @@ describe('passportLocalMongoose', function() {
});

it('should get an error updating when limiting attempts and authenticating too soon', function(done) {
this.timeout(5000); // Five seconds - mongo db access needed

var UserSchema = new Schema({}, {saveErrorIfNotFound: true});
UserSchema.plugin(passportLocalMongoose, {
limitAttempts: true,
Expand Down Expand Up @@ -333,8 +325,6 @@ describe('passportLocalMongoose', function() {
});

it('should get an error updating the user on password match when limiting attempts', function(done) {
this.timeout(5000); // Five seconds - mongo db access needed

var UserSchema = new Schema({}, {saveErrorIfNotFound: true});
UserSchema.plugin(passportLocalMongoose, {
limitAttempts: true
Expand Down Expand Up @@ -362,7 +352,7 @@ describe('passportLocalMongoose', function() {
});

it('should update the user on password match while limiting attempts', function(done) {
this.timeout(5000); // Five seconds - mongo db access needed


var UserSchema = new Schema({});
UserSchema.plugin(passportLocalMongoose, {
Expand Down Expand Up @@ -391,8 +381,6 @@ describe('passportLocalMongoose', function() {
});

it('should fail to update the user on password mismatch while limiting attempts', function(done) {
this.timeout(5000); // Five seconds - mongo db access needed

var UserSchema = new Schema({}, {saveErrorIfNotFound: true});
UserSchema.plugin(passportLocalMongoose, {
limitAttempts: true,
Expand Down Expand Up @@ -424,8 +412,6 @@ describe('passportLocalMongoose', function() {
});

describe('static #authenticate()', function() {
this.timeout(5000); // Five seconds - mongo db access needed

beforeEach(mongotest.prepareDb('mongodb://localhost/passportlocalmongoosetests'));
afterEach(mongotest.disconnect());

Expand Down Expand Up @@ -662,8 +648,6 @@ describe('passportLocalMongoose', function() {
});

describe('static #deserializeUser()', function() {
this.timeout(5000); // Five seconds - mongo db access needed

beforeEach(mongotest.prepareDb('mongodb://localhost/passportlocalmongoosetests'));
afterEach(mongotest.disconnect());

Expand Down Expand Up @@ -831,8 +815,6 @@ describe('passportLocalMongoose', function() {
});

describe('static #register()', function() {
this.timeout(5000); // Five seconds - mongo db access needed

beforeEach(mongotest.prepareDb('mongodb://localhost/passportlocalmongoosetests'));
afterEach(mongotest.disconnect());

Expand Down

0 comments on commit 74eb7b5

Please sign in to comment.