agentleFS
floriscornelfloriscornel/todo-mcp/.cursor/rules/testing-standards.mdc

todo-mcp / rules

Cursor rule2 starsChanged 18 months agoMITView on GitHub

The file

We split this testing-standards.mdc into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    Use npm run test:coverage to run tests with coverage reporting

    line 10
  2. Very specific:

    Follow the existing test patterns in src/__tests__/

    line 14
  3. Distinctive:

    Use Vitest with globals enabled

    line 15
  4. Very specific:

    Test database setup in src/test-utils/vitest.setup.ts

    line 16
  5. Very specific:

    Use TEST_DATABASE_URL environment variable for test database

    line 19
  6. Very specific:

    Use beforeEach/afterEach for setup/cleanup

    line 26
  7. Distinctive:

    Use Vitest's built-in mocking capabilities

    line 30
  8. Distinctive:

    Avoid mocking internal functions unless necessary

    line 31
  9. Distinctive:

    Create meaningful test data that represents real usage

    line 34
  10. Distinctive:

    Use factories or builders for complex test objects

    line 35
  11. Distinctive:

    Keep test data minimal but realistic

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule 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
testing-standards.mdc
---
description: 
globs: 
alwaysApply: true
---
# Testing Standards

## Coverage Requirements
- **Minimum 80%** coverage for branches, functions, lines, and statements
- Use `npm run test:coverage` to run tests with coverage reporting
- Coverage reports available in `coverage/` directory

## Test Structure
- Follow the existing test patterns in `src/__tests__/`
- Use Vitest with globals enabled
- Test database setup in `src/test-utils/vitest.setup.ts`

## Database Testing
- Use `TEST_DATABASE_URL` environment variable for test database
- Tests should be isolated and not affect each other
- Clean up test data after each test

## Test Naming
- Describe what the test does: `should create task with valid data`
- Group related tests with `describe` blocks
- Use `beforeEach`/`afterEach` for setup/cleanup

## Mock Patterns
- Mock external dependencies consistently
- Use Vitest's built-in mocking capabilities
- Avoid mocking internal functions unless necessary

## Test Data
- Create meaningful test data that represents real usage
- Use factories or builders for complex test objects
- Keep test data minimal but realistic

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.