This is a Vue.js project that generates and manages horse races. The application selects random horses, assigns them to races, and displays race results. This project uses Vuex for state management and Mocha + Chai for unit testing.
- Installation
- Run the Application
- Build the Application
- Run Unit Tests
- Features
- Usage
- State Management
- Testing
- Folder Structure
To get started with the project, clone the repository and install the necessary dependencies:
git clone https://github.com/esraay/horse-race.git
cd horse-race
npm install
To run the application in development mode:
npm run serve
After running the above command, the application will be available at:
To build the project for production:
npm run build
To execute the unit tests with Mocha and Chai:
npm run test:unit
- Randomly generate horse races
- Start and stop race animations
- Update and display race results
- Persistent Vuex state management
- Comprehensive unit testing with Mocha and Chai
Once the app is running, you can start races, generate horse selections, and see the results displayed. Click on the race buttons to trigger different actions.
The app leverages Vuex for managing global state. Horses, races, and results are managed in the Vuex store. Vuex allows centralized state control, making it easier to manage and test the application.
Unit tests are written using Mocha and Chai. The tests cover Vuex actions, mutations, and component behavior.
- /src - Source files
- /src/store - Vuex store configuration
- /src/components - Vue components (e.g., Race.vue, Results.vue)
- /tests/unit - Unit tests for components and store