AngularJs Good Unit Test Structure For Controllers & How to test ajax code and Promises | JavaScript for Line of Business Applications | Scoop.it

The poorly the structure is made for unit testing the more and more complected it will take to write a unit test for a simple functioning piece of code , and it will feel that your fighting your way against testing, instead it should feel more fun! So i’ll be showing a structure that worked for me very well when working with angular controllers Before going deep with the structure, i’ll be using

* Jasmine (unit testing)

* Jasmine spies (mocking)

* karma (because its awesome)