Jest runner throws zonejs missing error after updating to Angular v16
We use vscode-jest-runner in our angular project. Since we updated angular to v16, getting this error
......
Formatters › .booleanFormatter
zone-testing.js is needed for the fakeAsync() test helper but could not be found.
Please make sure that your environment includes zone.js/testing
at resetFakeAsyncZone (node_modules/@angular/core/fesm2022/testing.mjs:249:11)
at Object.<anonymous> (node_modules/@angular/core/fesm2022/testing.mjs:27123:13)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 21 skipped, 22 total
Snapshots: 0 total
Time: 3.578 s
As a fix, below 2 zonejs related import statements are added to the root jest setup config, and since this issue was resolved
import 'zone.js';
import 'zone.js/testing';
However i was wondering is there a way we can fix this issue without having to change the setup config, within the jest-runner extension itself?
Hi, I think the scope of this extension is to make jest run by invoking the jest command.
It feels like having behaviour in the extension where the config automatically imports zone.js from the local package would be out of scope.
I think configs per frameworks like angular can be in separate repos like this one: https://github.com/thymikee/jest-preset-angular