Skip to content

Instantly share code, notes, and snippets.

@necccc
Created February 2, 2015 19:24
Show Gist options
  • Save necccc/29a36782a57b22f15968 to your computer and use it in GitHub Desktop.
Save necccc/29a36782a57b22f15968 to your computer and use it in GitHub Desktop.
// npm install mocha sinon chai
// test.js
var assert = require('chai').assert;
var sinon = require('sinon');
var mymodule = require('./mymodule');
suite('mymodule', function () {
setup(function () {
//...
});
teardown(function () {
//...
});
test('something', function () {
var somevalue = mymodule();
sinon.assert.match(somevalue, sinon.match.array)
});
});
// mocha --ui tdd test.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment