Simple testing patterns for Angular version 2+
This repo is for Angular version 2+. More »
The goal of this repository is to have a collection of recipes for common testing scenarios with Angular. I'm happy for every contribution/suggestion :smiley:.
I've been giving a talk on "Testing with Angular".
All the scenarios are listed here below and nicely linked to the source file.
@Input()
.
@Output()
, more specifically the EventEmitter
type.
fakeAsync
and discardPeriodicTasks()
.
*ngIf
statements etc.
<ng-content>
directives.
async()
as well as fakeAsync()
functions.
MockBackend
provided by Angular to respond to http calls.
If you want to run the example locally,
npm install
npm test
to execute all the testsBy running npm run test.watch
you can run the tests in watch mode which is particularly useful during development.
Wanna help? Of course! Just open an issue and/or send me a PR :smiley:.