AngularJS testing

From Wiki @ Karl Jones dot com
Revision as of 14:02, 31 December 2016 by Karl Jones (Talk | contribs) (Created page with "The AngularJS framework includes Jasmine testing framework. * Import all necessary Jasmine methods from <code>angular2/testing<...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The AngularJS framework includes Jasmine testing framework.

  • Import all necessary Jasmine methods from angular2/testing
  • Import the classes to test
  • Include providers by importing beforeEachProviders and then calling it with a method that returns an array of imported providers.
  • Inject providers by calling inject([arrayOfProviders)], (providerAliases)=>{}) inside a beforeEach or it block

See also