Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

throw errors during testing #340

Closed
vojtajina opened this issue May 7, 2011 · 4 comments
Closed

throw errors during testing #340

vojtajina opened this issue May 7, 2011 · 4 comments
Assignees
Milestone

Comments

@vojtajina
Copy link
Contributor

https://github.com/angular/angular.js/blob/master/src/service/xhr.js#L154

When executing callback (after xhr request), all exceptions are caught and just reported into $log.error().
That's not enough for testing !

Imagine this:
I'm testing controller / service or whatever. And there is xhr request and then, any exception in the callback !
Then the test passes, you have to explicitely check the $log service....

expect(scope.$service('$log).error.logs.length).toBe(0);
@mhevery
Copy link
Contributor

mhevery commented May 7, 2011

I already have a fix for this in the scope branch. I simply rethrow any log.error messages (and also allow the tester to log only if that is what he wants)

@vojtajina
Copy link
Contributor Author

Well done maestro !

@ghost ghost assigned mhevery May 14, 2011
@mhevery
Copy link
Contributor

mhevery commented Jul 14, 2011

can we close this?

@vojtajina
Copy link
Contributor Author

Yep, it's fixed - closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants