diff --git a/test/data/fake/database.js b/test/data/fake/database.js index f72a339..8de4b5e 100644 --- a/test/data/fake/database.js +++ b/test/data/fake/database.js @@ -1,5 +1,3 @@ -module.exports = function database (next) { +module.exports = function database () { global.database = true - - return next() } \ No newline at end of file diff --git a/test/data/fake/endpoints.js b/test/data/fake/endpoints.js new file mode 100644 index 0000000..c29a129 --- /dev/null +++ b/test/data/fake/endpoints.js @@ -0,0 +1,7 @@ +module.exports = function endpoints (next) { + setTimeout(function () { + global.endpoints = true + + return next() + }, 50) +} \ No newline at end of file diff --git a/test/lib/up.test.js b/test/lib/up.test.js index b91484c..19e77ea 100644 --- a/test/lib/up.test.js +++ b/test/lib/up.test.js @@ -3,6 +3,7 @@ var up = require('../../lib/up') describe('microboot/lib/up', function () { beforeEach(function () { global.database = false + global.endpoints = false global.end1 = false global.end2 = false global.end3 = false @@ -40,9 +41,12 @@ describe('microboot/lib/up', function () { expect(up.bind(up, ['test/data/fake', 'na'])).to.throw('no such file or directory') }) - it('should run database phase', function (done) { + it('should run database and endpoints phase', function (done) { + this.slow(200) + up(['test/data/fake'], function () { expect(global.database).to.equal(true) + expect(global.endpoints).to.equal(true) done() })