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.
tutorial and resources for AngularJS Karma [closed]
Asked Answered
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
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/$httpBackend –
Monadnock
That yearofmoo.com article is really out of date and the depednencies don't resolve currectly. github.com/yearofmoo-articles/AngularJS-Testing-Article/issues –
Dialectic
© 2022 - 2024 — McMap. All rights reserved.