The cheat sheets in this Gist are for the Oxford Code Retreat on the 6/7/2014.
Last active
August 29, 2015 14:03
-
-
Save spikeheap/36140b1015a4b364826c to your computer and use it in GitHub Desktop.
Code Retreat cheat sheet
- A relatively up-to-date installation of nodejs
- NPM package manager (bundled with newer versions of nodejs)
Grab the client with npm install -g coderetreat
Tests and code live in the same file. To get started you might use the following template:
describe("numbers", function () {
it("should be themselves", function () {
(getANumber()).should.be.exactly(12);
}
}
function getANumber(){
return 12;
}Run cr path/to/my/session.js. The client will watch the file for changes and print the results to the terminal. When your tests fail the details will also be printed.
We're using mocha and should.js, and these are included by default in your environment so you can just start hacking.
Check out the should.js page for examples of how to construct assertions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment