1.0.0 • Published 8 years ago

workshopper-mocha-boilerplate v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 years ago

workshopper-mocha-boilerplate

A boilerplate for workshopper modules with Mocha tests and ES6 syntax

npm Build Status dependency Status devDependency Status

Screenshot

  1. Install Node.js
  2. Run npm install -g workshopper-mocha-boilerplate
  3. Run workshopper-mocha-boilerplate
  4. .. profit!

Releasing your own workshopper module

First, install the project and make sure it runs:

git clone git@github.com:ThibWeb/workshopper-mocha-boilerplate.git
cd workshopper-mocha-boilerplate
npm install
node src/index.js

Then, replace all references to workshopper-mocha-boilerplate and ThibWeb with your own module's name and GitHub account name. Customize the README and LICENSE files for your need.

Then it's time to write some exercises! Have a look at the example exercise, and get cracking. The point of this boilerplate is to make it easier to write workshoppers by using Mocha, so you should be at ease here.

To add a new exercise, you need to:

  1. Add it to src/exercises/menu.json
  2. Add the directory to src/exercises/, with a name matching the one in the menu
  3. Add a .spec.js file in src/tests
  4. Add test commands in tests.sh

To check your work, make sure to:

# Run your workshopper manually
node src/index.js
# Run linting and unit tests
npm run lint
npm run test
# Make sure your project compiles down to ES5
npm run build
# Setup your project on a CI platform like Travis, where it will run
npm run test:ci

Contributing

Install the project with:

git clone git@github.com:ThibWeb/workshopper-mocha-boilerplate.git
cd workshopper-mocha-boilerplate
npm install
npm install -g eslint babel-eslint eslint-config-airbnb
./.githooks/deploy

To run the workshopper locally:

node src/index.js

To release a new version:

npm version minor -m "Release %s"
git push origin master
git push --tags
npm publish