mockk/mockk

Feature Request - Suppress & WhiteBox like feature in mockK

Open

#818 opened on May 4, 2022

View on GitHub
 (9 comments) (2 reactions) (1 assignee)Kotlin (364 forks)batch import
enhancementgood first issuehacktoberfest

Repository metrics

Stars
 (5,540 stars)
PR merge metrics
 (Avg merge 4d 7h) (7 merged PRs in 30d)

Description

  • I am running the latest

  • I checked the documentation and found no

  • I checked to make sure that this issue has not already been filed

Feature/Function Requests

Suppress unwanted behaviour

I'm using the MockK library to write my kotlin android unit tests and it's really pain in my ass while writing unit tests for Android activity classes which have override methods like onCreate(), onResume(), onNewIntent() etc that call their parent classes.

I'm looking for a feature in mockk with which i can suppress the parent class calls and complete my unit tests peacefully. Currently I've to write hybrid unit tests by using PowerMockito along with mockK library to use the suppress functionality provided by PowerMockito, due to lack of such cool feature or function in mockK.

WhiteBox

WhiteBox is another useful one from PowerMockito which is missing in mockK and would really be helpful if available on this library.

Current Specs:

  • MockK version: V1.12.3
  • OS: Mac OS
  • Kotlin version: 1.6.0

Contributor guide