You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow a means to white list transformIgnorePatterns.
Motivation
Currently, we need to transform modules in node_modules, for code that is published as raw ES6, code published as raw TypeScript, or code published as raw React.
Even though transformIgnorePatterns is an array, the moment, we want to whitelist these projects, they must all be specified on one line, as ignoring /node_modules/ will always capture if entered solo; multiple white-lists cannot work as they are non-overlapping ignores, and will incorrectly capture.
it's getting to the point of that regex becoming very unwieldly, unintuititive, as needs to whitelist approximately 45 modules. I don't see this becoming easier over time as more and more projects publish uncompiled code.
It would be nice to clean this up and whitelist specific modules more intuitively.
transformIgnorePatterns: [
'/node_modules/', // ignore by default
'!/node_modules/@namespace1/project1', // whitelist, with ! magic prefix
'!/node_modules/@namespace1/project2',
'!/node_modules/@namespace2/project2,
'!/node_modules/unnnamespace-project-1'
]
or even
transformIgnorePatterns: [
'/node_modules/', // ignore by default
],
// New config: whitelistPatterns runs first; if match, ok. ignorePatterns run second, if match not-ok.
transformWhitelistPatterns: [
'/node_modules/@namespace1/project1/',
'/node_modules/@namespace1/project2/',
'/node_modules/@namespace2/project2/,
'/node_modules/unnnamespace-project-1/'
]
Pitch
Lots of confusion over how to make Jest work with other tooling.
When the correct solution advertised on stackExchange is "migrate to mocha" (which we did for a few projects, and indeed -- it just worked) it implies that a core functionality is lacking.
Specific Use Case:
Jest - Babel - Lerna monorepo - Typescript - React Native.
I wish to avoid migrating all our repositories back to mocha.
Conversion to mocha/chai is a workable solution; but it would be nice to use jest, and have one testing throughout our ecosystem.
The text was updated successfully, but these errors were encountered:
We're planning configuration revamp and this seems in line with it. See: #7185. Feel free to suggest more adjustments. I'm gonna close this, hope you don't mind :)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🚀 Feature Proposal
Allow a means to white list transformIgnorePatterns.
Motivation
Currently, we need to transform modules in node_modules, for code that is published as raw ES6, code published as raw TypeScript, or code published as raw React.
Even though transformIgnorePatterns is an array, the moment, we want to whitelist these projects, they must all be specified on one line, as ignoring
/node_modules/
will always capture if entered solo; multiple white-lists cannot work as they are non-overlapping ignores, and will incorrectly capture.it's getting to the point of that regex becoming very unwieldly, unintuititive, as needs to whitelist approximately 45 modules. I don't see this becoming easier over time as more and more projects publish uncompiled code.
It would be nice to clean this up and whitelist specific modules more intuitively.
or even
Pitch
Lots of confusion over how to make Jest work with other tooling.
When the correct solution advertised on stackExchange is "migrate to mocha" (which we did for a few projects, and indeed -- it just worked) it implies that a core functionality is lacking.
Specific Use Case:
Jest - Babel - Lerna monorepo - Typescript - React Native.
I wish to avoid migrating all our repositories back to mocha.
Conversion to mocha/chai is a workable solution; but it would be nice to use jest, and have one testing throughout our ecosystem.
The text was updated successfully, but these errors were encountered: