Files
PodTui/tasks/podcast-tui-app/55-component-tests.md
Michael Freno f08afb2ed1 init
2026-02-03 23:29:36 -05:00

68 lines
1.8 KiB
Markdown

# 54. Set Up Testing Framework (Snapshot Testing)
meta:
id: podcast-tui-app-54
feature: podcast-tui-app
priority: P1
depends_on: [53]
tags: [testing, framework, setup, opentui]
objective:
- Set up OpenTUI testing framework
- Configure test runner
- Set up snapshot testing
- Configure test environment
deliverables:
- `tests/` directory with test structure
- `tests/setup.ts` with test setup
- `tests/config.ts` with test configuration
- `package.json` with test scripts
steps:
- Install testing dependencies:
- `@opentui/testing`
- `@opentui/react` (for testing)
- `@opentui/solid` (for testing)
- `bun test` (built-in test runner)
- Configure test environment:
- Set up test renderer
- Configure test options
- Set up test fixtures
- Create test structure:
- `tests/components/` for component tests
- `tests/integration/` for integration tests
- `tests/utils/` for utility tests
- `tests/fixtures/` for test data
- Add test scripts to `package.json`:
- `test`: Run all tests
- `test:watch`: Run tests in watch mode
- `test:coverage`: Run tests with coverage
- `test:components`: Run component tests
- `test:integration`: Run integration tests
tests:
- Unit: Verify testing framework is set up
- Integration: Verify test scripts work
- Component: Verify snapshot testing works
acceptance_criteria:
- Testing framework installed and configured
- Test scripts work correctly
- Snapshot testing configured
- Test environment set up
validation:
- Run `bun test` to execute all tests
- Run `bun test:components` to run component tests
- Run `bun test:coverage` for coverage report
- Check all tests pass
notes:
- Use OpenTUI's testing framework for snapshot testing
- Test components in isolation
- Use test fixtures for common data
- Mock external dependencies
- Keep tests fast and focused
- Add CI/CD integration for automated testing