Cursor rule
.cursor/rules/testing.mdcMiddle Earth testing baseline guidelines (unit tests with Jest)
Cursor rules
Quality
73/100
Scores the file, not the repository.Length
148 words
8 headings · 1 code blocksRepository
0
— · pushed 4 days agoLast changed
3 days ago
First indexed 3 days ago.1234567891011# Testing (Middle Earth)1213## Unit tests (Jest)1415- Tests live in `__tests__/` folders within the same directory as source files.16- Filename pattern: `*.spec.ts(x)`.17- Use framework-specific testing libraries (e.g., Testing Library for React).18- Use shared testing helpers when available; keep tests short and behavior-focused.19- Aim for 100% coverage where feasible; write tests that target behavior, not implementation details.2021## Fixtures and data2223- Use `faker` for generating random inputs where helpful.24- Prefer deterministic assertions over random expected values.2526## Mocking2728- Prefer `jest.mock` for external modules and `jest.spyOn` for side effects.29- Use table-driven tests with `it.each` for input/output matrices.3031## Assertions3233- Prefer `expect.objectContaining`/`not.objectContaining` for partial assertions.34- Disallow `.only` (lint rule enabled) and skipped tests except when justified.3536## Running tests3738```bash39# Test a specific project40pnpm nx test <project-name>4142# Test all projects43pnpm nx run-many --target test44```45
Also in carrot-foundation/middle-earth
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| carrot-foundation/middle-earth.cursor/rules/bmad.mdc · 0 | Cursor rules | gitdo-not | 51/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/branch-naming.mdc · 0 | Cursor rules | lint-formatstylegitdo-not | 45/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/code-comments.mdc · 0 | Cursor rules | styletypesdocs | 48/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/code-preservation.mdc · 0 | Cursor rules | do-not | 32/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/code-style.mdc · 0 | Cursor rules | lint-formatstylearchdependencies+1 | 56/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/commit.mdc · 0 | Cursor rules | testlint-formattypesgit | 58/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/documentation.mdc · 0 | Cursor rules | lint-formatstylearchdocs | 42/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/pull-request-description.mdc · 0 | Cursor rules | git | 39/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/pull-request.mdc · 0 | Cursor rules | lint-formatgitagent-behaviour | 69/100 | 3 days ago | |
| carrot-foundation/middle-earth.cursor/rules/typescript.mdc · 0 | Cursor rules | buildlint-formatstylearch+1 | 59/100 | 3 days ago | |
| carrot-foundation/middle-earthAGENTS.md · 0 | AGENTS.md | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| carrot-foundation/middle-earthCLAUDE.md · 0 | CLAUDE.md | setupbuildtestlint-format+6 | 97/100 | 3 days ago |
Diff against .cursor/rules/bmad.mdc Diff against .cursor/rules/branch-naming.mdc Diff against .cursor/rules/code-comments.mdc Diff against .cursor/rules/code-preservation.mdc Diff against .cursor/rules/code-style.mdc Diff against .cursor/rules/commit.mdc Diff against .cursor/rules/documentation.mdc Diff against .cursor/rules/pull-request-description.mdc Diff against .cursor/rules/pull-request.mdc Diff against .cursor/rules/typescript.mdc Diff against AGENTS.md Diff against CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
