Skip to content

Commit 05636db

Browse files
committed
added first test
1 parent 1919e07 commit 05636db

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

test/index.test.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
var expect = require('chai').expect;
2+
var Sails = require('sails').Sails;
3+
4+
describe('sails.hook.mixins', function() {
5+
6+
// Var to hold a running sails app instance
7+
var sails;
8+
9+
// Before running any tests, attempt to lift Sails
10+
before(function (done) {
11+
12+
// Hook will timeout in 10 seconds
13+
this.timeout(10000);
14+
15+
// Attempt to lift sails
16+
Sails().lift({
17+
hooks: {
18+
'mixins': require('../'),
19+
'grunt': false
20+
},
21+
log: {
22+
level: 'error'
23+
}
24+
}, function (err, _sails) {
25+
if (err) return done(err);
26+
sails = _sails;
27+
return done();
28+
});
29+
});
30+
31+
// After tests are complete, lower Sails
32+
after(function (done) {
33+
34+
// Lower Sails (if it successfully lifted)
35+
if (sails) {
36+
return sails.lower(done);
37+
}
38+
// Otherwise just return
39+
return done();
40+
});
41+
42+
it('should not crash sails on bootstrap', function() {
43+
return true;
44+
});
45+
46+
it('should be accesible in sails.hooks', function () {
47+
expect(sails.hooks).to.have.ownProperty('mixins');
48+
});
49+
50+
it('should be an object', function () {
51+
expect(sails.hooks.mixins).to.be.an.instanceof(Object);
52+
});
53+
54+
});

0 commit comments

Comments
 (0)