Releases: kosi-libs/MocKMP
1.8.1
1.8.0
Kotlin 1.7.0
1.7.0
1.6.1
1.6.0
1.5.0
BREAKING CHANGE: ArgConstraint.description
is now () -> String
instead of simply String
.
This only impacts you if you have defined custom argument constraints.
#13: Fixes wrongful assertion error when verifying using a mock as a parameter of an argument contraint (such as verify { mock.call(isEqual(otherMock)) }
).
ArgConstraints.description
is now resolved lazily. In case of assertion failure, it is also resolved outside of verification mode.
Note that the mocker now throws MockerVerificationAssertionError
(which resolve their message lazily).
#15: Fixes bad code generation when mocking an interface that uses typealias.
#16: Fixes the absence of annotations in generated code.
Annotations are now copied verbatim in the generated code.
#17: Compiled with Kotlin 1.6.20 and KSP 1.6.21-1.0.5
1.4.0
#10: Introducing the isInstanceOf
argument constraint
#11: Introducing @FakeProvider
to provide fakes of types with private constructor (see https://github.com/Kodein-Framework/MocKMP#providing-fake-instances)
#12: Reworked TestsWithMocks
methods encapsulation to make them more consistent.
1.3.0
-
Support for mocked function arguments (via argument constraints) of type interface, sealed type, abstract class, & Array. All argument types should be supported. If you find an argument type that cannot be emulated with an argument contraint, please open an issue. The
Mocker.useReference
function only exists as a way to not be blocked while waiting for a fix. -
Support for optional mocking of interfaces default implementation. Note that a call to a non-mocked function with a default value will execute as expected, but will not be logged by the mocker, and therefore cannot be verified. If you need to verify, you need to mock.
-
Trying to verify a function that was not previously mocked is now a
MockingException
. It used to throw anAssertionException
stating that there wasn't any call to the function. Since the function was not mocked, it could not be otherwise. The error presentation was misleading and could lead to misinterpretation, especially with interface default methods. It now clearly states that you cannot verify a non-mocked function. -
Updated KSP to 1.0.4
1.2.0
- Support for suspending definition & verification with
everySuspending
&verifyWithSuspend
.