-
Notifications
You must be signed in to change notification settings - Fork 0
Feature Test
Ali Sadeghi edited this page Jan 27, 2026
·
4 revisions
Generates comprehensive tests for a KMP feature module.
Usage:
/feature-test login
/feature-test profile
/feature-test productcatalog| Test Type | Output Path | Coverage |
|---|---|---|
| Fixtures | .../fixtures/{Feature}Fixtures.kt |
Domain model factories |
| UI Fixtures | .../fixtures/{Feature}UiFixtures.kt |
UiState factories for all 4 states |
| DataSource | .../data/datasource/{Feature}RemoteDataSourceTest.kt |
MockEngine HTTP tests |
| Repository | .../data/{Feature}RepositoryImplTest.kt |
Mokkery mock tests |
| ViewModel | .../presentation/{Feature}ViewModelTest.kt |
Turbine StateFlow tests |
| UI | .../presentation/ui/{Feature}ScreenTest.kt |
Compose UI tests (ScreenRoot) |
| Integration | .../integration/{Feature}IntegrationTest.kt |
Full-stack E2E tests |
-
Validates feature exists in
feature/{name}/ -
Invokes the
test-orchestratoragent - Discovers all feature files and extracts structured context
- Generates fixtures first (domain + UI fixtures)
- Parallel Phase 1 - DataSource + Repository tests
- Parallel Phase 2 - ViewModel + UI + Integration tests
-
Runs tests via
./gradlew :feature:{name}:desktopTest - Generates coverage via Kover HTML report
If .claude/docs/{featurename}/spec.md exists, the command will:
- Extract requirement scenarios from the spec
- Pass scenarios to ViewModel and UI test agents
- Map generated tests to spec requirements
- Report spec coverage in the summary
## Test Generation Summary: login
| Test Type | Status | Tests | File |
|-----------|--------|-------|------|
| Fixtures | ✅ | - | .../fixtures/LoginFixtures.kt |
| DataSource | ✅ | 25 | .../data/datasource/LoginRemoteDataSourceTest.kt |
| Repository | ✅ | 35 | .../data/LoginRepositoryImplTest.kt |
| ViewModel | ✅ | 40 | .../presentation/LoginViewModelTest.kt |
| UI | ✅ | 30 | .../presentation/ui/LoginScreenTest.kt |
| Integration | ✅ | 15 | .../integration/LoginIntegrationTest.kt |
**Coverage Report:** feature/login/build/reports/kover/html/index.html
- Line Coverage: 87%
- Branch Coverage: 82%# Run tests manually
./gradlew :feature:{name}:desktopTest
# View coverage report
open feature/{name}/build/reports/kover/html/index.html
# Run specific test class
./gradlew :feature:{name}:desktopTest --tests "*ViewModelTest"- Tests follow the ScreenRoot pattern - UI tests target
{Feature}ScreenRoot, not{Feature}Screen - All tests use fixtures for test data consistency
- Database tests only generated if
.sqSQLDelight files exist - Coverage threshold is 80% (configured in Kover)
Back to Commands