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

Implement clearStaticMockk for KFunction and KProperty #1239

Merged
merged 2 commits into from Apr 3, 2024

Conversation

krocard
Copy link
Contributor

@krocard krocard commented Apr 2, 2024

For a class, Mockk allows to:

  • mockkStatic(klass)
  • unmockkStatic(klass)
  • clearStaticMock(klass)

But for static properties and functions, since #518, only the first 2 are supported:

  • mockkStatic(::staticMethod)
  • unmockkStatic(::staticMethod)
  • clearStaticMock(::staticMethod) // Doesn't compile

The helper functions were missing.

@krocard krocard marked this pull request as draft April 2, 2024 16:23
@krocard krocard marked this pull request as ready for review April 2, 2024 16:51
@krocard
Copy link
Contributor Author

krocard commented Apr 3, 2024

jvmApiCheck is failing. Probably because the PR is adding new public functions. Is there a way to update the *api files automatically? I copied the generated mockk.api in build/.

Consider documenting how to check a PR in CONTRIBUTION.md (Edit: suggested #1240 :)

@Raibaz Raibaz merged commit 9292631 into mockk:master Apr 3, 2024
11 checks passed
@krocard krocard deleted the clearStaticMockk branch April 4, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants