kotest-intellij-plugin icon indicating copy to clipboard operation
kotest-intellij-plugin copied to clipboard

Tests ran with the kotest plugin ignore unmock

Open matejdro opened this issue 2 years ago • 5 comments

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 avatar Dec 08 '22 08:12 matejdro

Possibly related to the https://github.com/kotest/kotest-intellij-plugin/issues/178?

matejdro avatar Dec 08 '22 08:12 matejdro

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[bot] avatar Mar 19 '23 18:03 stale[bot]

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.

matejdro avatar Mar 19 '23 18:03 matejdro

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

sksamuel avatar Nov 20 '23 00:11 sksamuel

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.

matejdro avatar Nov 20 '23 10:11 matejdro