mocha
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -1141,2 +1141,6 @@ | ||
runner.on('fail', function(test, err){ | ||
if (err.uncaught) runner.emit('test end', test); | ||
}); | ||
runner.on('test end', function(test){ | ||
@@ -2381,2 +2385,3 @@ // TODO: add to stats | ||
runnable.clearTimeout(); | ||
err.uncaught = true; | ||
self.fail(runnable, err); | ||
@@ -2383,0 +2388,0 @@ |
0.6.0 / 2011-12-18 | ||
================== | ||
* Added setZeroTimeout timeout for browser (nicer stack traces). Closes #153 | ||
* Added "view source" on hover for HTML reporter to make it obvious | ||
* Changed: replace custom growl with growl lib | ||
* Fixed duplicate reporting for HTML reporter. Closes #154 | ||
* Fixed silent hook errors in the HTML reporter. Closes #150 | ||
0.5.0 / 2011-12-14 | ||
@@ -3,0 +12,0 @@ ================== |
@@ -12,3 +12,3 @@ | ||
exports.version = '0.5.0'; | ||
exports.version = '0.6.0'; | ||
@@ -15,0 +15,0 @@ exports.interfaces = require('./interfaces'); |
@@ -69,2 +69,6 @@ | ||
runner.on('fail', function(test, err){ | ||
if (err.uncaught) runner.emit('test end', test); | ||
}); | ||
runner.on('test end', function(test){ | ||
@@ -71,0 +75,0 @@ // TODO: add to stats |
@@ -397,2 +397,3 @@ | ||
runnable.clearTimeout(); | ||
err.uncaught = true; | ||
self.fail(runnable, err); | ||
@@ -399,0 +400,0 @@ |
47
mocha.js
@@ -1143,2 +1143,6 @@ ;(function(){ | ||
runner.on('fail', function(test, err){ | ||
if (err.uncaught) runner.emit('test end', test); | ||
}); | ||
runner.on('test end', function(test){ | ||
@@ -2383,2 +2387,3 @@ // TODO: add to stats | ||
runnable.clearTimeout(); | ||
err.uncaught = true; | ||
self.fail(runnable, err); | ||
@@ -2704,3 +2709,43 @@ | ||
}); // module: watch.js | ||
// Only add setZeroTimeout to the window object, and hide everything else in a closure. | ||
(function() { | ||
var timeouts = [], | ||
messageName = 'zero-timeout-message'; | ||
// Like setTimeout, but only takes a function argument. There's | ||
// no time argument (always zero) and no arguments (you have to | ||
// use a closure). | ||
function setZeroTimeoutPostMessage(fn) { | ||
timeouts.push(fn); | ||
window.postMessage(messageName, '*'); | ||
} | ||
function setZeroTimeout(fn) { | ||
setTimeout(fn, 0); | ||
} | ||
function handleMessage(event) { | ||
if (event.source == window && event.data == messageName) { | ||
if (event.stopPropagation) { | ||
event.stopPropagation(); | ||
} | ||
if (timeouts.length) { | ||
timeouts.shift()(); | ||
} | ||
} | ||
} | ||
if (window.postMessage) { | ||
if (window.addEventListener) { | ||
window.addEventListener('message', handleMessage, true); | ||
} else if (window.attachEvent) { | ||
window.attachEvent('onmessage', handleMessage); | ||
} | ||
window.setZeroTimeout = setZeroTimeoutPostMessage; | ||
} else { | ||
window.setZeroTimeout = setZeroTimeout; | ||
} | ||
}()); | ||
/** | ||
@@ -2720,3 +2765,3 @@ * Node shims. | ||
process.nextTick = function(fn){ fn(); }; | ||
process.nextTick = setZeroTimeout; | ||
@@ -2723,0 +2768,0 @@ process.removeListener = function(ev){ |
{ | ||
"name": "mocha" | ||
, "version": "0.5.0" | ||
, "description": "Test framework inspired by JSpec, Expresso, & Qunit" | ||
, "version": "0.6.0" | ||
, "description": "simple, flexible, fun test framework" | ||
, "keywords": ["test", "bdd", "tdd", "tap"] | ||
@@ -19,2 +19,3 @@ , "bin": { "mocha": "./bin/mocha" } | ||
"commander": "0.3.2" | ||
, "growl": "1.4.x" | ||
, "debug": "*" | ||
@@ -21,0 +22,0 @@ } |
@@ -16,3 +16,3 @@ | ||
process.nextTick = function(fn){ fn(); }; | ||
process.nextTick = setZeroTimeout; | ||
@@ -19,0 +19,0 @@ process.removeListener = function(ev){ |
@@ -22,9 +22,5 @@ describe('Array', function(){ | ||
var arr = [1,2,3]; | ||
assert(arr.pop() == 5); | ||
assert(arr.pop() == 3); | ||
}) | ||
}) | ||
}) | ||
describe('Array', function(){ | ||
describe('#pop()', function(){ | ||
it('should adjust .length', function(){ | ||
@@ -36,2 +32,2 @@ var arr = [1,2,3]; | ||
}) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
206644
7684
3
+ Addedgrowl@1.4.x
+ Addedgrowl@1.4.1(transitive)