tutorial and resources for AngularJS Karma [closed]
Asked Answered
B

1

6

I am going to implementing unit testing in my application and for that I have chosen Karma. But I am struggling regarding how to write the test cases using Karma syntax. Please give me some starting resources and tutorial links regarding Karma syntax.

Bangalore answered 18/2, 2014 at 13:55 Comment(0)
M
22

My favorites resources for starting karma was those articles

http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html

You should also check the jasmine syntax for writing tests at http://jasmine.github.io/

and how to configure karma http://karma-runner.github.io/0.12/config/configuration-file.html

I hope it helps you

Monadnock answered 18/2, 2014 at 14:7 Comment(3)
thanks for your reply but I want to know more about how to test controller and factories in angularjs. Specialy how to test the backend webservices. Can you please help me on that.Bangalore
Check the first article, its really explicit. For test backend webservices you should use fake data with $httpbackend docs.angularjs.org/api/ngMock/service/$httpBackendMonadnock
That yearofmoo.com article is really out of date and the depednencies don't resolve currectly. github.com/yearofmoo-articles/AngularJS-Testing-Article/issuesDialectic

© 2022 - 2024 — McMap. All rights reserved.