Skip to content

dynamicbalaji/ngTestingDemo

Repository files navigation

NgTestingDemo

This project explains how to write Unit Testing suites for Angular applications.

Topics Covered

PFB the topics covered in this project:

  • Unit Testing Fundamentals
  • Working with Strings & Arrays
  • Setup and Teardown methods
  • Working with Forms
  • Working with Event Emitters
  • Working with Spies
  • Interaction testing with Services
  • Working with Confirmation Boxes

PFB the Pattern that are covered in unit testing:

  • State Changes
  • Forms
  • Events (Output properties)
  • Services

PFB the limitations of unit testing:

  • Routers
  • Template bindings

Code Coverage

Use below command to check on the code coverage:

ng test --code-coverage

After running this command, you will find a new folder 'coverage' will be created under project folder. Open the index.html file in that folder to see the code coverage details.

Tech Stack

  • Angular CLI - 1.5.0
  • Karma - 1.7.0
  • Jasmine - 2.5.53
  • Typescript - 2.4.2
  • RxJS - 5.5.2