Stack Overflow Asked by soul true on November 28, 2020
I am getting below error while running jest test cases in Angular. All test suites are failing with this error.
Getting typeError: (options.astTransformers || []).map is not a function
while running the test suite in Angular
This solution is for Angular 8/9/10
I would recommend doing these steps:
If the above solution not working, try installing
npm install --dev ts-jest
Answered by San Jaisy on November 28, 2020
Jest configuration for Angular can be tricky.
I recommend you use jest-preset-angular which is a library that you will import into your Angular project that will manage the configuration of Jest for Angular.
This may be related to the update of Jest 27 that deprecated astTransformers as string[]
.
Configure your Angular project to use Jest 26 with jest-preset-angular and you should be fine
Answered by Yohan Dahmani on November 28, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP