Mock not working in 12.1.0
Closed this issue · 10 comments
After updating to 12.1.0
, the mock is causing an error when running my tests
Cannot find module '../src/types' from 'node_modules/@react-native-google-signin/google-signin/jest/build/setup.js'
Here is what the module looks like when installed
Repository with code that reproduces the issue
-
You must provide a minimal and easy-to-run reproduction of your issue - how to create a minimal reproduction?. We're a small team of maintainers and do not have time to try reproduce bugs ourselves.
-
Please try to reproduce the bugs on the provided example app. Either provide a link to the repo that reproduces the bug or provide your version of the
index.js
file that reproduces the issue and that we can easily use. -
Explain the steps we need to take to reproduce the issue.
-
Include a gif if you think it may help.
-
If you're asking for help, please make it easy for us to help you!
Expected Behavior
mock works
Actual Behavior
mock doesn't work
Environment
Please provide
- react-native version
0.73.8
- @react-native-google-signin/google-signin version
12.1.0
- your Podfile, output of running
pod install
and cocoapods version (if applicable) - version of Android, gradle, android plugin for gradle,
play-services-auth
and version of the Google Play Services app on your phone (if applicable) - version of iOS (if applicable)
I'm having the same issue, but it seems so simple to fix.
I've tried to put "../../src/types" and it worked.
@devartwa yes its simple enough to patch a fix but thats just a band-aid. The distribution should be fixed properly as any other future imports would face the same issue
@devartwa yes its simple enough to patch a fix but thats just a band-aid. The distribution should be fixed properly as any other future imports would face the same issue
Sure, I agree! I've cloned the app and tried to run tsc
inside the jest folder and it worked like a charm, something happened whey they built and released this version, for sure.
Hello, I'll take a look today
Hello, I'll take a look today
thank you so much!
🎉 This issue has been resolved in version 12.1.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
@vonovak I know it's a dumb question, but have you tested before the release?
I've updated the library and got the same error.
![Screenshot 2024-05-31 at 10 22 53 am](https://private-user-images.githubusercontent.com/49029304/335408430-dbebf4c8-1cc8-4187-bec5-d85de064bd7c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyMzY0MjQsIm5iZiI6MTcyMTIzNjEyNCwicGF0aCI6Ii80OTAyOTMwNC8zMzU0MDg0MzAtZGJlYmY0YzgtMWNjOC00MTg3LWJlYzUtZDg1ZGUwNjRiZDdjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE3VDE3MDg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkxNDI4ODg3MDgwMGVlYmFhMGU2ZjY5YjVlODg0NjVhMzhjYzRmODM3MzNlZTYyZDZhMzg3NWZhYmFkMDY5OWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.jny-vK6RznbHoz7OvfmiyLRE54ueq9zsFsPMMJ_QUBE)
library version:
![Screenshot 2024-05-31 at 10 23 49 am](https://private-user-images.githubusercontent.com/49029304/335408554-4a93a9b5-db7f-4024-870e-0bb0eed7873a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyMzY0MjQsIm5iZiI6MTcyMTIzNjEyNCwicGF0aCI6Ii80OTAyOTMwNC8zMzU0MDg1NTQtNGE5M2E5YjUtZGI3Zi00MDI0LTg3MGUtMGJiMGVlZDc4NzNhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE3VDE3MDg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlhNDVkMzA1YzdkYTc1ZmYxNjI5NDdhODQ1MzRkZTlmOTA5MjYyMTZiNTIyMjUwODJlNDM1MWY4NmY5Y2E1ZjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.RXBbOX0lV3XW_Gwjq3OU7JpOiYCa_bdH8nFd-vnQw3o)
Hello, apologies! The correct location of the mock is @react-native-google-signin/google-signin/jest/build/jest/setup.js
I will update the release notes with this breaking change
Hello, apologies! The correct location of the mock is
@react-native-google-signin/google-signin/jest/build/jest/setup.js
I will update the release notes with this breaking change
thank you so much again!