kotlin-testing
Patrones de testing Kotlin - Kotest, MockK, coroutines, Flow, property-based. Usar cuando se escriban tests en Kotlin.
Works with
---
name: kotlin-testing
description: Patrones de testing Kotlin - Kotest, MockK, coroutines, Flow, property-based. Usar cuando se escriban tests en Kotlin.
license: MIT
---
# Kotlin Testing
## Kotest
```kotlin
class UserServiceTest : StringSpec({
"should create user" {
val user = service.create("Alice")
user.name shouldBe "Alice"
}
"should throw on duplicate" {
shouldThrow<DuplicateException> { service.create("existing") }
}
})
```
## MockK
```kotlin
val repo = mockk<UserRepository>()
every { repo.findById(1) } returns User(1, "Alice")
coEvery { repo.save(any()) } returns Unit
val service = UserService(repo)
service.getUser(1).name shouldBe "Alice"
verify { repo.findById(1) }
```
## Coroutine Testing
```kotlin
@Test
fun `test async`() = runTest {
val result = service.fetchData()
result shouldBe expected
}
```
## Flow Testing (Turbine)
```kotlin
@Test
fun `test flow`() = runTest {
viewModel.state.test {
awaitItem() shouldBe State.Loading
awaitItem() shouldBe State.Success(data)
cancelAndConsumeRemainingEvents()
}
}
```
## Property-Based
```kotlin
class MathTest : StringSpec({
"commutative" {
checkAll<Int, Int> { a, b -> (a + b) shouldBe (b + a) }
}
})
```
## Coverage: Kover (80%+)
```bash
./gradlew koverHtmlReport
```More Mobile skills
animation-vocabulary
emilkowalski/skills
Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.
xcode-project-setup
firebase/agent-skills
Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).
cross-border-ecommerce
nexscope-ai/ecommerce-skills
Cross-border e-commerce expansion advisor. Scores target markets on 8 weighted dimensions (market size, ecommerce penetration, competition, regulatory complexity, logistics infrastructure, payment ecosystem, cultural distance, IP protection), compares 5 fulfillment models with cost and transit data, provides country-by-country tax/duty compliance guides (EU VAT/IOSS, UK VAT, US sales tax, CA GST, AU GST, JP consumption tax), maps local payment preferences by market, and builds a phased expansion roadmap. No API key required.

