/dry-angular-testing

Keeping Angular unit tests DRY

Primary LanguageTypeScriptMIT LicenseMIT

DRY Angular testing

This project showcases the use of a test context, passed through Jasmine's user context, to avoid code duplication and centralizes the use of Angular's testing utilities. For more information on how this works, check out this blog post (the actual code has slightly evolved since then, but the explanation is still valid).

Angular CLI use

This project was generated with Angular CLI version 1.2.1.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|module.

Running unit tests

Run ng test to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.