Using Jest with angular 18
Jest in Angular.
Is Jest still going to be integrated officially with Angular?
Solution for NullInjectorError: No provider for _HttpClient! (Angular 17.3.3)
Videos
» npm install jest-preset-angular
Im currently working with implementing testing on my work project and get it to work but since we are using angular 18 with signals inputs/outputs/etc. Does anyone have any experience, resource or anything to share?
Hello,
I want to hear from the community about Jest tests in Angular.
I have started using it because I listened to some opinions about is fast and "easy" to mock components, services, and so on.
Example:
- I have created a test on a mat toolbar to ensure that some menu items are shown or hidden depending if the user is an admin.
- PR: https://github.com/hseleiro/Organizer/pull/59
- Component: https://github.com/hseleiro/Organizer/blob/test/toolbar-component-jest-test/src/app/shared/components/toolbar.component.ts
- Unit Test: https://github.com/hseleiro/Organizer/blob/test/toolbar-component-jest-test/src/app/shared/components/toolbar.component.spec.ts