write-test

Automate Kotest FunSpec unit and integration tests with fakes and Turbine.

219|41|Updated Feb 21, 2024
One-click install
npx skills add https://github.com/proto-at-block/bitkey --skill write-test-proto-at-block
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-test
Source: https://github.com/proto-at-block/bitkey/tree/main/app/ai-rules/skills/write-test
Command: npx skills add https://github.com/proto-at-block/bitkey --skill write-test-proto-at-block

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing robust unit and integration tests for Kotlin applications can be repetitive and error-prone; this skill guides you to adopt a structured, fake-first testing approach using Kotest FunSpec and Turbine for Flow verification.

Core Features & Use Cases

  • Uses Kotest FunSpec style for clear, behavior-driven test definitions
  • Prefers fakes over mocks to improve determinism and test isolation
  • Integrates Turbine for reliable Flow testing in Kotlin coroutines
  • Supports unit and integration testing workflows across Android and JVM modules

Quick Start

Create a test spec extending FunSpec and begin by configuring fakes over mocks before writing tests.

Frequently Asked Questions about write-test

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

FAQPage Schema
How do I write deterministic Kotlin unit tests using fakes instead of mocks?

You can write deterministic Kotlin tests by extending Kotest FunSpec and configuring fake implementations before defining behavior-driven tests. Preferring fakes over mocks improves test isolation and reduces flakiness across Android and JVM Kotlin modules.

What is the best way to test Kotlin Flows for reliable emission verification?

The best way to test Kotlin Flows is integrating Turbine for reliable Flow verification. This skill uses Turbine alongside Kotest FunSpec to automate end-to-end testing strategies and confirm emissions within coroutines deterministically.

Can I use Kotest FunSpec for both Android and JVM Kotlin integration testing?

Yes, Kotest FunSpec supports both Android and JVM Kotlin integration testing workflows. This skill applies a structured fake-first approach across both platforms, enabling clear behavior-driven test definitions and reliable end-to-end test strategies.

How do I set up a Kotlin test spec to start writing behavior-driven tests?

To set up behavior-driven tests, create a test spec extending Kotest FunSpec and begin by configuring fakes over mocks. This approach structures your tests clearly and establishes the necessary deterministic environment for Flow verification.

Why prefer fakes over mocks for Kotlin unit and integration testing?

Preferring fakes over mocks for Kotlin unit and integration testing improves determinism and test isolation. This fake-first strategy avoids brittle mock setups, enabling more reliable and maintainable behavior-driven tests across your Kotlin modules.