-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
jest-preset-angular v8 has breaking changes #1979
Comments
Hi, I have the same problem after upgrading to latest
Now the tests are found and being executed, but unfortunately I got some other error:
|
It looks, NX is not compatible with the |
Thank you folks! Are you interested in submitting a PR updating Nx to work with the new version of |
I'll take a pass at it |
Updates to jest-preset-angular to v8.0.0, includes migrations to fix any existing projects affected by the jest-preset-angular update. closes nrwl#1979
Updates to jest-preset-angular to v8.0.0, includes migrations to fix any existing projects affected by the jest-preset-angular update. closes nrwl#1979
Updates to jest-preset-angular to v8.0.0, includes migrations to fix any existing projects affected by the jest-preset-angular update. closes nrwl#1979
Updates to jest-preset-angular to v8.0.0, includes migrations to fix any existing projects affected by the jest-preset-angular update. closes nrwl#1979
Nice, I feel like upgrade to jest-angular-preset will help with problems I have. Cant wait until this is there |
How does it look guys? Any plans? |
Hi, I am trying to update my nrwl workspace and any other referenced packages to the latest versions (see attached It seems the trouble has started with a change in the
It seems that was done because of a change in jest 24. Ok fair enough, let's tackle this. First I tried to by-pass that configuration by providing my own in the corresponding
Sadly this was not working. I tracked it down to the implementation of jest.impl.js, which is simply overwriting the complete
Right, that out of the way, lets tackle the root cause of the problem: fixing the issues that causes the problems in the first place. In my case I am using a custom type definition to be able to use some functions from a third-party lib (ramda-extensions) that does not have a *.d.ts implementation, and although my code is peforming fine on runtime (with my root customized
However, when running my tests I get still get a TS error (TS7016: Could not find a declaration file for module 'ramda-extension').
An now the test is running, but although this fixes this issue, it doesn't seem that scalable to me, because this is a core utility that is referenced by almost every module, I have to add this to the So maybe I'm missing something here, but to me it seems this isn't the way to go, but I'm not sure whether this works as intended or is just the result of a bug or faulty implementation. In any case I find it somewhat misleading that there is an extends sections in the Ok, finally got that working, but sadly the next problem arose, and I think this is the thoughest problem of them all: After a lot of google searches I finally ended up here: thymikee/jest-preset-angular#288 (which is not the same issue, but might be a clue) and finally in this current issue: #1979 So it seems the current version of your library is not compatible with the latest versions of angular, jest and jest-preset-angular. Our project is not publicly available, but I can provide you with more research information, but I first wanted to get some attention, then maybe we can have a more detailed and narrowed down discussion than simple giving you all my findings. Hope to hear something from any core contributors any time soon, because I'm stuck at the moment. |
in your module, you may have the file jest.config.js with the following content.
comment or remove the member "snapshotSerializers". It is not needed. Worked for me,
|
@ashokshetty1970 didn't work for me. File not found: jest-preset-angular/InlineHtmlStripStylesTransformer (resolved as: D:\dev\web\apps\aha\jest-preset-angular\InlineHtmlStripStylesTransformer)
at ConfigSet.resolvePath (../../node_modules/ts-jest/dist/config/config-set.js:712:19)
at ../../node_modules/ts-jest/dist/config/config-set.js:225:98
at Array.map (<anonymous>)
at ConfigSet.get (../../node_modules/ts-jest/dist/config/config-set.js:225:64)
at ConfigSet.tsJest (../../node_modules/ts-jest/dist/util/memoize.js:43:24)
at ConfigSet.get (../../node_modules/ts-jest/dist/config/config-set.js:297:41)
at ConfigSet.versions (../../node_modules/ts-jest/dist/util/memoize.js:43:24)
at ConfigSet.get (../../node_modules/ts-jest/dist/config/config-set.js:583:32)
at ConfigSet.jsonValue (../../node_modules/ts-jest/dist/util/memoize.js:43:24)
at ConfigSet.get [as cacheKey] (../../node_modules/ts-jest/dist/config/config-set.js:598:25) |
I was able to get this to work locally by doing the following:
// try {
// require.resolve('jest-preset-angular');
// Object.assign(tsJestConfig, {
// stringifyContentPathRegex: '\\.(html|svg)$',
// astTransformers: ['jest-preset-angular/InlineHtmlStripStylesTransformer']
// });
// }
// catch (e) { } Going forward, I believe there are a few things we should consider:
|
Any updates on this? What is needed to get this merged into the next release? |
Updates to jest-preset-angular to v8.0.0, includes migrations to fix any existing projects affected by the jest-preset-angular update. closes nrwl#1979
Updates to jest-preset-angular to v8.0.0, includes migrations to fix any existing projects affected by the jest-preset-angular update. closes nrwl#1979
Updates to jest-preset-angular to v8.0.0, includes migrations to fix any existing projects affected by the jest-preset-angular update. closes nrwl#1979
* feat(testing): update to jest-preset-angular v8.0.0 part 1 Updates to jest-preset-angular to v8.0.0, includes migrations to fix any existing projects affected by the jest-preset-angular update. closes #1979 * feat(testing): update jest-preset-angular to v8.0.0 part 2 Closed issues: #1979, #2165 Co-authored-by: Joshua D. Mentzer <mentzerj@trinity-health.org> * feat(testing): update jest-preset-angular to v8.0.0 part 3 Co-authored-by: mentzerj <mentzerj@trinity-health.org> Co-authored-by: Mehrad Rafigh <4339673+mehrad-rafigh@users.noreply.github.com>
Due to BC incampatibility in v8 (see nrwl/nx#1979)
Due to BC incampatibility in v8 (see nrwl/nx#1979)
@leon I managed to fix it by changing Since in latest version of jest they have been moved under |
With jest 24.9.0 and jest-preset-angular 8.0.0 as dev dependencies, I found in jest.config.js the entry |
i literally checked node_modules/jest-preset-angular/build folder and the files, InlineFilesTransformer, StripStylesTransformer, HTMLCommentSerializer and AngularSnapshotSerializer are nowhere to be foung. any idea what's causing this issue?
|
Same here, when I run
My package dependecies:
|
Please check the BREAKING CHANGES here https://github.com/thymikee/jest-preset-angular/blob/cf3874b8d856a0977e9ee5b24a12eadf940481a5/CHANGELOG.md#breaking-changes SOLUTION:
|
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Please make sure you have read the submission guidelines before posting an issue
Prerequisites
Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.
Expected Behavior
Running jest tests does not fail
Current Behavior
Jest tests fail with the following error message:
Steps to Reproduce
Other
I looked into jest-preset-angular and it seems that they introduced a build folder with v8 thus the path is not correct anymore.
The text was updated successfully, but these errors were encountered: