Skip to content
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

Tests ran with the kotest plugin ignore unmock #235

Open
matejdro opened this issue Dec 8, 2022 · 5 comments
Open

Tests ran with the kotest plugin ignore unmock #235

matejdro opened this issue Dec 8, 2022 · 5 comments
Labels

Comments

@matejdro
Copy link

matejdro commented Dec 8, 2022

unmock is a gradle plugin that allows using android utility classes (such as Uri, Location, TextUtils etc.) within unit tests.

Unfortunately it does not seem to work with the kotest IntelliJ plugin, kotest seems to completely ignore unmock's existence.

Steps to reproduce:

  1. Open this project with android studio
  2. Run java/com/matejdro/kotestunmock/ExampleUnitTest.kt with gradle
  3. Notice that test passes
  4. Run "Given" block inside that test with the kotest plugin

BUG: Test will fail

@matejdro
Copy link
Author

matejdro commented Dec 8, 2022

Possibly related to the #178?

@stale
Copy link

stale bot commented Mar 19, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 19, 2023
@matejdro
Copy link
Author

matejdro commented Mar 19, 2023

This is still relevant and a major pain point - It prevents us from running individual tests of any code that includes utility Android classes, for example Location class.

@stale stale bot removed wontfix This will not be worked on labels Mar 19, 2023
@Kantis Kantis added the pinned label Mar 20, 2023
@sksamuel
Copy link
Member

Yeah kotest plugin doesn't use gradle, so anything setup there won't work.

@matejdro
Copy link
Author

Yeah that's why I marked #178 as related - this issue is meant as another use case for running gradle instead of IntelliJ. But we can merge them if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants