Skip to content

Instantly share code, notes, and snippets.

@smazurov
Last active December 10, 2015 01:38
Show Gist options
  • Save smazurov/4361378 to your computer and use it in GitHub Desktop.
Save smazurov/4361378 to your computer and use it in GitHub Desktop.
Setup needed to get tdd-syntax tests rocking for brunch.io

This is an example of how to write tdd style tests for brunch.io projects and the required setup

# add this to the end of the exports object in the config file
test:
ui: 'tdd'
// test/test-helpers.js
var chai = require('chai');
module.exports = {
assert: chai.assert,
customAssertion: function(){ }
};
// test/name-of-module-test.js
suite('Array', function(){
setup(function(){
// ...
});
suite('#indexOf()', function(){
test('should return -1 when not present', function(){
assert.equal(-1, [1,2,3].indexOf(4));
assert.equal(-1, [1,2,3].indexOf(0));
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment