-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
|
||
}); |