-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Cannot find module '@ngrx/store/testing' #1195
Comments
I think this can help: #1147 (comment) |
You need to provide |
As in the example, adding those lines into
As I have commented, I have seen the comments and guides for the update to Angular v13. I do not think it is as trivial as you say, since several of us have had the same problem and there does not seem to be a clear solution. |
The problem is that the preset doesn’t have control over Jest module resolution. The error is typical Jest error which is related to Angular 13 ESM packages. Preset is preset and users are encouraged to customize any config options if the preset config is not working. The preset we provide here works with standard angular projects without external deps. The next error is related to ngrx bug ngrx/platform#3243 . Since you are using ngrx and the error is related to it, I recommend to check there. @alorle please check upstream bug which I created for |
@alorle I got the same errors after modifying jest.config.js then this workaround worked for me: Setup your setup.jest.ts like this to disable the new destroyAfterEach default activation in Angular 13:
|
Version
11.0.0
Steps to reproduce
jest-preset-angular
to project as described in https://thymikee.github.io/jest-preset-angular/docs/getting-started/installation.@ngrx/store
to project, runningnpx ng add @ngrx/store@latest
.@ngrx/store/testing
in a test file (src/app/app.component.spec.ts
for example).npx jest
.Expected behavior
jest-preset-angular
should resolve things from@ngrx/store/testing
.Actual behavior
Running tests with
npx jest
will throw an error:Additional context
I have followed this guide to try to fix the problem: https://thymikee.github.io/jest-preset-angular/docs/guides/angular-13+#cannot-find-modules-error-when-importing-any-deep-paths-from-angular-esm-format-packages. However, I have not been lucky 😓
@ngrx/store/testing
is provided by@ngrx/store
, as you can see in their code: https://github.com/ngrx/platform/tree/master/modules/storeEnvironment
The text was updated successfully, but these errors were encountered: