FAIL file-size.pipe.spec.ts
● Test suite failed to run
Cannot find module 'zone.js/dist/zone.js' from '../../../../../node_modules/jest-preset-angular/build/setupJest.js'
Require stack:
/node_modules/jest-preset-angular/build/setupJest.js
/node_modules/jest-preset-angular/index.js
src/stubs/setupJest.ts
at Resolver.resolveModule (../../../../../node_modules/jest-resolve/build/index.js:307:11)
Steps to reproduce the behavior:
System:
OS: MacOS
Npm packages:
jest: last
jest-preset-angular: last
typescript: last
Related to https://github.com/angular/angular/pull/38473#issuecomment-675865330
@ahnpnl there is still an issue after upgrading to 0.11.1: Cannot find module 'zone.js/dist/zone.js' from 'node_modules/jest-preset-angular/build/setupJest.js'
It should load zone.js/dist/zone, not zone.js/dist/zone.js, because they have changed the build setup.
Same for the proxy file.
Thanks @ocombe !
There should be a PR to update the usage of zone.js too, which was mentioned in https://github.com/angular/angular/pull/38473#issuecomment-674404753 .
cc @JiaLiPassion
I have the same problem what have mentioned @ocombe
the workaround in the meanwhile is
manually copy the content of node_modules/jest-preset-angular/build/setupJest.js to a file in your project
adjust all the import for zone.js
import that file into your setup jest file
Sorry for the inconveniences, now 0.11.1 is available, I will create a PR to update.
https://github.com/thymikee/jest-preset-angular/blob/master/src/setup-jest.ts#L5
@JiaLiPassion @ahnpnl
correct will be
require('zone.js/dist/zone');
Oh, I see, awesome PR
https://github.com/thymikee/jest-preset-angular/pull/448/files
Close via #448
Most helpful comment
@ahnpnl there is still an issue after upgrading to 0.11.1:
Cannot find module 'zone.js/dist/zone.js' from 'node_modules/jest-preset-angular/build/setupJest.js'It should load
zone.js/dist/zone, notzone.js/dist/zone.js, because they have changed the build setup.Same for the proxy file.