Merge pull request #97 from strongloop/feature/unit-test-booting-flag

Add unit test to check `app.booting` flag
This commit is contained in:
Miroslav Bajtoš 2015-02-23 18:01:52 +01:00
commit d041d80933
2 changed files with 10 additions and 3 deletions

View File

@ -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();
});
});

View File

@ -0,0 +1,6 @@
module.exports = function(app, cb) {
if (app.booting)
process.bootingFlagSet = true;
process.nextTick(cb);
};