Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kosi-libs/MocKMP
A mocking processor for Kotlin Multiplatform
https://github.com/kosi-libs/MocKMP
Last synced: 5 days ago
JSON representation
A mocking processor for Kotlin Multiplatform
- Host: GitHub
- URL: https://github.com/kosi-libs/MocKMP
- Owner: kosi-libs
- License: mit
- Created: 2021-11-10T11:10:01.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-01T14:33:46.000Z (9 months ago)
- Last Synced: 2024-08-11T17:09:25.271Z (3 months ago)
- Language: Kotlin
- Homepage: https://kosi-libs.org/mockmp
- Size: 1.67 MB
- Stars: 181
- Watchers: 4
- Forks: 12
- Open Issues: 8
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-kotlin-multiplatform - MocKMP - A Kotlin/Multiplatform Kotlin Symbol Processor that generates Mocks & Fakes. (Libraries / Test)
- kmp-awesome - MocKMP - Mocking with KSP (Libraries / 🩺 Test)
README
= MocKMP
:icons: font
:version: 1.17.0A Kotlin/Multiplatform Kotlin Symbol Processor that generates Mocks & Fakes.
Built in collaboration with https://www.deezer.com/[Deezer].
== Installation
[source,kotlin,subs="verbatim,attributes"]
----
plugins {
kotlin("multiplatform")
id("org.kodein.mock.mockmp") version "{version}"
}kotlin {
// Your Koltin/Multiplatform configuration
}mockmp {
usesHelper = true
installWorkaround()
}
----== Example
[source,kotlin]
----
class MyTest : TestsWithMocks() {
override fun setUpMocks() = injectMocks(mocker) //<1>@Mock lateinit var view: View
@Fake lateinit var model: Modelval controller by withMocks { Controller(view = view, firstModel = model) }
@Test fun controllerTest() {
every { view.render(isAny()) } returns true
controller.start()
verify { view.render(model) }
}
}
----== Read more
See https://kosi-libs.org/mockmp/[MocKMP Documentation].