Skip to content

Releases: lupuuss/Mokkery

2.7.3

15 Sep 18:01

Choose a tag to compare

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

2.10.0

10 Sep 19:17
ee59cb7

Choose a tag to compare

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

3.0.0-Beta1

10 Aug 22:40

Choose a tag to compare

3.0.0-Beta1 Pre-release
Pre-release

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.

Note: Website guides have not yet been updated. They will be available when Mokkery 3.0.0 reaches a stable release.

🚀 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 varargs or 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.

⚠️ Breaking changes

  • dev.mokkery.matcher.ArgMatchersScope has been replaced by dev.mokkery.matcher.MokkeryMatcherScope.
    In most cases, no action is required. If you have defined custom matchers, replacing ArgMatchersScope with MokkeryMatcherScope should be sufficient.
  • 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

  • #100 #96 Unexpected errors during templating

♻️ Deprecations

  • Removed the deprecated FunctionScope API.

2.9.0

23 Jun 19:20
2fe59c9

Choose a tag to compare

Changelog:

⚠️ Breaking Changes

  • Bump minimum Kotlin version to 2.2.0.

🐛 Bug fixes

  • #83 Fix compatibility broken by Kotlin 2.2.0

2.8.0

22 May 18:39
ec72235

Choose a tag to compare

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.

2.7.2

21 Mar 16:51
4be6915

Choose a tag to compare

Changelog:

🐛 Bug fixes

  • #77 Fix compatibility broken by Kotlin 2.1.20

2.7.1

10 Mar 21:08
16ce11e

Choose a tag to compare

Changelog:

🐛 Bug fixes

  • #78 Fix mocking data classes

⚠️ Breaking changes

  • Due to #78 MokkerySuiteScope.mocks returns List<Any> instead of Set<Any>

2.7.0

15 Feb 22:30
72c66f2

Choose a tag to compare

Changelog:

🚀 Features

  • #52 Add a way to make exhaustiveness checks more strict! Check the guide here.

⚠️ Breaking changes

  • Rename MokkeryCallScope.context to MokkeryCallScope.mokkeryContext and now it's inherited from MokkeryScope

♻️ Deprecations

  • Change deprecation level of allowIndirectSuperCalls from warning to error

🌳 Dependencies

  • Bump atomicfu to 0.27.0
  • Bump kotlinx.coroutines to 1.10.1
  • Bump Kotlin to 2.1.10

2.6.1

15 Dec 13:48
159214e

Choose a tag to compare

Changelog:

🐛 Bug fixes

  • #66 Fix compilation crash on mocking type with constructor that has generic parameter

2.6.0

28 Nov 19:38
a4d1684

Choose a tag to compare

Changelog:

⚠️ Breaking changes

  • Now minimum Kotlin version is 2.1.0.

🐛 Bug fixes

  • #48 Fix compatibility broken by Kotlin 2.1.0

🚧 Known issues

  • #63 signal 11: Segmentation fault when using matchers with methods accepting Objective-C types