Skip to content

whroman/minesweeper-react

Repository files navigation

Build Status Test Coverage

A single-page Minesweeper app. View live here.

Languages

Client Code

Tests

  • Mocha - JS test framework
  • Chai - Test assertion library
  • jsdom - Used here to spoof the DOM's JS API in tests regarding views
  • CoffeeCoverage - Code coverage tool for Coffeescript
  • Istanbul - Used here only to generate code coverage data file for Code Climate (coverage/lcov.info)

Requirements

To work on the app client code, you'll need to have the following packages installed before continuing.

Then run npm install.

Commands

  • npm test - Runs Mocha tests on all files in Spec except those that start with an underscore (eg. Spec/_willNotRun.js).

Destination of build files is defined in Tasks/paths.js

  • gulp css:build

    • Compiles and builds Sass
  • gulp js:build

    • Compiles and builds Coffeescript
  • gulp build

    • Runs css:build and js:build
  • gulp or gulp dev

    • Boots up a server at 127.0.0.1:8890/
    • Runs css:build when a change is made in Resources/scss/**/*.scss
    • Runs js:build when a change is made in Resources/coffee/**/*.coffee

Development

Getting Started

It is imperative to have the default gulp (or gulp dev) task running while writing scss or coffee.

Adding Third-Party JS

The project is currently only set up to accept libraries that have browserify support.

  1. Install the library via npm install <lib>

  2. Use require syntax to include the package in Coffee files

Adding New Coffeescript Files

  1. Create a .coffee file within /Resources/coffee/

  2. The file will be automagically built into build.js

Adding New SCSS Files

  1. Include new stylesheets in /Resources/scss/app.scss using @import "path/to/file.scss"
  2. The file will be automagically built into build.css