pkErbynn / demystify

A UserListing application that fully incorporate and demystifies Angular unit testing using Jasmine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demystify

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.

Technologies

  • Karma
  • Jasmine framework
  • ts-mocking-bird library

Usage

  1. Clone this repository
$ git clone https://github.com/pkErbynn/demystify.git
  1. Navigate to the root directory
$ cd /demystify
  1. Run the following command to serve the application locally.
 $ ng serve --open

Running unit tests

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 :)

About

A UserListing application that fully incorporate and demystifies Angular unit testing using Jasmine


Languages

Language:TypeScript 73.5%Language:HTML 10.8%Language:JavaScript 9.5%Language:CSS 6.3%