https://github.com/jcarloslucio/battleship
A Battleship game using Test Driven Development
https://github.com/jcarloslucio/battleship
battleship scss test-driven-development
Last synced: 5 months ago
JSON representation
A Battleship game using Test Driven Development
- Host: GitHub
- URL: https://github.com/jcarloslucio/battleship
- Owner: JCarlosLucio
- Created: 2020-08-18T18:20:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-15T20:05:22.000Z (about 3 years ago)
- Last Synced: 2025-05-05T03:32:46.350Z (about 1 year ago)
- Topics: battleship, scss, test-driven-development
- Language: JavaScript
- Homepage: https://jcarloslucio.github.io/battleship/
- Size: 370 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🚢 BATTLESHIP

[](https://github.com/JCarlosLucio/battleship#readme)
> A Battleship game using Test Driven Development with Jest.
> Developed for The Odin Project's
> [curriculum](https://www.theodinproject.com/lessons/node-path-javascript-battleship).
## ✨ Demo
[](https://jcarloslucio.github.io/battleship)
## 📜 Docs
### Install
```sh
npm install
```
Installs dependencies.
### Start
```sh
npm run start
```
Starts the development server.
### Test
```sh
npm run test
```
Runs the tests.
### Watch
```sh
npm run watch
```
Runs the test runner in watch mode.
### Build
```sh
npm run build
```
Builds the app for production to the `dist` directory.
## 🚀 Manual Deployment
[Deploy to GitHub Pages from `dist` directory](https://gist.github.com/cobyism/4730490).
1. Remove `dist`directory from `.gitignore`.
2. Create production bundle:
```sh
npm run build
```
3. Make sure git knows about your subtree (the subfolder with your site).
```sh
git add dist && git commit -m "Initial dist subtree commit"
```
4. Use subtree push to send it to the `gh-pages` branch on GitHub.
```sh
git subtree push --prefix dist origin gh-pages
```
## 📖 Lessons Learned
- How to setup testing.
- Developing using [Test Driven Development](https://web.archive.org/web/20211123190134/http://godswillokwara.com/index.php/2016/09/09/the-importance-of-test-driven-development/) with [Jest](https://jestjs.io/).
- Using Factory Functions and the Module Pattern.
- Using [SASS (or SCSS)](https://sass-lang.com/) to style the application using the [SASS guidelines](https://sass-guidelin.es/).
- Manual deployment to GitHub Pages.
- Using [webpack](https://webpack.js.org/) for bundling and compiling.
- Using [contentHash] in webpack bundles for cache busting.
## Author
👤 **Juan Carlos Lucio**
* Github: [@JCarlosLucio](https://github.com/JCarlosLucio)