Demystify is a web-based application to demonstrate and demystify Angular unit testing.
Screenshot:
File structure:
demystify |____ src/ | |___ app/ | | |___components/ | | | |___ user-list/ | | | |___ user-list.component.css | | | |___ user-list.component.html | | | |___ user-list.component.spec.ts | | | |___ user-list.component.ts | | |___interfaces/ | | | |___ user.ts | | |___services/ | | |___ user.service.mocking-bird.spec.ts | | |___ user.service.spec.ts | | |___ user.service.ts | |___ app-routing.module.ts | |___ app.component.css | |___ app.component.html | |___ app.component.spec.ts | |___ app.component.ts | |___ app.module.ts | |___ assets/ | |___ images/ |___ package.json |___ README.md |___ ...
This project was generated with Angular CLI version 11.1.2.
- Karma
- Jasmine framework
- ts-mocking-bird library
- Clone this repository
$ git clone https://github.com/pkErbynn/demystify.git
- Navigate to the root directory
$ cd /demystify
- Run the following command to serve the application locally.
$ ng serve --open
Run this command to execute the unit tests via Karma.
$ ng test
Service testing result (using Jasmine & ts-mocking-bird):
Component testing result (using Jasmine):
All test result (from both service and component):
Thank you :)