Merge pull request #97 from strongloop/feature/unit-test-booting-flag
Add unit test to check `app.booting` flag
This commit is contained in:
commit
d041d80933
|
@ -53,11 +53,12 @@ describe('executor', function() {
|
|||
});
|
||||
|
||||
describe('when booting', function() {
|
||||
it('should set the booting status', function(done) {
|
||||
it('should set the `booting` flag during execution', function(done) {
|
||||
expect(app.booting).to.be.undefined();
|
||||
boot.execute(app, dummyInstructions, function(err) {
|
||||
boot.execute(app, simpleAppInstructions(), function(err) {
|
||||
expect(err).to.be.undefined();
|
||||
expect(app.booting).to.be.false();
|
||||
expect(process.bootingFlagSet).to.be.ok();
|
||||
expect(app.booting).to.not.be.ok();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
module.exports = function(app, cb) {
|
||||
if (app.booting)
|
||||
process.bootingFlagSet = true;
|
||||
|
||||
process.nextTick(cb);
|
||||
};
|
Loading…
Reference in New Issue