[Question] Compatibility with jest-preset-angular
See original GitHub issueHas anyone used this library in a monorepo project with the jest-preset-angular preset, which configures ts-jest
in a way that conflicts with this library.
I tried this which doesn’t work (nameof is detected, but then the preset fails and so the tests don’t run):
globals: {
"ts-jest": {
tsConfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
astTransformers: [
"ts-nameof",
require.resolve("jest-preset-angular/InlineHtmlStripStylesTransformer"),
],
}
},
In fact is it even possible to use multiple presets or transformers?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Ivy compatibility · Issue #409 · thymikee/jest-preset-angular
Hi @JiaLiPassion, I know that you work on zone.js but I wonder if you are also familiar with Angular compiler area ? We...
Read more >Angular >=13 | jest-preset-angular - GitHub Pages
jest -preset-angular currently supports testing with Jest in CommonJS mode with Angular 13 using default preset. With Jest 28 and jest-preset-angular v12. 0.0, ......
Read more >jest-preset-angular - npm
ngcc-jest-processor will compile any Angular format packages to umd format which is compatible with CommonJS that Jest is using.
Read more >Newest 'jest-preset-angular' Questions - Stack Overflow
"jest-preset-angular" is a collection of default settings, Jest Serializers and AST Transformers to make Angular (v2+) compatible to be tested by Jest. Learn ......
Read more >Testing Angular 2 and Continuous Integration with Jest
Next, add a file setup-jest.ts to the src directory: import 'jest-preset-angular';.
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 FreeTop 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
Top GitHub Comments
The compiler never listens to my prayers either 😞
No, it’s fine—keep it open. I’ll look into it eventually.
Also, opened #52.
I tried many things, like:
require.resolve
In all cases the jest-angular stuffs works, but nameof fails. But if I use nameof alone it works brilliantly.
I think you’re right it’s a problem with ts-jest. Please don’t do anything about this as because you don’t use angular, so I don’t want you to waste your time. I see there are quite a few angular users besides me, so hopefully one of them will join this issue with some ideas!
Should I go ahead and close?