1.7 KiB
1.7 KiB
tests/[test-type]/
This directory contains [test type] tests for [what is being tested].
Overview
Test Structure
[test-type]/
├── subdirectory1/ # Tests for X
├── subdirectory2/ # Tests for Y
└── helpers/ # Test utilities and fixtures
Running Tests
# All tests in this directory
npm run test:[test-type]
# Specific test file
npm run test:[test-type] -- path/to/test.test.ts
# Watch mode
npm run test:[test-type]:watch
Test Environment
These tests use:
- Database: [Description]
- External Services: [How mocked/handled]
- Test Data: [Where fixtures are located]
Patterns
Test Structure
describe('Feature Name', () => {
beforeEach(() => {
// Setup
});
afterEach(() => {
// Cleanup
});
it('should do something', () => {
// Arrange
// Act
// Assert
});
});
Fixtures and Factories
import { fixtures } from './fixtures';
const user = fixtures.user();
const admin = fixtures.user({ role: 'admin' });
Common Patterns
- Pattern 1: Description
- Pattern 2: Description
Troubleshooting
Issue 1
Problem description and solution.
Issue 2
Problem description and solution.
Notes
- Important note about test conventions
- Known limitations
Last Updated: YYYY-MM-DD