New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test cannot read config when upgrading jest-expo to 41.0.1 #13577
Comments
Hi @hyochan, thanks for writing in. If you upgraded to Expo SDK 42, you also have to use |
@byCedric Opps I am really sorry. I mentioned the wrong version. Yes! I've tried with expo sdk You can test the reproducible demo I've mentioned in the issue. This works in |
Hi I'm experiencing this same issue with versions: "expo": "42.0.0",
"jest-expo": "42.0.1", |
this seems related to this diff: #7557 @EvanBacon plans to investigate. you can use jest-expo@42.0.0 for now if this is a problem in your app. |
Hi @EvanBacon Thank you for trying it. I think you have not In case if this is a problem with the node version, I'll specify the versions below.
|
Can repro now, adding moduleFileExtensions: ['js', 'ts', 'tsx', 'svg', 'png', 'json'], I'll open a PR to improve the error message, it should surface the babel/jest error: [BABEL] /Users/evanbacon/Documents/GitHub/lab/dooboo-expo/app.config.ts: Cannot find module './modules-by-versions' from 'get-modules-list-for-target-version.js'
Require stack:
node_modules/core-js-compat/get-modules-list-for-target-version.js
node_modules/@babel/preset-env/lib/polyfills/corejs3/usage-plugin.js
node_modules/@babel/preset-env/lib/index.js
node_modules/@expo/config/build/getBabelPreset.js
node_modules/@expo/config/build/evalConfig.js
node_modules/@expo/config/build/getConfig.js
node_modules/@expo/config/build/Config.js
node_modules/@expo/config/build/index.js
node_modules/jest-expo/src/preset/createMockConstants.js
node_modules/jest-expo/src/preset/setup.js
However, Jest was able to find:
'./modules-by-versions.json'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'ts', 'tsx', 'svg', 'png'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring (While processing: "base$0") |
@EvanBacon Yeah it works perfectly! Providing |
Thanks for raising, the issue! Should be a pretty nice improvement in expo/config. |
Summary
When upgrading
jest-expo
from42.0.0
to42.0.1
, it suddenly can't read config atapp.config.ts
so the tests fail.Managed or bare workflow? If you have
ios/
orandroid/
directories in your project, the answer is bare!managed
What platform(s) does this occur on?
Android, iOS, Web
SDK Version (managed workflow only)
42.0.1
Environment
Reproducible demo or steps to reproduce from a blank project
I am managing expo version updates in https://github.com/dooboolab/dooboo-expo.
Clone the repository
Check out the branch
Install packages
Run tests
Upgrade jest-expo from
42.0.0
=>42.0.1
and run test again.Then tests breaks with below error.
The text was updated successfully, but these errors were encountered: