A Vue 2 horse racing game built with TypeScript, featuring horse generation, race scheduling, and animated races.
npm ci --legacy-peer-depsnpm run servenpm run buildnpm run test:unitnpm run test:unit:coverage# Start dev server first, then in another terminal:
npm run test:e2e
# Or use the convenience script:
./scripts/test-e2e.sh
# Interactive mode:
npm run test:e2e:opennpm run lintThis project includes comprehensive testing:
- Unit Tests: Jest-based tests for Vuex store and utilities
- E2E Tests: Cypress tests for complete user workflows
- Component Tests: Cypress component tests for individual Vue components
See cypress/README.md for detailed E2E testing documentation.
src/store/modules/horses/__tests__/
├── horses.spec.ts # Vuex store module tests
└── utils.spec.ts # Utility function tests
Run tests with coverage to see how well your code is tested:
# Run all unit tests
npm run test:unit
# Run all unit tests with coverage
npm run test:unit:coverageThis will generate a coverage report showing:
- Statements: Percentage of code statements executed
- Branches: Percentage of conditional branches tested
- Functions: Percentage of functions called
- Lines: Percentage of lines executed
- Store Tests: Test Vuex mutations, actions, and getters
- Utility Tests: Test pure functions with various inputs
- Component Tests: Test individual Vue components in isolation
This project uses ESLint with TypeScript and Vue.js rules for consistent code quality.
- TypeScript: Strict type checking and best practices
- Vue.js: Vue 2 specific rules and component standards
- Prettier: Code formatting consistency
- ES6+: Modern JavaScript features and patterns
Consider setting up pre-commit hooks to automatically run:
npm run lint- Check code qualitynpm run test:unit- Ensure tests passnpm run build- Verify build works
- Write Code → Implement features in components/store
- Write Tests → Add unit tests for new functionality
- Check Quality → Run
npm run lintto ensure code standards - Verify Tests → Run
npm run test:unitto ensure tests pass - Check Coverage → Run
npm run test:unit:coverageto maintain good coverage - Commit → Only commit when all checks pass
- Linting: All files must pass ESLint rules
- Unit Tests: All tests must pass with >80% coverage
- Build: Project must build successfully
- E2E Tests: Critical user flows must pass