4 ms·
Testing Angular.js
- mackwic 13y agoThe problem with this kind of article is they are too trivial to be truly original and don't help testing a real application, even a light one. Who want to test his evening project ? Worst, it's by far too light on karma and E2E testing. They have a lot of pitfalls, traps, and documentation is nearly inexistent. A shame considering the size of these projects. I upvoted, though, because I want more discussion on that topic. For anyone who want further links about Unit-testing on Angular, I recommend the series from Benjamin Lesh on testing controllers[1], services[2], and directives[3]. This article[4] from The Year of Moo is also excellent and introduces the limit of End-to-end testing with a solution. [1]: http://www.benlesh.com/2013/05/angularjs-unit-testing-controllers.html http://www.benlesh.com/2013/05/angularjs-unit-testing-contro... [2]: http://www.benlesh.com/2013/06/angular-js-unit-testing-services.html http://www.benlesh.com/2013/06/angular-js-unit-testing-servi... [3]: http://www.benlesh.com/2013/06/angular-js-unit-testing-directives.html http://www.benlesh.com/2013/06/angular-js-unit-testing-direc... [4]: http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-... I'll be highly interested if someone has anything consistent about Karma and Angular-scenario. I didn't find anything satisfactory about setup anything bigger than 200 LoC. For what I saw, people run away from Angular-scenario and inject Jasmine and Mocks as a work-around.