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
Review the README.md file to understand the bug and how to test.
Run yarn install to install dependencies
Update the jest.config.js file to enable one of the four provided scenarios
Run yarn test to observe the effects of the jest.config.js file
Expected behavior
When I specify multiple transform entries in the Jest configuration object that (1) use the same preprocessor, (2) have differing match patterns, and (3) have differing custom preprocessor configurations, then I expect the correct preprocessor configuration to be used based on the file being transformed.
Consider the following transform object (note that this is a nonsensical configuration, meant only to illustrate the problem):
When Jest transforms .ts files, then I expect processor to be used with CONFIG_1. Likewise, when .js files are transformed, then processor should be passed CONFIG_2.
Actual behavior
The latest entry of a given processor will always overwrite the configuration of all other uses of that processor. This means that, provided the same example above, whenever processor is used, it will always be passed CONFIG_2 (even for .ts files!).
Additional context
As mentioned in the example repository, this is caused by the transformCache and how it caches transformer configuration solely based on the preprocessor path.
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.
Version
29.3.1
Steps to reproduce
README.md
file to understand the bug and how to test.yarn install
to install dependenciesjest.config.js
file to enable one of the four provided scenariosyarn test
to observe the effects of thejest.config.js
fileExpected behavior
When I specify multiple
transform
entries in the Jest configuration object that (1) use the same preprocessor, (2) have differing match patterns, and (3) have differing custom preprocessor configurations, then I expect the correct preprocessor configuration to be used based on the file being transformed.Consider the following
transform
object (note that this is a nonsensical configuration, meant only to illustrate the problem):When Jest transforms
.ts
files, then I expectprocessor
to be used withCONFIG_1
. Likewise, when.js
files are transformed, thenprocessor
should be passedCONFIG_2
.Actual behavior
The latest entry of a given processor will always overwrite the configuration of all other uses of that processor. This means that, provided the same example above, whenever
processor
is used, it will always be passedCONFIG_2
(even for.ts
files!).Additional context
As mentioned in the example repository, this is caused by the
transformCache
and how it caches transformer configuration solely based on the preprocessor path.Environment
The text was updated successfully, but these errors were encountered: