Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Synchronous tests
Browse files Browse the repository at this point in the history
Removed the done() callback method from the config tests that aren't
truly asynchronous.
  • Loading branch information
mleanos committed Oct 9, 2015
1 parent 75cf745 commit 32e0d12
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions modules/core/tests/server/core.server.config.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,16 @@ describe('Configuration Tests:', function () {
});
});

it('should have seedDB configuration set for "regular" user', function(done) {
it('should have seedDB configuration set for "regular" user', function() {
(typeof userFromSeedConfig).should.not.equal('undefined');
should.exist(userFromSeedConfig.username);
should.exist(userFromSeedConfig.email);

return done();
});

it('should have seedDB configuration set for admin user', function(done) {
it('should have seedDB configuration set for admin user', function() {
(typeof adminFromSeedConfig).should.not.equal('undefined');
should.exist(adminFromSeedConfig.username);
should.exist(adminFromSeedConfig.email);

return done();
});

it('should not be an admin user to begin with', function(done) {
Expand Down Expand Up @@ -386,30 +382,27 @@ describe('Configuration Tests:', function () {
return done();
});

it('should accept non-default session secret when running in production', function (done) {
it('should accept non-default session secret when running in production', function () {
var conf = { sessionSecret: 'super amazing secret' };
// set env to production for this test
process.env.NODE_ENV = 'production';
config.utils.validateSessionSecret(conf, true).should.equal(true);
// set env back to test
process.env.NODE_ENV = 'test';
return done();
});

it('should accept default session secret when running in development', function (done) {
it('should accept default session secret when running in development', function () {
var conf = { sessionSecret: 'MEAN' };
// set env to development for this test
process.env.NODE_ENV = 'development';
config.utils.validateSessionSecret(conf, true).should.equal(true);
// set env back to test
process.env.NODE_ENV = 'test';
return done();
});

it('should accept default session secret when running in test', function (done) {
it('should accept default session secret when running in test', function () {
var conf = { sessionSecret: 'MEAN' };
config.utils.validateSessionSecret(conf, true).should.equal(true);
return done();
});
});
});

0 comments on commit 32e0d12

Please sign in to comment.