mocha
Advanced tools
Comparing version 1.0.0 to 1.0.1
1.0.1 / 2012-04-04 | ||
================== | ||
* Fixed `.timeout()` in hooks | ||
* Fixed: allow callback for `mocha.run()` in client version | ||
* Fixed browser hook error display. Closes #361 | ||
1.0.0 / 2012-03-24 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -17,5 +17,5 @@ | ||
/** | ||
* Set the context `Test` to `test`. | ||
* Set the context `Runnable` to `runnable`. | ||
* | ||
* @param {Test} test | ||
* @param {Runnable} runnable | ||
* @return {Context} | ||
@@ -25,4 +25,4 @@ * @api private | ||
Context.prototype.test = function(test){ | ||
this._test = test; | ||
Context.prototype.runnable = function(runnable){ | ||
this._runnable = runnable; | ||
return this; | ||
@@ -40,3 +40,3 @@ }; | ||
Context.prototype.timeout = function(ms){ | ||
this._test.timeout(ms); | ||
this._runnable.timeout(ms); | ||
return this; | ||
@@ -46,3 +46,3 @@ }; | ||
/** | ||
* Inspect the context void of `._test`. | ||
* Inspect the context void of `._runnable`. | ||
* | ||
@@ -55,3 +55,3 @@ * @return {String} | ||
return JSON.stringify(this, function(key, val){ | ||
return '_test' == key | ||
return '_runnable' == key | ||
? undefined | ||
@@ -58,0 +58,0 @@ : val; |
@@ -24,3 +24,3 @@ | ||
exports.version = '1.0.0'; | ||
exports.version = '1.0.1'; | ||
@@ -27,0 +27,0 @@ /** |
@@ -81,3 +81,3 @@ | ||
runner.on('fail', function(test, err){ | ||
if (err.uncaught) runner.emit('test end', test); | ||
if ('hook' == test.type || err.uncaught) runner.emit('test end', test); | ||
}); | ||
@@ -84,0 +84,0 @@ |
@@ -110,2 +110,4 @@ | ||
if (ctx) ctx.runnable(this); | ||
// timeout | ||
@@ -112,0 +114,0 @@ if (this.async) { |
@@ -159,3 +159,2 @@ | ||
self.currentRunnable = hook; | ||
hook.ctx.test(self.test); | ||
@@ -269,3 +268,2 @@ self.emit('hook', hook); | ||
try { | ||
test.ctx.test(test); | ||
test.on('error', function(err){ | ||
@@ -272,0 +270,0 @@ self.fail(test, err); |
{ | ||
"name": "mocha" | ||
, "version": "1.0.0" | ||
, "version": "1.0.1" | ||
, "description": "simple, flexible, fun test framework" | ||
@@ -5,0 +5,0 @@ , "keywords": ["test", "bdd", "tdd", "tap"] |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
275605
64
9539