CONTEXT.md: clarify writing tests vs running tests

This commit is contained in:
Alex Gleason 2025-07-16 22:43:57 -05:00
parent 94e29c2f45
commit 2cb807a4eb
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

View File

@ -928,8 +928,11 @@ When users specify color schemes:
- Implement responsive design with Tailwind breakpoints - Implement responsive design with Tailwind breakpoints
- Add hover and focus states for interactive elements - Add hover and focus states for interactive elements
## Writing Tests ## Writing Tests vs Running Tests
There is an important distinction between **writing new tests** and **running existing tests**:
### Writing Tests (Creating New Test Files)
**Do not write tests** unless the user explicitly requests them in plain language. Writing unnecessary tests wastes significant time and money. Only create tests when: **Do not write tests** unless the user explicitly requests them in plain language. Writing unnecessary tests wastes significant time and money. Only create tests when:
1. **The user explicitly asks for tests** to be written in their message 1. **The user explicitly asks for tests** to be written in their message
@ -942,6 +945,14 @@ When users specify color schemes:
- New features or components are created - New features or components are created
- Existing functionality needs verification - Existing functionality needs verification
### Running Tests (Executing the Test Suite)
**ALWAYS run the test script** after making any code changes. This is mandatory regardless of whether you wrote new tests or not.
- **You must run the test script** using `js-dev__run_script` tool with the "test" parameter
- **Your task is not complete** until the test script passes without errors
- **This applies to all changes** - bug fixes, new features, refactoring, or any code modifications
- **The test script includes** TypeScript compilation, ESLint checks, and existing test validation
### Test Setup ### Test Setup
The project uses Vitest with jsdom environment and includes comprehensive test setup: The project uses Vitest with jsdom environment and includes comprehensive test setup:
@ -973,6 +984,8 @@ describe('MyComponent', () => {
## Testing Your Changes ## Testing Your Changes
Whenever you are finished modifying code, you must run the **test** script using the **js-dev__run_script** tool. **CRITICAL**: Whenever you are finished modifying code, you must run the **test** script using the **js-dev__run_script** tool.
**Your task is not considered finished until this test passes without errors.** **Your task is not considered finished until this test passes without errors.**
**This requirement applies regardless of whether you wrote new tests or not.** The test script validates the entire codebase, including TypeScript compilation, ESLint rules, and existing test suite.