RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/carrot-foundation/middle-earth

Cursor rule

.cursor/rules/testing.mdc

Middle 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 blocks

Repository

0

— · pushed 4 days ago

Last changed

3 days ago

First indexed 3 days ago.
carrot-foundation/middle-earth/.cursor/rules/testing.mdcRawGitHub
1---
2description: 'Middle Earth testing baseline guidelines (unit tests with Jest)'
3globs:
4 - '**/*.spec.ts'
5 - '**/*.spec.tsx'
6 - '**/*.test.ts'
7 - '**/*.test.tsx'
8alwaysApply: false
9---
10 
11# Testing (Middle Earth)
12 
13## Unit tests (Jest)
14 
15- 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.
20 
21## Fixtures and data
22 
23- Use `faker` for generating random inputs where helpful.
24- Prefer deterministic assertions over random expected values.
25 
26## Mocking
27 
28- Prefer `jest.mock` for external modules and `jest.spyOn` for side effects.
29- Use table-driven tests with `it.each` for input/output matrices.
30 
31## Assertions
32 
33- Prefer `expect.objectContaining`/`not.objectContaining` for partial assertions.
34- Disallow `.only` (lint rule enabled) and skipped tests except when justified.
35 
36## Running tests
37 
38```bash
39# Test a specific project
40pnpm nx test <project-name>
41 
42# Test all projects
43pnpm nx run-many --target test
44```
45 

Commands it names

  • pnpm nx test <project-name>
  • pnpm nx run-many --target test
  • jest.mock
  • jest.spyOn

Sections

  • Testing (Middle Earth)
  • Unit tests (Jest)
  • Fixtures and data
  • Mocking
  • Assertions
  • Running tests
  • Test a specific project
  • Test all projects

What it covers

testcode-styletesting-strategy

Stack — with the evidence

typescript

(1.00)

node

(1.00)

nx

(1.00)

jest

(1.00)

eslint

(1.00)

react

(0.70)

nextjs

(0.70)

vitest

(0.70)

aws

(0.70)

javascript

(0.60)

monorepo

(0.60)

pnpm

(0.60)

terraform

(0.60)

github-actions

(0.60)

Glob targeting

  • **/*.spec.ts
  • **/*.spec.tsx
  • **/*.test.ts
  • **/*.test.tsx

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
carrot-foundation
Language
—
License
—
Archived
no

All configs in this repo

Also in carrot-foundation/middle-earth

Diff this repo’s formats

One 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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
carrot-foundation/middle-earth.cursor/rules/bmad.mdc · 0Cursor rulestypescriptnode+12gitdo-not51/1003 days ago
carrot-foundation/middle-earth.cursor/rules/branch-naming.mdc · 0Cursor rulestypescriptnode+12lint-formatstylegitdo-not45/1003 days ago
carrot-foundation/middle-earth.cursor/rules/code-comments.mdc · 0Cursor rulestypescriptnode+12styletypesdocs48/1003 days ago
carrot-foundation/middle-earth.cursor/rules/code-preservation.mdc · 0Cursor rulestypescriptnode+12do-not32/1003 days ago
carrot-foundation/middle-earth.cursor/rules/code-style.mdc · 0Cursor rulestypescriptnode+12lint-formatstylearchdependencies+156/1003 days ago
carrot-foundation/middle-earth.cursor/rules/commit.mdc · 0Cursor rulestypescriptnode+12testlint-formattypesgit58/1003 days ago
carrot-foundation/middle-earth.cursor/rules/documentation.mdc · 0Cursor rulestypescriptnode+12lint-formatstylearchdocs42/1003 days ago
carrot-foundation/middle-earth.cursor/rules/pull-request-description.mdc · 0Cursor rulestypescriptnode+12git39/1003 days ago
carrot-foundation/middle-earth.cursor/rules/pull-request.mdc · 0Cursor rulestypescriptnode+12lint-formatgitagent-behaviour69/1003 days ago
carrot-foundation/middle-earth.cursor/rules/typescript.mdc · 0Cursor rulestypescriptnode+12buildlint-formatstylearch+159/1003 days ago
carrot-foundation/middle-earthAGENTS.md · 0AGENTS.mdtypescriptnode+12setupbuildtestlint-format+797/1003 days ago
carrot-foundation/middle-earthCLAUDE.md · 0CLAUDE.mdtypescriptnode+12setupbuildtestlint-format+697/1003 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.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack