
Kotlin Testing
Covers the full Kotlin testing stack with Kotest spec styles, MockK for mocking, coroutine testing, and Kover coverage configuration. Includes a proper TDD walkthrough showing the RED-GREEN-REFACTOR cycle with a real email validator example, which is rare to see documented this clearly. The spec style comparisons (StringSpec, FunSpec, BehaviorSpec, DescribeSpec) are useful if you're picking a testing DSL for your team. Kotest matchers section gives you the common assertions without digging through docs. This is opinionated toward idiomatic Kotlin testing rather than JUnit, so expect property-based testing patterns and coroutine-aware mocks. The Ktor testApplication section suggests it's aimed at backend services, not Android.
- skills.sh installs
- 4.8K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill kotlin-testing --agent claude-codeInstalls into .claude/skills of the current project.
Files
Kotlin Testing Patterns
Comprehensive Kotlin testing patterns for writing reliable, maintainable tests following TDD methodology with Kotest and MockK.
When to Use
- Writing new Kotlin functions or classes
- Adding test coverage to existing Kotlin code
- Implementing property-based tests
- Following TDD workflow in Kotlin projects
- Configuring Kover for code coverage
How It Works
- Identify target code — Find the function, class, or module to test
- Write a Kotest spec — Choose a spec style (StringSpec, FunSpec, BehaviorSpec) matching the test scope
- Mock dependencies — Use MockK to isolate the unit under test
- Run tests (RED) — Verify the test fails with the expected error
- Implement code (GREEN) — Write minimal code to pass the test
- Refactor — Improve the implementation while keeping tests green
- Check coverage — Run
./gradlew koverHtmlReportand verify 80%+ coverage
Examples
The following sections contain detailed, runnable examples for each testing pattern:
Quick Reference
Sponsors
Details
- Repository
- github.com/affaan-m/everything-claude-code
- Categories
- Testing & QA, Mobile Development, Java & JVM
- First seen
- Apr 16, 2026
More from affaan-m/everything-claude-code
All 256- Customs Trade Compliance4.7K
- Data Scraper Agent4.7K
- Documentation Lookup4.7K
- Enterprise Agent Ops4.7K
- Flutter Dart Code Review4.7K
- Inventory Demand Planning4.7K
- Kotlin Ktor Patterns4.7K
- Nanoclaw Repl4.7K
- Pytorch Patterns4.7K
- Ralphinho Rfc Pipeline4.7K
- Carrier Relationship Management4.6K
- Context Budget4.6K
- Crosspost4.6K
- Energy Procurement4.6K
- Fal Ai Media4.6K
- Kotlin Exposed Patterns4.6K
- Logistics Exception Management4.6K
- Mcp Server Patterns4.6K
- Production Scheduling4.6K
- Quality Nonconformance4.6K
- Videodb4.6K
- Agent Eval4.5K
- Claude Devfleet4.5K
- Dmux Workflows4.5K