-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(state): fail transition on exceptions in transition handler #2773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(state): fail transition on exceptions in transition handler #2773
Conversation
This change broke all the unit tests. Would you please:
|
Thanks @christopherthielen. Hmm, the tests pass for me locally. I'll look into why Travis is unhappy. Assuming I find and fix the problem, do you prefer a series of separate commits in this PR, or squash ( |
I prefer one working commit, thanks! |
$q's support for |
Note to self: |
Ah, thanks for looking into that! You can run the 'travis style' test suite using Let's change from |
Trying to write the requested unit test for the new fix and I'm getting hung up on another $q-ism. I don't understand the $q mocks (test/testUtils.js in ui-router, and qFactory in angular proper) very well. Presumably the ui-router tests are using qFactory to provide a different Anyway, the $q
where (at the top) stateSpec.js:125 is in my intentionally faulty onEnter callback, (at the bottom) stateSpec.js:567 is the call to Can you point me at where the ui-router tests set up qFactory? |
de80864
to
8222fb0
Compare
I repushed the branch with the updated change (including the test that will fail as described above). |
@metamatt I'm in the same boat here, I'm not sure why it's set up to re-throw. The mocks docs imply it's because a throw in a promise is probably a bug... The key is to call
However, I'm worried that this could lead to false positives in other tests. I think we should create a new top-level |
Great suggestions. I'll try that next time I get a chance. Thanks. |
merged |
closes #2772