This is a quick guide to setup Jest in your new Angular 10 application
1. Install Jest
npm install jest @types/jest jest-preset-angu...
For further actions, you may consider blocking this person and/or reporting abuse
[03/2021] For remove warnings:
ts-jestconfig The option
tsConfig
is deprecated and will be removed in ts-jest 27, usetsconfig
insteadwhat do we do about this one?
write
tsconfig
in lower case, don't use camel case styleThank you for posting this article! I just upgraded an Angular 9 app to Angular 10 and was running into errors using Jest. I tweaked my Jest configurations using the steps in this post and everything worked like a charm.
I followed all the steps, i am getting below error:
zone-testing.js is needed for the async() test helper but could not be found.Please make sure that your environment includes zone.js/dist/zone-testing.js
Change your setupJest.ts file to import 'jest-preset-angular/setup-jest';
work for me. Thanks
Thank you! @saluce65
I don't know who you are, but thank you
Why src/test.ts you remove in step 4. but use in steps 6 and 7?
Thanks! I will remove it =)
There is a way of having the builder/executor test but using jest instead?
It's the ultimate solution, otherwise you need to put several npm scripts for all projects/libraries on your workspace
Very useful!
Thank you very much. I followed this guide for Angular: 12.2.8.
What version of Jest,@type/jest and jest-preset-angular is compatible with Angular 11?