Skip to content
Prompt

Ethic-Latex — Cursor Rules

by dennislee928

AI Summary

A Cursor IDE rules file providing testing guidelines and mock patterns for Vitest, helping developers standardize test setup and reduce boilerplate when testing TypeScript applications with Prisma and server-only dependencies.

Install

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

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

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 1mo ago
Active
AdoptionUnder 100 stars
2 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Stars2
Issues1
Updated1mo 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