Comparing version 0.8.1 to 0.9.0
@@ -689,3 +689,3 @@ | ||
exports.version = '0.8.1'; | ||
exports.version = '0.9.0'; | ||
@@ -2017,2 +2017,3 @@ exports.utils = require('./utils'); | ||
this._timeout = 2000; | ||
this.context = this; | ||
} | ||
@@ -2095,2 +2096,3 @@ | ||
, start = new Date | ||
, ctx = this.context | ||
, finished | ||
@@ -2130,3 +2132,3 @@ , emitted; | ||
try { | ||
this.fn(function(err){ | ||
this.fn.call(ctx, function(err){ | ||
if (err instanceof Error) return done(err); | ||
@@ -2144,3 +2146,3 @@ if (null != err) return done(new Error('done() invoked with non-Error: ' + err)); | ||
try { | ||
if (!this.pending) this.fn(); | ||
if (!this.pending) this.fn.call(ctx); | ||
this.duration = new Date - start; | ||
@@ -2316,2 +2318,3 @@ fn(); | ||
self.currentRunnable = hook; | ||
hook.context = self.test; | ||
@@ -2318,0 +2321,0 @@ self.emit('hook', hook); |
0.8.2 / 2012-01-05 | ||
================== | ||
* Added test-case context support. Closes #113 | ||
* Fixed exit status. Closes #187 | ||
* Update commander. Closes #190 | ||
0.8.1 / 2011-12-30 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -12,3 +12,3 @@ | ||
exports.version = '0.8.1'; | ||
exports.version = '0.9.0'; | ||
@@ -15,0 +15,0 @@ exports.utils = require('./utils'); |
@@ -29,2 +29,3 @@ | ||
this._timeout = 2000; | ||
this.context = this; | ||
} | ||
@@ -105,2 +106,3 @@ | ||
, start = new Date | ||
, ctx = this.context | ||
, finished | ||
@@ -140,3 +142,3 @@ , emitted; | ||
try { | ||
this.fn(function(err){ | ||
this.fn.call(ctx, function(err){ | ||
if (err instanceof Error) return done(err); | ||
@@ -154,3 +156,3 @@ if (null != err) return done(new Error('done() invoked with non-Error: ' + err)); | ||
try { | ||
if (!this.pending) this.fn(); | ||
if (!this.pending) this.fn.call(ctx); | ||
this.duration = new Date - start; | ||
@@ -157,0 +159,0 @@ fn(); |
@@ -159,2 +159,3 @@ | ||
self.currentRunnable = hook; | ||
hook.context = self.test; | ||
@@ -161,0 +162,0 @@ self.emit('hook', hook); |
@@ -691,3 +691,3 @@ ;(function(){ | ||
exports.version = '0.8.1'; | ||
exports.version = '0.9.0'; | ||
@@ -2019,2 +2019,3 @@ exports.utils = require('./utils'); | ||
this._timeout = 2000; | ||
this.context = this; | ||
} | ||
@@ -2097,2 +2098,3 @@ | ||
, start = new Date | ||
, ctx = this.context | ||
, finished | ||
@@ -2132,3 +2134,3 @@ , emitted; | ||
try { | ||
this.fn(function(err){ | ||
this.fn.call(ctx, function(err){ | ||
if (err instanceof Error) return done(err); | ||
@@ -2146,3 +2148,3 @@ if (null != err) return done(new Error('done() invoked with non-Error: ' + err)); | ||
try { | ||
if (!this.pending) this.fn(); | ||
if (!this.pending) this.fn.call(ctx); | ||
this.duration = new Date - start; | ||
@@ -2318,2 +2320,3 @@ fn(); | ||
self.currentRunnable = hook; | ||
hook.context = self.test; | ||
@@ -2320,0 +2323,0 @@ self.emit('hook', hook); |
{ | ||
"name": "mocha" | ||
, "version": "0.8.1" | ||
, "version": "0.9.0" | ||
, "description": "simple, flexible, fun test framework" | ||
@@ -14,3 +14,3 @@ , "keywords": ["test", "bdd", "tdd", "tap"] | ||
, "dependencies":{ | ||
"commander": "0.3.2" | ||
"commander": "0.5.1" | ||
, "growl": "1.4.x" | ||
@@ -17,0 +17,0 @@ , "debug": "*" |
25
test.js
describe('mocha tests', function() { | ||
beforeEach(function(done) { | ||
// there is beforeEach hook | ||
process.nextTick(function(){ | ||
throw new Error('fail') | ||
}); | ||
}); | ||
it('two', function(done) { | ||
setTimeout(function() { | ||
throw new Error('fail two'); | ||
done(); | ||
}, 0); | ||
}); | ||
it('three', function(done) { | ||
throw new Error('fail three'); | ||
done(); | ||
}); | ||
}); | ||
describe('something', function(){ | ||
it('should work', function(){ | ||
throw new Error('fail') | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
317946
89
8570
+ Addedcommander@0.5.1(transitive)
- Removedcommander@0.3.2(transitive)
Updatedcommander@0.5.1