I'm trying to implement a new pattern I haven't used before in AngularJs, and to create unit tests for it.
The code is set up as follows: There is a $http promise with a .then() and a .catch() section. The .catch() catches both non-200 header results but also 'throw Error('foo') that I throw in the then() section for error situations like unexpected results.
My code seems to work fine, but in the unit tests halt as soon as they encounter the thrown Error.
How should I handle throw new Error() - like solutions in Karma, or should I not try to do it like this?
Aucun commentaire:
Enregistrer un commentaire