agentleFS
cenconq25cenconq25/claude-code-app-studio/tests/CLAUDE.md

claude-code-app-studio / tests

CLAUDE.md40 starsChanged 7 months agoMITView on GitHub

The test tree is a sibling of src/, not nested inside, so coverage visibility is unambiguous and tooling can address suites by directory. Pick one E2E runner per project (the choice goes in .claude/docs/technical-preferences.md). Recommended defaults: Maestro tests live in tests/e2e/maestro/[flow]/[step].yaml. XCUITest and Espresso tests live in their respective project test targets but are mirrored here as Markdown manifests so the suite is discoverable from Claude Code without opening the IDE. The matrix is enforced by /story-done and /test-evidence-review. -…

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Test names describe behaviour: signs in with valid credentials, not testHandleSubmit.

    line 66
  2. Distinctive:

    Never depend on test execution order.

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Tests

The test tree is a sibling of src/, not nested inside, so coverage visibility is unambiguous and tooling can address suites by directory.

Layout

tests/
├── unit/             # Pure-logic tests, fast, deterministic
├── integration/      # Multi-module tests with fakes for transport
├── component/        # Single-component or single-widget render tests
├── e2e/              # End-to-end tests on a real or virtual device
├── fixtures/         # Shared factories, fixture builders, recorded payloads
├── helpers/          # Test utilities — assertions, matchers, mocks
└── README.md

Per-Framework E2E Conventions

Pick one E2E runner per project (the choice goes in .claude/docs/technical-preferences.md). Recommended defaults:

StackE2E runner
React NativeMaestro (greenfield) or Detox (mature setups)
FlutterPatrol (recommended) or integration_test
Native iOSXCUITest (in-tree) or Maestro (cross-team)
Native AndroidEspresso + UI Automator (in-tree) or Maestro

Maestro tests live in tests/e2e/maestro/[flow]/[step].yaml. XCUITest and Espresso tests live in their respective project test targets but are mirrored here as Markdown manifests so the suite is discoverable from Claude Code without opening the IDE.

Pyramid

LayerWhat it coversRuntime budgetWhere it lives
UnitPure logic — formulas, validators, reducers, mappers< 5 ms eachtests/unit/[feature]/
IntegrationRepository + cache + offline queue together< 200 ms eachtests/integration/[feature]/
Component / WidgetSingle-component render + interaction< 200 ms eachtests/component/[feature]/
E2ECritical user paths on a real or virtual deviceMinutestests/e2e/

Required Suites Per Story Type

Story typeRequired suite
LogicAt least one unit test that covers all acceptance criteria
IntegrationIntegration test or documented manual run with fixtures
UIComponent test or screenshot diff plus manual a11y walkthrough
Animation / MotionRecorded clip plus motion-designer sign-off
Config / RemoteSmoke check of each variant
AccessibilityAudit run plus screen-reader walkthrough

The matrix is enforced by /story-done and /test-evidence-review.

Naming

  • TS / RN: [feature]-[capability].test.ts(x) — e.g., sign-in-validation.test.ts.
  • Swift: FeatureNameTests.swift — e.g., SignInTests.swift.
  • Kotlin: FeatureNameTest.kt — e.g., SignInViewModelTest.kt.
  • Dart: feature_name_test.dart — e.g., sign_in_test.dart.

Test names describe behaviour: signs in with valid credentials, not testHandleSubmit.

Determinism

  • Inject the clock; freeze it in tests.
  • Inject the random source; seed it.
  • Mock the network at the transport boundary.
  • Mock the filesystem; use temp directories that get torn down.
  • Never depend on test execution order.

Flaky tests go to tests/quarantine/ via /test-flakiness and are fixed within one sprint.

CI

The pyramid runs in three CI stages:

  1. Per-PR — unit + integration + component. Fast (< 5 minutes). Blocks merge.
  2. Per-PR (parallel) — lint + type-check.
  3. Nightly — E2E suite on a device matrix. Reports go to the release channel.

Per-framework runners are configured by /test-setup:

  • RN: yarn test --ci (Jest), yarn typecheck, yarn lint, maestro test tests/e2e/maestro (nightly).
  • Flutter: flutter analyze, flutter test --coverage, patrol test --target tests/e2e/patrol (nightly).
  • iOS: xcodebuild test -scheme App -destination ....
  • Android: ./gradlew lint test connectedAndroidTest.

Coverage Floor

  • Domain (pure logic, validators, formulas): 90%.
  • Repositories and services: 70%.
  • Overall: 50%. Higher is welcome; 100% is not the goal.

UI and animation work is covered by component tests + screenshot diff where helpful, plus manual review.

What NOT to Test Here

  • Real network calls — mock the transport.
  • Real push delivery — verify handlers with fixtures; defer to TestFlight / Play internal track for end-to-end.
  • Real IAP purchases — sandbox path only.
  • Subjective qualities ("feels snappy") — covered by lead reviews and beta testing.
  • Pixel-perfect rendering across every device — covered by device-farm runs, not by automated tests.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.