# Test Organization

> Test file structure and naming conventions for the music-app project.

- Skill: `majiayu000/test-organization` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add majiayu000/test-organization`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/test-organization/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/test-organization

---


# Test Organization Skill

## Purpose
Test file structure and naming conventions for the music-app project.

## File Structure
```
src/
├── components/
│   ├── NavBar.jsx
│   └── __tests__/
│       └── NavBar.test.jsx
├── services/
│   ├── tunesService.js
│   └── __tests__/
│       └── tunesService.test.js
```

## Naming Conventions
- Component tests: `ComponentName.test.jsx`
- Service tests: `serviceName.test.js`
- Test directory: `__tests__/` adjacent to source

## Test Structure
```javascript
describe('ComponentName', () => {
  beforeEach(() => {
    jest.clearAllMocks();
  });

  describe('feature group', () => {
    test('specific behavior', () => {
      // Arrange
      // Act
      // Assert
    });
  });
});
```

## Best Practices
✅ Group related tests with describe
✅ Clear, descriptive test names
✅ One assertion per test (usually)
✅ Clean up in beforeEach/afterEach
❌ Don't skip tests without reason
❌ Don't test implementation details

