Bhuvanesh Mohankumar

Bhuvanesh Mohankumar

  • 149
  • 12.3k
  • 3m

How to implement Unit Test in AngularJs

Apr 25 2016 6:24 AM

I have read many document for Unit testing for Angular JS.

Can some one give me in clear steps and sample for implementing Controller unit test in AgularJs application.

 
Thanks in advance. 
 

Answers (2)

0
Bhuvanesh Mohankumar

Bhuvanesh Mohankumar

  • 149
  • 12.3k
  • 3m
Apr 26 2016 4:48 AM

Thanks Sakthi,

Yes I have gone through those articles, its good.

If anyone share a very simple sample snippet to execute will be very helpful.
 
where  the examples in the link are some what complex for beginners.
 
Thanks. 
 
 
0
Shakti Singh Dulawat

Shakti Singh Dulawat

  • 327
  • 5.4k
  • 388k
Apr 25 2016 8:21 AM
Please find their sample project https://github.com/angular/angular-seed
 

These articles cover the initial setup with Jasmine, Karma and a primer for writing tests:

http://www.bradoncode.com/blog/2015/05/12/angularjs-testing-getting-started/
A quick-start guide to writing unit tests using Jasmine for AngularJS.
http://www.bradoncode.com/blog/2015/05/17/angularjs-testing-controller/
A quick-start guide to writing unit tests for AngularJS controllers using Jasmine and ngMock.
http://www.bradoncode.com/blog/2015/05/19/karma-angularjs-testing/
A quick-start guide to writing unit tests for AngularJS controllers using Karma and Jasmine.