Skip to content

alashchev17/mafia-randomizer

Repository files navigation

Mafia (roles randomizer)

A project created to simplify the process of conducting the game "Mafia" for hosts. It is a ready-to-use tool for convenient monitoring of the game process with a pleasant visual component.

Available Languages

Language Link
English README.md
Russian README.ru.md

ℹ️ Changelog

Changelog 24.11.23 v0.2:

  • Implemented the "Settings" page;
  • Added game mode selection;
  • Moved the functionality of determining the number of players to the "Settings" page;
  • Added a new role: "Doctor".

Changelog 26.11.23 v0.2.1:

  • Implemented notifications when saving settings.

Changelog 06.12.23 v1.0-pre-release:

  • Added the "Game Field" page;
  • Added a game timer with several parameters;
  • Implemented a system for tracking player statuses;
  • Implemented a voting system;
  • Implemented a system for recording rule violations;
  • Fixed minor interface display bugs.

Changelog 12.12.23 v1.1-pre-release:

  • Added scenarios for automatic game completion (according to the rules of the game "Mafia");
  • Fixed bugs and errors in the code.

Changelog 15.12.23 v1.2:

  • Added a history of game events as a separate page;
  • Fixed bugs and errors on the Game Field page.

Changelog 05.01.24 v1.3:

  • Added automatic removal of a player in voting if they were the only one nominated;
  • Fixed bugs and errors in the code.

Changelog 07.11.24 v1.4:

  • Added a new language - English;
  • Fixed bugs and errors in the code, lots of optimizations.

Changelog [Current Date] v1.5:

  • Added comprehensive testing suite with Vitest and Cypress;
  • Implemented unit tests for core components and utilities;
  • Added end-to-end tests for critical application flows;
  • Improved code reliability and maintainability.

🧑🏼‍💻 Tech Stack

  • React
  • TypeScript
  • React-Router v6
  • Framer Motion
  • i18next
  • Vitest (Unit Testing)
  • Cypress (E2E Testing)

🧪 Testing

The project now includes a comprehensive testing suite:

Unit Tests (Vitest)

Unit tests cover individual components and utilities to ensure they function correctly in isolation:

  • Core components like PlayerCard, GameDesk, etc.
  • Utility functions like rolesRandomizer
  • Context providers like SessionContext

Run unit tests with:

npm run test        # Run tests in watch mode
npm run test:ui     # Run tests with UI
npm run test:coverage # Generate test coverage report

End-to-End Tests (Cypress)

E2E tests simulate real user interactions to verify the application works correctly as a whole:

  • Navigation between pages
  • Game setup and configuration
  • Game state management

Run E2E tests with:

npm run test:e2e    # Run all E2E tests headlessly
npm run cypress:open # Open Cypress UI for interactive testing

📁 Sources

About

Resources

License

Stars

Watchers

Forks

Languages