[Question] Using multiple presets
See original GitHub issueHey @thymikee I appreciate this preset.
Quick question: can we use multiple presets at the same time? I can’t get it to work and I’m unsure whether it’s my config or whether it’s impossible.
I’m using ts-nameof
(brilliant library that allows nameof
in typescript!) and it wants this config:
"globals": {
"ts-jest": {
"astTransformers": ["ts-nameof"]
}
},
preset: "ts-jest",
But that will override your preset. So I combine them:
globals: {
"ts-jest": {
tsConfig: "<rootDir>/tsconfig.spec.json",
stringifyContentPathRegex: "\\.html$",
astTransformers: [
"ts-nameof",
require.resolve("jest-preset-angular/InlineHtmlStripStylesTransformer"),
]
}
},
preset: "jest-preset-angular", // <-- not a problem as it wraps ts-jest
But then your preset works, and that one fails (compiler doesn’t understand nameof
).
Can your preset be combined with other presets? I assume so because astTransformers
is an array, but in practice it doesn’t work. I just need a pointer - where do you think the problem is 1) this preset, 2) nameof preset, or 3) ts-jest?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Is it possible to use Jest with multiple presets at the same time?
I'd like to test a React component that can work both on Web and in a React Native environment. The problem is that...
Read more >The "Gotcha" of Applying Multiple Presets in Lightroom
The short answer is “Well, probably not but maybe” and because so many people had similar questions, I thought it might be a...
Read more >How To Layer Multiple Presets Together In Lightroom
That's why in this post, you'll learn not only how to create presets that can be layered but how to update existing presets...
Read more >Examples of survey questions with preset answer options. A ...
For each of the 17 activities, the survey offered seven tools as preset answers and an eighth answer option to indicate use of...
Read more >Parallel presets containing multiple amps/cabs : r/Line6Helix
HX Stomp Question - Parallel presets containing multiple amps/cabs ... Every dual amp/cab preset I've seen is intended for use in the Floor ......
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 Free
Top 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
No that doesn’t make a difference, it actually gives the same result as what I put in the original comment.
So for anyone else with this problem, the short answer is: yes, presets can be combined, and this preset seems to work perfectly in all cases.
But this particular combination doesn’t work. Probably the problem is with ts-jest or ts-nameof.
@RaviH Sorry I don’t use this anymore 😦