📖 This example is part of the free online book: Testing Angular – A Guide to Robust Angular Applications . 📖
This repository builds a simple counter with Angular in three ways:
- CounterComponent: Counter that manages its own state. Has an Input and an Output.
- ServiceCounterComponent: Counter that stores the state in shared service.
- NgRxCounterComponent: Counter that uses NgRx to manage the count and NgRx effects to persist them on the server.
- Angular Flickr Search – a more complex example app
- Angular testing workshop
- Clone the repository, change into the
angular-workshop
directory npm install
npm install -g @angular/cli
ng serve
- Navigate to http://localhost:4200/
Run ng test
to execute the unit & integration tests with Karma and Jasmine.
Run ng run angular-workshop:cypress-run
to execute the Cypress end-to-end tests. (This starts the development server automatically.)
Run ng run angular-workshop:cypress-open
to start the interactive Cypress test runner.
Run ng e2e
to execute Cypress end-to-end tests. (This starts the development server automatically.)
Run ng deploy --base-href=/angular-workshop/
to the deploy the code to [https://9elements.github.io/angular-workshop/].