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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.