Skip to content

chazzlabs/angular_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Codeship Status for chazzlabs/angular_example

This is a refactor and improvement on the Angular/Karma/Jasmine tutorial found here:

http://blog.cubettech.com/unit-testing-in-angular-applications

This example is intended to show how to begin unit testing an application using Karma and Jasmine. Feel free to comment with questions or suggestions.

#Running

After cloning this repo, install all dependencies via npm:

npm install

Then run the unit tests using Karma or npm:

karma start

or

npm test

#Focal points In lieu of making the project unreadable by adding a bunch of comments, here's a list of things to take note of while reading through the project files:

  • Organization of the tests using "describe" and "it"
  • Keeping a reference to our controller so we can call its functions and access its attributes
  • Using Jasmine's spyOn() to spy on functions called within our target function
  • Directive unit test is very simple since our directive isn't doing much

About

A sample AngularJS app with unit testing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published