
testing
by ffMathy
My digital assistant that runs the house.
SKILL.md
name: testing description: Comprehensive testing requirements for all code changes. Use this to ensure tests are never skipped and all failures are fixed before completion.
Testing Guidelines
Strict requirements for testing code changes across the Hey Jarvis project.
Critical Rules
Never Skip Tests
CRITICAL: Tests must NEVER be skipped or disabled.
❌ NEVER use .skip() to disable tests
❌ NEVER comment out failing tests
❌ NEVER disable tests in CI/CD environments
❌ NEVER ignore test failures
✅ ALWAYS let tests fail properly if requirements are not met ✅ ALWAYS fix the root cause of test failures
Required After Changes
Testing and linting are MANDATORY after making code changes:
- Lint your changes: Run
bunx nx lint <project>orbunx nx affected --target=lint - Test your changes: Run
bunx nx test <project>orbunx nx affected --target=test - Build your changes: Run
bunx nx build <project>if applicable
If any of these fail, you MUST fix the issues. Do not proceed until all checks pass.
Keep Fixing Until It Works
When tests or linting fail, you MUST:
- Analyze the failure output carefully
- Fix the root cause (not the symptom)
- Re-run the tests/linting
- Repeat until ALL tests and linting pass
Do NOT:
- Skip tests to make things "pass"
- Reduce thresholds or expectations
- Work around the issue without fixing it
- Give up and leave failures unaddressed
Test Structure Best Practices
Use Proper Test Frameworks
- Use Jest/Bun test for unit and integration tests
- Follow existing test patterns in the repository
- Use descriptive test names that explain what is being tested
Test Organization
describe('Feature/Component Name', () => {
describe('method or function name', () => {
it('should behave correctly when condition', () => {
// Arrange
const input = setupTestData();
// Act
const result = functionUnderTest(input);
// Assert
expect(result).toBeDefined();
expect(result.value).toBe(expectedValue);
});
});
});
Validation and Error Handling
// Check for validation errors
if (isValidationError(result)) {
throw new Error(`Validation failed: ${result.message}`);
}
// Always validate structure and expected values
expect(result).toBeDefined();
expect(result.property).toBe(expectedValue);
Timeouts
Set appropriate timeouts for async operations:
it('should complete async operation', async () => {
// test code
}, 30000); // 30 second timeout for integration tests
Environment Setup
Tests may require environment variables. Use 1Password CLI to load them:
eval $(op signin) # If not already authenticated
Check test files for required environment variables and ensure they are configured.
Running Tests
Single Project
bunx nx test <project-name>
All Affected Projects
bunx nx affected --target=test
With Coverage
bunx nx test <project-name> --coverage
Running Linting
Single Project
bunx nx lint <project-name>
All Affected Projects
bunx nx affected --target=lint
Auto-fix Issues
bunx biome check --write .
Workflow
When making code changes, follow this workflow:
- Make your changes - Implement the feature or fix
- Run linting -
bunx nx lint <project>and fix any issues - Run tests -
bunx nx test <project>and fix any failures - Run build -
bunx nx build <project>if applicable - Verify manually - Test the functionality works as expected
- Repeat - If any step fails, fix and re-run all checks
Do NOT consider your work complete until:
- ✅ All linting passes without warnings or errors
- ✅ All tests pass without skipping any
- ✅ The build succeeds (if applicable)
- ✅ Manual verification confirms functionality works
Common Issues
Test Failures
- Read the error message carefully
- Check if environment variables are missing
- Verify test data and mocks are set up correctly
- Debug the actual code being tested
- Fix the root cause, not the test
Linting Failures
- Run
bunx biome check --write .to auto-fix formatting - For remaining issues, read the linting error and fix manually
- Never disable linting rules to make code pass
Build Failures
- Check for TypeScript type errors
- Ensure all imports are correct
- Verify dependencies are installed
- Fix compilation errors in the code
What NOT to Do
❌ Never skip tests with .skip()
❌ Never reduce test expectations to make them pass
❌ Never disable linting rules without good reason
❌ Never ignore build warnings or errors
❌ Never commit code with failing tests
❌ Never commit commented-out tests
❌ Never proceed if tests fail - fix them first
❌ Never give up on fixing issues - keep iterating until resolved
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です