Skip to content

Conversation

@vgs-github-renovate-app
Copy link
Contributor

@vgs-github-renovate-app vgs-github-renovate-app bot commented Nov 23, 2025

This PR contains the following updates:

Package Change Age Confidence
dev.mokkery (source) 2.7.23.1.1 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

lupuuss/Mokkery (dev.mokkery)

v3.1.1: 3.1.1

Changelog

🐛 Bug fixes
  • #​122 Fix FIR reporting error for classes to mock that accept enum as a parameter in the constructor

v3.1.0: 3.1.0

Changelog

This release focuses on improving mocking classes with parameterized constructors. You can read more about it here.

🚀 Features
  • #​108 Mocking classes with constructors that access their parameters should no longer cause runtime exceptions
  • not matcher accepts more than one matcher
⚠️ Breaking changes
  • Bump minimum Kotlin version to 2.3.0
🐛 Bug fixes
  • Fix compatibility broken by Kotlin 2.3.0
  • #​118 Fix ClassCastException when mocking classes with constructors that accepts complex types

v3.0.0: 3.0.0

Changelog

This major update introduces a full refactor of the templating mechanism - everything that happens inside every and verify blocks.
It addresses a wide range of bugs that previously caused unexpected errors when setting up a behavior for a method,
and it now provides compile-time validation for these blocks.

Also, this version deprecates vararg matchers. Now, any matcher that accepts array can be used with spread operator (*).

// Mokkery 2
every { mock.callWithVarargs(1, *anyIntVarargs(), 10) } returns 1
every { mock.callWithVarargs(1, *varargsIntAll { it % 2 == 0 }, 10) } returns 1

// Mokkery 3
every { mock.callWithVarargs(1, *any(), 10) } returns 1
every { mock.callWithVarargs(1, *containsAllInts { it % 2 == 0 }, 10) } returns 1

The new approach allows you to easily create custom matchers and use them with the spread operator:

every { mock.callWithVarargs(1, *matches { it.size > 2 }, 10) } returns 1
// Matches a call with varargs that starts with 1, ends with 10, and has at least two elements in between.
🚀 Features
  • Most every / verify misuses are now reported at compile time.
  • Full support for default arguments.
    Previously, only methods with constant default values could be mocked.
    Now, Mokkery correctly verifies default values computed from other arguments, provided these computations are deterministic.
    If the default value is non-deterministic (e.g., random), it cannot be verified because it’s not possible to predict the correct value for the call.
  • Literals can be mixed with matchers in any scenario - for example, when passed to composite matchers.
  • Support for methods with context parameters.
  • Removes the WASM value classes limitation.
    It is no longer necessary to set up an AutofillProvider to mock a method that accepts or returns a value class.
  • Now, it's allowed to call every and verify on the same mock in parallel.
  • Matchers can be extracted to variables.
  • It’s now possible to use any matcher that accepts an array as a vararg matcher (with the spread operator).
  • Added containsAll for Iterable and array types. Matches a collection in which all elements satisfy the predicate.
  • Added containsAny for Iterable and array types. Matches a collection in which any element satisfies the predicate.
⚠️ Breaking changes
  • ArgMatchersScope (renamed to MokkeryMatcherScope) no longer contains the method fun <T> matches(argType: KClass<*>, matcher: ArgMatcher<T>): T.
    Its usage should be replaced with the extension function fun <T> MokkeryMatcherScope.matches(matcher: ArgMatcher<T>): T.
  • The registration process for composite matchers has changed. The compose, isFilled, and assertFilled methods have been removed from ArgMatcher.Composite. Refer to the dev.mokkery.matcher.matchesComposite documentation and existing implementations for the new approach to implementing composite matchers.
  • Scope functions can no longer be used to call mock methods inside templating blocks. Use the new dev.mokkery.templating.ext and dev.mokkery.templating.ctx APIs to mock methods with extension receivers or context parameters.
🐛 Bug fixes
♻️ Deprecations

All deprecated functions have suggestions for replacement set up, so migration should be straightforward.

  • ArgMatchersScope is renamed to MokkeryMatcherScope.
  • All vararg matcher declarations are deprecated: VarArgMatcher, varargsAny, varargsAll, anyVarargs.
    They should be replaced with equivalent regular matchers.
  • eq is deprecated - it can be omitted.
  • neq is deprecated - replace with not.
  • eqRef is renamed to ref.
  • neqRef is deprecated - replace with not(ref(...)).
  • matching and matchingBy are renamed to matches and matchesBy.
  • Removed the deprecated FunctionScope API.
✨ Improvements
  • Compiler plugin is no longer applied to KotlinMetadataTarget.

v2.10.2: 2.10.2

Changelog:

🐛 Bug fixes
  • Fix MokkerySuiteScope.mocks returning incorrect reference for JS function mocks
🌳 Dependencies
  • Bump kotlinx.atomicfu to 0.29.0.
  • Bump Kotlin to 2.2.21.
  • [jvm] Bump ByteBuddy to 1.17.8

v2.10.1: 2.10.1

Changelog

🐛 Bug fixes
  • #​110 Fixes NoClassDefFoundErrror: dev/mokkery/plugin/core/Mokkery$Errors
    Note that if you are affected by this issue, you need to clear the Gradle caches for the fix to work. Please read the issue description for more details.

v2.10.0: 2.10.0

Changelog:

🚀 Features
  • Add possibility to call spied function from calls using callSpied or callSpiedWith
  • Add MokkeryBlockingCallScope.callSpied and MokkerySuspendCallScope.callSpied
♻️ Deprecations
  • Change deprecation level of FunctionScope API from warning to error. It will be removed in Mokkery 3.0.0.
🐛 Bug fixes
  • #​98 Fix compatibility broken by Kotlin 2.2.20
  • #​97 Fix crash when creating a mock of a class with abstract type parameters for Android instrumented test.
  • #​106 Fix CallArgument constructor resolution by the compiler plugin

v2.9.0: 2.9.0

Changelog:

⚠️ Breaking Changes
  • Bump minimum Kotlin version to 2.2.0.
🐛 Bug fixes
  • #​83 Fix compatibility broken by Kotlin 2.2.0

v2.8.0: 2.8.0

Changelog:

🚀 Features
  • Add super call extensions to MokkeryBlockingCallScope and MokkerySuspendCallScope.
  • Add MokkeryCallScope.self<T>.
  • Add FunctionCall.argValue and FunctionCall.argValues.
⚠️ Breaking Changes
  • Bump minimum Kotlin version to 2.1.20.
  • Move MokkeryCallScope, MokkeryBlockingCallScope, and MokkerySuspendCallScope from the dev.mokkery.interceptor package to dev.mokkery.
♻️ Deprecations
  • Deprecate Answer.call(FunctionScope) and Answer.callSuspend(FunctionScope) in favor of overloads with MokkeryCallScope. A migration guide is available in the Answer interface documentation.
  • Remove indirect super calls.
✨ Improvements
  • #​84 Add workaround for Android test fixtures.
  • Change ApplicationRule.AllTests to support test fixtures in the future.
  • Align JS functions toString behavior with other mocks.
🌳 Dependencies
  • Bump kotlinx.coroutines to 1.10.2.
  • Bump Kotlin to 2.1.21.

v2.7.3: 2.7.3

It's a backport release based on 2.7.2 version to provide a fix for Kotlin 2.1.x users

Changlog:

🐛 Bug fixes
  • #​106 Fix CallArgument constructor resolution by the compiler plugin

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@vgs-github-renovate-app vgs-github-renovate-app bot changed the title Update dependency dev.mokkery to v3 chore(deps): update dependency dev.mokkery to v3 Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant