kotlin-testing

Generate Kotest unit tests with MockK and Kover following TDD workflows.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/luongldptit/move-ticket --skill kotlin-testing-luongldptit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-testing
Source: https://github.com/luongldptit/move-ticket/tree/main/.agent/skills/kotlin-testing
Command: npx skills add https://github.com/luongldptit/move-ticket --skill kotlin-testing-luongldptit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the inconsistency and steep learning curve of writing Kotlin tests, helping developers adopt standardized TDD workflows with idiomatic, maintainable test code using industry-standard Kotlin testing libraries.

Core Features & Use Cases

  • TDD Workflow Guidance: Walks you through the full RED/GREEN/REFACTOR cycle for Kotlin code, ensuring tests drive implementation.
  • Comprehensive Testing Patterns: Covers unit testing with Kotest spec styles, MockK dependency mocking, coroutine and Flow testing, property-based test generation, and Kover code coverage configuration.
  • Use Case: Imagine you are building a Kotlin microservice with coroutine-based data fetching. Use this Skill to write reliable suspend function tests, mock external API calls with MockK, and enforce 80%+ code coverage with Kover.

Quick Start

Use the kotlin-testing skill to write a complete set of Kotest unit tests for your new Kotlin user service class following TDD principles, including MockK mock setup for its repository dependency and Kover coverage threshold configuration.

Frequently Asked Questions about kotlin-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Kotlin tests for suspend functions and Flows?

Kotlin coroutine and Flow testing requires standardized patterns to verify suspend functions reliably. This Skill provides idiomatic Kotest patterns and MockK setups to test asynchronous data fetching and reactive streams with consistent maintainable code.

What is the best way to mock repository dependencies in Kotlin unit tests?

Mocking repository dependencies in Kotlin unit tests is best handled with MockK to isolate external calls. This Skill configures MockK mock setups for your repository dependencies, ensuring your service class tests remain fast, isolated, and maintainable.

How do I enforce code coverage thresholds in a Kotlin project?

Enforcing code coverage thresholds in Kotlin projects uses Kover configuration to set measurable targets like 80%+. This Skill sets up Kover coverage enforcement to ensure your production Kotlin codebases maintain standardized test coverage throughout development.

Can I use property-based testing with Kotest for Kotlin microservices?

Property-based testing with Kotest works effectively for Kotlin microservices to validate edge cases automatically. This Skill integrates property-based test generation into your TDD workflow, expanding test coverage beyond manual example-based assertions.

How to apply TDD methodology when building Kotlin user services?

Applying TDD methodology to Kotlin user services follows the full RED/GREEN/REFACTOR cycle to drive implementation. This Skill guides you through TDD workflow adherence, writing Kotest unit tests before implementation to ensure robust production code.

Does Kotest work with MockK for dependency mocking in coroutine testing?

Kotest works seamlessly with MockK for dependency mocking during coroutine testing in Kotlin projects. This Skill combines Kotest spec styles and MockK mocking to provide standardized testing patterns for complex asynchronous scenarios.