question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Using multiple presets

See original GitHub issue

Hey @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:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lonix1commented, Apr 2, 2019

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.

0reactions
lonix1commented, Aug 25, 2020

@RaviH Sorry I don’t use this anymore 😦

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found