Skip to content

Releases: kosi-libs/MocKMP

1.8.1

12 Jul 16:49
Compare
Choose a tag to compare

#30: Fix receiver check.

1.8.0

21 Jun 17:24
Compare
Choose a tag to compare

Kotlin 1.7.0

1.7.0

26 May 21:25
Compare
Choose a tag to compare
  • Fix #21: Faking data classes with type aliases.
  • Supports faking generic data classes.
  • Fix #23: duplicated code when running multiple test configurations of the same JVM target.

1.6.1

23 May 12:58
Compare
Choose a tag to compare

Fix #22: null return regression.

1.6.0

12 May 10:56
Compare
Choose a tag to compare

#19 Support for verifying exceptions

1.5.0

06 May 17:00
Compare
Choose a tag to compare

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

25 Mar 13:37
Compare
Choose a tag to compare

#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

08 Mar 22:45
Compare
Choose a tag to compare
  • 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 an AssertionException 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

08 Feb 11:50
Compare
Choose a tag to compare
  • Support for suspending definition & verification with everySuspending & verifyWithSuspend.

1.1.0

01 Feb 18:48
Compare
Choose a tag to compare
  • #1: Fake generation now support functional types
  • #2: Proper support for KMM projects with Android plugin (rather than just a JVM target)
  • Better support for KSP error system. Error stack traces are shown if the throwErrors property is set to true in the Gradle plugin.