`Schema validation failed` Error when running tests and updating @angular-builders/jest from `7.3.1` to `8.0.1`
See original GitHub issueFirstly, apologies if this has already been answered. I can’t seem to find any issues or comments with this error.
I have just updated my version of @angular-builders/jest from 7.3.1 to 8.0.1. From what i understand, issues should be raised here. When I run my tests I now get the following error (it was working fine before):
Schema validation failed with the following errors:
Data path ".builders['run']" should have required property 'class'.
Error: Schema validation failed with the following errors:
Data path ".builders['run']" should have required property 'class'.
....
I can’t see anything in the doc’s to advise me what this issue might be, I guess there is a breaking change, but i don’t use transform or global in my configurations.
I would like to update this as my code coverage is a bit misleading at the moment.
Hopefully, someone here knows what the issue is.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10
Top Results From Across the Web
Schema validation failed with the following errors: Data path ...
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) ......
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 >Bug listing with status RESOLVED with resolution OBSOLETE ...
status:RESOLVED resolution:OBSOLETE severity:enhancement · Bug:5012 - "ALSA ebuild error" status:RESOLVED resolution:OBSOLETE severity:normal ...
Read more >SUSE-CU-2022:78-1: Security update of caasp/v4/prometheus
bsc#1182419 CVE-2020-36222 - assertion failure in slapd in the saslAuthzTo validation, resulting in denial of service.
Read more >Lesson 8: Setting up Tests with Jest and Cypress | Elite Ionic
Schema validation failed with the following errors: Data path "/assets/0" must be string. Make sure to update the "test" entry in your angular.json...
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 Free
Top 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
Can confirm that it works with Angular v8!
Here the changes I had to make from a newly generated Angular app to make the tests run in jest.
great stuff!
just dont delete the fakeAsync from tests, what if we want to test asynchronously? solution: add these 2 imports on 1st line of setup-jest.ts import ‘zone.js’; import ‘zone.js/dist/zone-testing.js’;
and in jest.config.js i had to change setupFilesAfterEnv to
setupFilesAfterEnv: [‘<rootDir>/setup-jest.ts’],
Also, those are needed in same file for tests to work properly:
import { TestBed } from ‘@angular/core/testing’; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from ‘@angular/platform-browser-dynamic/testing’; TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
Thanks