conventions-testing

Define and apply testing conventions for unit, integration, and end-to-end tests.

163|43|Updated May 3, 2026
One-click install
npx skills add https://github.com/stella/stella --skill conventions-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: conventions-testing
Source: https://github.com/stella/stella/tree/main/.agents/skills/conventions-testing
Command: npx skills add https://github.com/stella/stella --skill conventions-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defines and enforces consistent testing practices to improve reliability, readability, and maintainability of software by preventing flaky tests and unclear test intent.

Core Features & Use Cases

  • Structure: colocate tests with their source files; for frontend, extract logic into a separate logic file and test it with Bun. Use Playwright for browser-specific behavior: authentication redirects, route guards, uploads/downloads, keyboard focus, drag-and-drop, and viewer/editor flows. Structural invariant tests (auth enforcement, branded types) belong in apps/api/src/tests/security/.
  • Rules: Use plain fakes over heavy mocks, describe by behaviour, avoid shared mutable state, ensure deterministic setup, and require regression tests for bug fixes.
  • Guidance: Emphasizes tenant isolation checks at the highest meaningful layer and explicit, isolated test fixtures to improve reliability.

Quick Start

Run tests using the conventions to ensure consistent, reliable results.

Frequently Asked Questions about conventions-testing

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

FAQPage Schema
How do I structure unit and integration tests using bun:test?

Structure unit and integration tests by colocating test files with their source code using bun:test. Ensure behavior-driven descriptions, deterministic setup, and avoid shared mutable state to maintain consistency and reliability.

When should I use Playwright instead of Bun for testing frontend logic?

Use Playwright for browser-specific behavior such as authentication redirects, route guards, uploads, downloads, and drag-and-drop. Extract frontend logic into separate files and test it with Bun.

What is the best way to prevent flaky tests in a codebase?

Prevent flaky tests by enforcing testing conventions: use plain fakes over heavy mocks, ensure deterministic setup, avoid shared mutable state, and maintain explicit, isolated test fixtures.

Do I need to write regression tests for bug fixes?

Yes, regression tests are required for bug fixes. Adding a regression test ensures the specific issue is covered and prevents future code changes from reintroducing the defect.

Where should structural invariant tests like auth enforcement be placed?

Structural invariant tests, such as auth enforcement and branded types checks, belong in the apps/api/src/tests/security/ directory. This isolates security-critical checks from general logic.

Why use plain fakes instead of heavy mocks for unit testing?

Use plain fakes instead of heavy mocks to improve test readability and maintainability. Fakes provide lightweight, deterministic setup without coupling tests tightly to implementation details.