Cursor rule
.cursor/rules/testing.mdcTesting patterns and practices
Cursor rules
Quality
62/100
Scores the file, not the repository.Length
170 words
5 headings · 1 code blocksRepository
40
— · pushed 120 days agoLast changed
3 days ago
First indexed 3 days ago.1234567# Testing89## Setup1011- Framework: Vitest 4 with V8 coverage12- Convention: `__tests__/ClassName.test.ts` alongside the source code13- `@/` alias available in tests1415## Test Structure1617```typescript18describe('Money', () => {19 describe('add', () => {20 it('should sum amounts with same currency', () => {21 const a = new Money(100, 'USD');22 const b = new Money(50, 'USD');23 expect(a.add(b).amount).toBe(150);24 });2526 it('should throw on currency mismatch', () => {27 const usd = new Money(100, 'USD');28 const brl = new Money(50, 'BRL');29 expect(() => usd.add(brl)).toThrow('Currency mismatch');30 });31 });32});33```3435## Testing Priorities36371. **Domain entities and services**: maximum coverage (business logic)382. **Use cases**: test orchestration with mocked interfaces393. **Infrastructure**: test parsing and integration in isolation404. **Presentation**: test formatters; builders are visual (lower priority)4142## Best Practices4344- Independent tests — no shared state between `it()` blocks45- Descriptive names: "should calculate average cost when multiple vestings exist"46- Use factories or builders to create test data47- Mock interfaces (`IOperationRepository`) — never concrete implementations48- No `any` in tests49
Also in miguelslemos/stock_portfolio
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 |
|---|---|---|---|---|---|
| miguelslemos/stock_portfolio.cursor/rules/architecture.mdc · 40 | Cursor rules | styledependencies | 48/100 | 3 days ago | |
| miguelslemos/stock_portfolio.cursor/rules/code-style.mdc · 40 | Cursor rules | lint-formatstyletypesdo-not+1 | 65/100 | 3 days ago | |
| miguelslemos/stock_portfolio.cursor/rules/domain-logic.mdc · 40 | Cursor rules | do-not | 57/100 | 3 days ago | |
| miguelslemos/stock_portfolio.cursor/rules/new-features.mdc · 40 | Cursor rules | styledo-not | 61/100 | 3 days ago | |
| miguelslemos/stock_portfolio.cursor/rules/project-overview.mdc · 40 | Cursor rules | testlint-formatarchdo-not | 72/100 | 3 days ago | |
| miguelslemos/stock_portfolio.cursor/rules/ui-presentation.mdc · 40 | Cursor rules | ui | 50/100 | 3 days ago |
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 | |
| 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 | |
| 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 | |
| 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 |
