Skip to content

Commit

Permalink
added first test
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmilz committed Jan 2, 2017
1 parent 1919e07 commit 05636db
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
var expect = require('chai').expect;
var Sails = require('sails').Sails;

describe('sails.hook.mixins', function() {

// Var to hold a running sails app instance
var sails;

// Before running any tests, attempt to lift Sails
before(function (done) {

// Hook will timeout in 10 seconds
this.timeout(10000);

// Attempt to lift sails
Sails().lift({
hooks: {
'mixins': require('../'),
'grunt': false
},
log: {
level: 'error'
}
}, function (err, _sails) {
if (err) return done(err);
sails = _sails;
return done();
});
});

// After tests are complete, lower Sails
after(function (done) {

// Lower Sails (if it successfully lifted)
if (sails) {
return sails.lower(done);
}
// Otherwise just return
return done();
});

it('should not crash sails on bootstrap', function() {
return true;
});

it('should be accesible in sails.hooks', function () {
expect(sails.hooks).to.have.ownProperty('mixins');
});

it('should be an object', function () {
expect(sails.hooks.mixins).to.be.an.instanceof(Object);
});

});

0 comments on commit 05636db

Please sign in to comment.