3
3 Comments

Angular Unit Testing...

I'm at a point in my project where I want to introduce unit tests.

I'm familiar with unit testing in Java and Python, but I am having trouble grasping the concept of testing from within the UI code stack.

Can you suggest a helpful site or tutorial that explains the essential concepts of unit testing in Angular?

on November 9, 2022
  1. 2

    Hey, you can write unit tests using Jasmine + Karma where you can either test classes or components, or you can write integration tests using e.g. Cypress. It really depends on what you want to test.

    I suggest starting from the docs: https://angular.io/guide/testing. Read that Testing chapter and all subchapters, they are brief.

    1. 1

      Thanks, I'm working through that document this week.

  2. 1

    There are some great ways to test Angular UIs in addition to just unit testing. One of my favorites is using #cypress.

    UI Testing can be a challenging though so I built a tool softwaretesting.ai that uses ai to automatically generate tests for your code. Just download the extension and sign up for a free account, then you can highlight the code you want to test and we take care of the rest!

    Download it here:
    https://marketplace.visualstudio.com/items?itemName=SoftwareTestingAI.softwaretestingai-extension