Testing setup with Webpack and Karma

There are two runners to execute tests:

  • HTML runner from the Jasmine's standalone distribution (https://github.com/jasmine/jasmine/releases): Download the ZIP file, unzip it, and open the SpecRunner.html file in any text editor. This HTML file includes some base code that loads the test framework. You need to add regular Angular dependencies, an Angular testing library, and a SystemJS loader, which loads the .spec files. After that, you can open the HTML file in your web browser to see the test results.
  • Command-line runner Karma: Karma can run tests in different browsers and report possible errors with various reporters. The runner can be integrated into the build process so that the unit tests get executed ...

Get Angular UI Development with PrimeNG now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.