Releases: lupuuss/Mokkery
Releases · lupuuss/Mokkery
2.7.3
2.10.0
Changelog:
🚀 Features
- Add possibility to call spied function from
callsusingcallSpiedorcallSpiedWith - Add
MokkeryBlockingCallScope.callSpiedandMokkerySuspendCallScope.callSpied
♻️ Deprecations
- Change deprecation level of
FunctionScopeAPI from warning to error. It will be removed in Mokkery 3.0.0.
🐛 Bug fixes
3.0.0-Beta1
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/verifymisuses 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
AutofillProviderto mock a method that accepts or returns a value class. - Now, it's allowed to call
everyandverifyon the same mock in parallel. - Matchers can be extracted to variables.
⚠️ Breaking changes
dev.mokkery.matcher.ArgMatchersScopehas been replaced bydev.mokkery.matcher.MokkeryMatcherScope.
In most cases, no action is required. If you have defined custom matchers, replacingArgMatchersScopewithMokkeryMatcherScopeshould be sufficient.- The registration process for composite matchers has changed. The
compose,isFilled, andassertFilledmethods have been removed fromArgMatcher.Composite. Refer to thedev.mokkery.matcher.matchesCompositedocumentation 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.extanddev.mokkery.templating.ctxAPIs to mock methods with extension receivers or context parameters.
🐛 Bug fixes
♻️ Deprecations
- Removed the deprecated
FunctionScopeAPI.
2.9.0
2.8.0
Changelog:
🚀 Features
- Add super call extensions to
MokkeryBlockingCallScopeandMokkerySuspendCallScope. - Add
MokkeryCallScope.self<T>. - Add
FunctionCall.argValueandFunctionCall.argValues.
⚠️ Breaking Changes
- Bump minimum Kotlin version to
2.1.20. - Move
MokkeryCallScope,MokkeryBlockingCallScope, andMokkerySuspendCallScopefrom thedev.mokkery.interceptorpackage todev.mokkery.
♻️ Deprecations
- Deprecate
Answer.call(FunctionScope)andAnswer.callSuspend(FunctionScope)in favor of overloads withMokkeryCallScope. A migration guide is available in the Answer interface documentation. - Remove indirect super calls.
✨ Improvements
- #84 Add workaround for Android test fixtures.
- Change
ApplicationRule.AllTeststo support test fixtures in the future. - Align JS functions
toStringbehavior with other mocks.
🌳 Dependencies
- Bump
kotlinx.coroutinesto1.10.2. - Bump Kotlin to
2.1.21.
2.7.2
2.7.1
2.7.0
Changelog:
🚀 Features
⚠️ Breaking changes
- Rename
MokkeryCallScope.contexttoMokkeryCallScope.mokkeryContextand now it's inherited fromMokkeryScope
♻️ Deprecations
- Change deprecation level of
allowIndirectSuperCallsfrom warning to error
🌳 Dependencies
- Bump
atomicfuto 0.27.0 - Bump
kotlinx.coroutinesto 1.10.1 - Bump Kotlin to 2.1.10