Jest is a popular alternative to Karma + Jasmine. If you use Nrwl Nx, you can get it by default (but can choose Karma if you wish).
The syntax is very similar to Jasmine - more than 50% is exactly the same. If you know Jasmine, you'll immediately understand this:
it("#getValue should return value", () => {
const spy = jest.spyOn(someService, "getValue");
spy.mockReturnValue("stub value");
expect(service.getValue()).toBe("stub value");
expect(spy).toHaveBeenCalled();
});The bit where Jest really shines ahead of Jasmine (apart from speed) is Snapshot Testing. See this article for an intro to Snapshot Testing
- The official docs for Jest
- Some Angular Jest Unit Test Examples
- A video on writing Angular unit tests
- Advice on changing Jasmine test syntax to Jest