question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When updating to latest version of @angular-builders/jest tests fail

See original GitHub issue

Describe 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

For Tooling issues:

  • Node version: 14.15.1
  • Platform: Mac

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
astikcommented, Sep 2, 2021

You are absolutely right! Removing unneeded / unknown configuration from the test builder fixed everything! Thank you =)

2reactions
just-jebcommented, Sep 2, 2021

I’m curious, why do you need polyfills entry in your test 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 to ng test just like you pass them to jest).

My guess is that polyfills is a leftover from Karma builder you can safely remove it. The only options needed in angular.json are those mentioned here.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found