Consultingwerk Blog

Unit Testing Angular Web Applications

by Radu Nicoara | Dec 16, 2020

How many times have you feared deploying your work because even though you’ve tested, re-tested then finally re-re-tested, clicked all the buttons, navigated to every screen, you just couldn’t ever be one hundred percent sure that everything works in every case?

If you can relate to that feeling, I highly recommend checking out the recording of the presentation I held during the 2020 PUG Challenge virtual conference below. It goes into detail discussing the Angular basics and how they can be tested. Further, the session covers many useful concepts, such as spying on method calls, automating screenshots at precise moments in the test runner’s life cycle, running your tests in a headless browser so that they may be part of a CI pipeline and much more.

If Karma, Jasmine and Nightmare sound to you like random words extracted from a message found inside a fortune cookie, this session might be for you ;)

In it, I cover the following:

  • Angular basics
    • Components
    • Services
    • Pipes
    • Modules
  • The Karma Test Runner
  • The Jasmine Testing Framework
  • Nightmare headless browser
  • Spies
  • Fitting all of the above pieces together to produce useful unit tests for your applications, including automated screenshots!