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
This causes custom transfomers to be applied after default transfomers. This makes it impossible to apply more specific transformations because the more general transformation has a higher priority,
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
Describe the bug
Custom Jest transformations are applied after default transformations.
Did you try recovering your dependencies?
Yes
npm --version: 6.14.2
Which terms did you search for in User Guide?
transform, jest
Environment
current version of create-react-app: 3.4.0
running from C:\Users*****\AppData\Roaming\npm-cache_npx\2056\node_modules\create-react-app
System:
OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Binaries:
Node: 12.2.0 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 6.14.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.18362.449.0
Internet Explorer: 11.0.18362.1
npmPackages:
react: ^16.12.0 => 16.13.0 (16.2.0)
react-dom: ^16.12.0 => 16.13.0
react-scripts: 3.4.0 => 3.4.0
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
Expected behavior
Console should show contents of the text file.
Actual behavior
Console shows file name of the text file.
Source of the issue
The issue is caused in file createJestConfig.js:
This causes custom transfomers to be applied after default transfomers. This makes it impossible to apply more specific transformations because the more general transformation has a higher priority,
In this case:
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': resolve('config/jest/fileTransform.js')
prevents my "\.txt$": "jest-raw-loader" from working.
Possible fix
I would fix this by following change:
This would give higher priority to custom transformers while still allowing overriding default transformers.
But not 100% sure if this a bug in the first place (I'm not very familiar with Jest configuration).
The text was updated successfully, but these errors were encountered: