From ac46749fadb66eb8c400d8277b4666e2f07d2894 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 1 Jun 2025 21:34:11 -0500 Subject: [PATCH] Don't write tests so religiously --- CONTEXT.md | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/CONTEXT.md b/CONTEXT.md index 8169721..3d0891d 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -390,11 +390,7 @@ export function Post(/* ...props */) { ## Writing Tests -This project uses Vitest for testing React components. The `TestApp` component provides all necessary providers for components that use Nostr functionality, React Router, and TanStack Query. - -Test files should be placed next to the module they test, using a `.test.tsx` or `.test.ts` extension: -- `src/components/MyComponent.tsx` → `src/components/MyComponent.test.tsx` -- `src/hooks/useCustomHook.ts` → `src/hooks/useCustomHook.test.ts` +**Important for AI Assistants**: Only create tests when the user is experiencing a specific problem or explicitly requests tests. Do not proactively write tests for new features or components unless the user is having issues that require testing to diagnose or resolve. ### Test Setup @@ -419,20 +415,6 @@ describe('MyComponent', () => { }); ``` -### Mocking Hooks - -Mock custom hooks using Vitest's `vi.mock()`: - -```tsx -import { vi } from 'vitest'; - -vi.mock('@/hooks/useCurrentUser', () => ({ - useCurrentUser: () => ({ - user: null, // or provide mock user data - }), -})); -``` - ## Testing Your Changes Whenever you modify code, you must run the **test** script using the **run_script** tool.