Skip to content
Prompt

Mighty_Eagle — Cursor Rules

by dennislee928

AI Summary

Cursor rules that provide testing guidelines and common mock patterns for Vitest, helping developers quickly set up and maintain consistent test practices in their projects.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "Mighty_Eagle — Cursor Rules" prompt rules to my project.
Repository: https://github.com/dennislee928/Mighty_Eagle

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

Guidelines for testing the application with Vitest

Testing Framework

• vitest is used for testing • Tests are colocated next to the tested file • Example: dir/format.ts and dir/format.test.ts • AI tests are placed in the __tests__ directory and are not run by default (they use a real LLM)

Server-Only Mock

`ts vi.mock("server-only", () => ({})); `

Prisma Mock

`ts import { beforeEach } from "vitest"; import prisma from "@/utils/__mocks__/prisma"; vi.mock("@/utils/prisma"); describe("example", () => { beforeEach(() => { vi.clearAllMocks(); }); it("test", async () => { prisma.group.findMany.mockResolvedValue([]); }); }); `

Helpers

You can get mocks for emails, accounts, and rules here: `tsx import { getEmail, getEmailAccount, getRule } from "@/__tests__/helpers"; `

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 3mo ago
Stale
AdoptionUnder 100 stars
3 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Stars3
Issues0
Updated3mo ago
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more