-
Notifications
You must be signed in to change notification settings - Fork 2
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
Create Robolectric Extension #2
Comments
@LeoColman This would be really nice to have! I am a user of both Kotest and Robolectric and trying to find any solutions to get them to work together in the same test class. Attempted workaroundsI attempt to use kotest-android with RobolectricBack to the topic here, what do you think it would take to get this plugin working with Robolectric? Interested on what you think has to be done, as it's something I am interested attempting, but looking for help. |
There is one specific class in Robolectric that is very hard to understand and plug into. I'm the original author of the Robolectric extension, and it took me a lot of time to understand the main driver from Robolectric, Once you are able to get inside Robolectric's environment, Kotest works as expected. The idea is that the Spec must be wrapped around to whatever it is that Robolectric uses to create classes |
@LeoColman Thanks for the help here! I looked through |
Cool @jkasten2! |
@jkasten2 Could you share the full code of the extension you wrote? I'm having a bit of a hard time trying to change from the old model as it was Spec-based, not test based |
@LeoColman here is the full set of source I have been using: The repo includes a full Android project, and you can go back a commit to see the one of the test that fails, then pass later after the changes: The changes were much more than I thought originally, I took Hopefully this is helpful, but let me know if you need any more detail, or want to to hunt down the differences a bit more. |
@LeoColman Awesome!, this is very helpful so we don't have to keep running with a patched copy locally. Also removes complexity of our project's tests and we can get patches from the community easier now! I tested out |
Related: kotest/kotest#3505
Archived Kotest repository: https://github.com/kotest/kotest-extensions-robolectric
The text was updated successfully, but these errors were encountered: