Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example Test
var Example = (function(){
return {
math: function() {
complexMethod: function() {
suite('Example', function() {
var subject;
//will be called before each "test" block.
setup(function() {
subject = new Example();
//for a simple method
test('#math', function() {
var result = subject.math('1', '+', '1');
assert.equal(result, 2, 'addition should work');
//when you have a method that will
//require complex setup/teardown logic
suite('#complexMethod', function() {
var result;
setup(function() {
//complex setup stuff
result = subject.complexMethod();
test('stuff works', function() {
assert.equal(result, 'real value', 'should output real value');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.