Skip to content

Latest commit

 

History

History
14 lines (7 loc) · 1.03 KB

README.md

File metadata and controls

14 lines (7 loc) · 1.03 KB

Testing an Angular application with Jest

Comments appreciated

I've created this repository to learn how to use Jest and to collect best practices. At the time of writing, I'm a rookie, and you - dear reader - are probably more expert than me. In other words: I'm open to suggestions on how to improve the demos and the corresponding article on https://www.beyondjava.net/jest-mocks-and-spies.

Angular 17

The Angular team published experimental support for Jest with Angular 16, but it took me until Angular 17 to take it for a ride. You find the result in the Angular 17 folder. It's probably not perfect: the Angular team hasn't published a tutorial yet (or I didn't find it), so much of my code is guesswork.

Angular 15 and below

Before Angular 16, there was no official support for Jest, but several great community solutions. The folder Angular 15 and below shows how to use Jest with an older Angular version. When I created the repository, Angular was at version 12, so I guess the recipe works for all versions from 12 to 15.