Skip to content

Commit

Permalink
fixed forcefully destroy the app instance test
Browse files Browse the repository at this point in the history
  • Loading branch information
bekzod committed Jun 5, 2017
1 parent 6308c5f commit 3efcdb0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/fastboot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,18 @@ describe("FastBoot", function() {
distPath: fixture('basic-app')
});

return fastboot.visit('/', { destroyAppInstanceInMs: 5 })
// delaying `visitRoute` to forcefully destroy app instance
let originalVisitRoute = fastboot._app.visitRoute;
fastboot._app.visitRoute = function() {
return originalVisitRoute.apply(this, arguments)
.then(function() {
return new Promise(function(resolve) {
setTimeout(resolve, 2000);
});
});
};

fastboot.visit('/', { destroyAppInstanceInMs: 5 })
.catch((e) => {
expect(e.message).to.equal('App instance was forcefully destroyed in 5ms');
done();
Expand Down Expand Up @@ -349,7 +360,7 @@ describe("FastBoot", function() {
distPath: fixture('boot-time-failing-app')
});

return fastboot.visit('/')
fastboot.visit('/')
.catch((e) => {
expect(e).to.be.an('error');
done();
Expand Down

0 comments on commit 3efcdb0

Please sign in to comment.