Skip to content

HenryKenya/angular-unit-testing

Repository files navigation

Angular Unit Testing Fundamentals

A simple application to demonstrate fundamentals of how to write unit tests using Jasmine in Angular.

The test focuses on testing components and services.

Topics covered

  1. Unit tests for components
  2. Unit tests for services
  3. Using MockData in services
  4. Creating spys and spyObjects and how to use them
  5. fakeAsync
  6. Testing event handlers like button clicks
  7. Checking for html elements

Running the app

To begin using the application, clone the repo and run the command npm install

To begin the development server, run the command ng serve

Running the tests

To run tests and see which one passes run ng test

To see the test coverage, run ng test --test-coverage

Acknowledgments

Typicode json placeholder was used fetching and posting data

About

Application to demonstrate the fundamental concepts of Angular unit testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published