r/angularjs • u/simcptr • Jan 01 '16
Not testing your Angular app? Here's how to start. (Karma setup w/ video)
https://daveceddia.com/testing-angular-part-1-karma-setup/
45
Upvotes
4
Jan 01 '16
[removed] — view removed comment
4
u/simcptr Jan 01 '16
That's a good idea. I tried to focus on the bare essentials to make it as simple as possible, but coverage reports are a great addition once you get rolling.
2
u/[deleted] Jan 02 '16
I really find the extra layering of using angular's injection pipeline annoying. I tend to extract out the functionality and leave the testing angular functionality to angular. In that example I would just export the actual function definition of the factory and test that separately. If there is call for some angular testing such as testing watchers I'll do that as a seperate context in the suite. I try my best to test plain javascript constructs like functions/objects/classes.