A boilerplate for workshopper modules with Mocha tests and ES6 syntax
- Install Node.js
- Run
npm install -g workshopper-mocha-boilerplate
- Run
workshopper-mocha-boilerplate
- .. profit!
First, install the project and make sure it runs:
git clone git@github.com:thibaudcolas/workshopper-mocha-boilerplate.git
cd workshopper-mocha-boilerplate
npm install
node src/index.js
Then, replace all references to workshopper-mocha-boilerplate
and thibaudcolas
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:
- Add it to
src/exercises/menu.json
- Add the directory to
src/exercises/
, with a name matching the one in the menu - Add a
.spec.js
file insrc/tests
- 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
Install the project with:
git clone git@github.com:thibaudcolas/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
This boilerplate was extracted from the Test-drive D3 workshopper, and is originally inspired by Thinking in React.