Skip to content

Commit 9ff17ce

Browse files
committed
Adding test for improved error messaging.
1 parent d0f1748 commit 9ff17ce

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/stateSpec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@ describe('state', function () {
215215
$state.transitionTo('about.sidebar'); $q.flush();
216216
expect($state.current.name).toEqual('about.sidebar');
217217
}));
218+
219+
it('notifies on failed relative state resolution', inject(function ($state, $q) {
220+
$state.transitionTo(DD);
221+
$q.flush();
222+
223+
var err = "Could not resolve '^.Z' from state 'DD'";
224+
expect(function() { $state.transitionTo("^.Z", null, { relative: $state.$current }); }).toThrow(err);
225+
}));
218226
});
219227

220228
describe('.go()', function () {

0 commit comments

Comments
 (0)