The CLI minesweeper project was originally asked as an interview question. Found it interesting to put it on GitHub as coding this game was actually pretty fun! (Even though I failed 🤫). Then wanted to try out Svelte framework so created a web app out from it. You can still find the original CLI version version here https://github.com/Shaance/minesweeper/releases/tag/v1.0.0
If you have Docker simply run docker-compose up
from the root of the repository and connect to localhost:5000
. Else follow the instructions below:
- Install nvm if you do not have it already: https://github.com/nvm-sh/nvm
- In the root of the repository run
nvm use
, if the required node version is not installed please follow the instructions to install it - Once the required node version is installed, run
npm i
to install dependencies - Run
npm run build
to transpile TS to JS - Run
npm start
and connect tolocalhost:5000
- For the unit tests just run
npm run test
- For the front-end integration tests you need to have a server running locally and run
npm run cy:run
or you can also run against another url by changing the base url variable incypress.json
file before runningnpm run cy:run
- Vercel has been setup for this repo and is used to deploy every new branch to a preview environment.
- A github action defined in
on_pull_request.yml
has been set to build, run unit and integration tests for every pull request. - Vercel will create an url based on the branch name, and the integration tests will target that URL. A drawback of using the url based on the branch name is that we cannot use non url friendly characters or underscores in the branch name.
Rules can be found here https://www.instructables.com/How-to-play-minesweeper/.