Comparing version 0.0.8 to 0.1.0
0.1.0 / 2011-11-29 | ||
================== | ||
* Added `suiteSetup` and `suiteTeardown` to TDD interface [David Henderson] | ||
* Added growl icons. Closes #84 | ||
* Fixed coffee-script support | ||
0.0.8 / 2011-11-25 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -11,5 +11,9 @@ | ||
* TDD-style interface: | ||
* | ||
* | ||
* suite('Array', function(){ | ||
* suite('#indexOf()', function(){ | ||
* suiteSetup(function(){ | ||
* | ||
* }); | ||
* | ||
* test('should return -1 when not present', function(){ | ||
@@ -22,5 +26,9 @@ * | ||
* }); | ||
* | ||
* suiteTeardown(function(){ | ||
* | ||
* }); | ||
* }); | ||
* }); | ||
* | ||
* | ||
*/ | ||
@@ -42,3 +50,3 @@ | ||
/** | ||
* Execute before each test case. | ||
* Execute after each test case. | ||
*/ | ||
@@ -51,2 +59,18 @@ | ||
/** | ||
* Execute before the suite. | ||
*/ | ||
context.suiteSetup = function(fn){ | ||
suites[0].beforeAll(fn); | ||
}; | ||
/** | ||
* Execute after the suite. | ||
*/ | ||
context.suiteTeardown = function(fn){ | ||
suites[0].afterAll(fn); | ||
}; | ||
/** | ||
* Describe a "suite" with the given `title` | ||
@@ -56,3 +80,3 @@ * and callback `fn` containing nested suites | ||
*/ | ||
context.suite = function(title, fn){ | ||
@@ -59,0 +83,0 @@ var suite = Suite.create(suites[0], title); |
@@ -12,3 +12,3 @@ | ||
exports.version = '0.0.8'; | ||
exports.version = '0.1.0'; | ||
@@ -15,0 +15,0 @@ exports.interfaces = require('./interfaces'); |
{ | ||
"name": "mocha" | ||
, "version": "0.0.8" | ||
, "version": "0.1.0" | ||
, "description": "Test framework inspired by JSpec, Expresso, & Qunit" | ||
@@ -5,0 +5,0 @@ , "keywords": ["test", "bdd", "tdd", "tap"] |
suite('Array', function(){ | ||
suite('#indexOf()', function(){ | ||
var initialValue = 32; | ||
suiteSetup(function(done){ | ||
initialValue.should.eql(32); | ||
initialValue = 42; | ||
done(); | ||
}); | ||
test('should return -1 when the value is not present', function(){ | ||
initialValue.should.eql(42); | ||
[1,2,3].indexOf(5).should.equal(-1); | ||
@@ -10,2 +19,3 @@ [1,2,3].indexOf(0).should.equal(-1); | ||
test('should return the correct index when the value is present', function(){ | ||
initialValue.should.eql(42); | ||
[1,2,3].indexOf(1).should.equal(0); | ||
@@ -15,3 +25,7 @@ [1,2,3].indexOf(2).should.equal(1); | ||
}) | ||
suiteTeardown(function(done){ | ||
initialValue.should.eql(42); | ||
done(); | ||
}); | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
127613
75
4600