When updating to latest version of @angular-builders/jest tests fail
See original GitHub issueDescribe the Bug
After updating to the latest 12.1.1 version from 12.1.0 version. I get this error when running tests with ng test:
Schema validation failed with the following errors: Data path "/polyfills" must be array.
Expected Behavior
No error in the runner when running tests
Environment
Libs
- @angular/core version: 12.2.3
- @angular-devkit/build-angular version: 12.2.3
- @angular-builders/jest version: 12.1.1
For Tooling issues:
- Node version: 14.15.1
- Platform: Mac
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
jest tests keep failing after upgrade to angular 13 and ... - GitHub
Version 11.1.1 Steps to reproduce Hello, Upgraded an existing angular application from v12.2.0 to 13.2.7. After the angular upgrade tests ...
Read more >After upgrading to Angular 8 testing with Jest broken
It turns out that the ng update command didn't update the versions of some dependencies. In my case, I needed to get a...
Read more >@angular-builders/jest - npm
Jest runner for Angular build facade. Allows ng test run with Jest instead of Karma. Latest version: 15.0.0, last published: 6 days ago....
Read more >Angular 14 + Jest: tests running fails with "Unknown arguments
1. Setup an Angular project with Jest as testing framework. · 2. Update Angular to v14. · 3. Update Jest to v28 ·...
Read more >Angular CLI: “ng test” with Jest in 3 minutes (v2) - Medium
Running the tests with Jest. To run the tests: ng test; You can specify Jest CLI options either in builder options (useful when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are absolutely right! Removing unneeded / unknown configuration from the test builder fixed everything! Thank you =)
I’m curious, why do you need
polyfills
entry in yourtest
target at all when using@angular-builders/jest
builder?Here is the builder’s schema, it doesn’t contain a
polyfills
field. The reason you’re getting this error is that all the additional (non-schema) fields are considered an array of strings (so that you’d be able to pass filenames tong test
just like you pass them tojest
).My guess is that
polyfills
is a leftover from Karma builder you can safely remove it. The only options needed inangular.json
are those mentioned here.