We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 215cafc commit 6f7d4b8Copy full SHA for 6f7d4b8
test/transitionSpec.ts
@@ -475,6 +475,17 @@ describe('transition', function () {
475
.then(done);
476
}));
477
478
+ it('should be called if an onBefore hook fails.', ((done) => {
479
+ let states = [];
480
+ $transitions.onBefore({ from: "A", entering: "C" }, function() { throw new Error("oops!"); });
481
+ $transitions.onError({ }, function(trans) { states.push(trans.to().name); });
482
+
483
+ Promise.resolve()
484
+ .then(goFail("A", "D"))
485
+ .then(() => expect(states).toEqual([ 'D' ]))
486
+ .then(done);
487
+ }));
488
489
it('should be called for only handlers matching the transition.', ((done) => {
490
let hooks = [];
491
$transitions.onEnter({ from: "A", entering: "C" }, function() { throw new Error("oops!"); });
0 commit comments