Skip to content

Commit

Permalink
Release 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Dec 15, 2011
1 parent 0e1f0cd commit 25e08e0
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 8 deletions.
8 changes: 8 additions & 0 deletions History.md
@@ -1,4 +1,12 @@

0.5.0 / 2011-12-14
==================

* Added: push node_modules directory onto module.paths for relative require Closes #93
* Added teamcity reporter [blindsey]
* Fixed: recover from uncaught exceptions for tests. Closes #94
* Fixed: only emit "test end" for uncaught within test, not hook

0.4.0 / 2011-12-14
==================

Expand Down
2 changes: 1 addition & 1 deletion lib/mocha.js
Expand Up @@ -9,7 +9,7 @@
* Library version.
*/

exports.version = '0.4.0';
exports.version = '0.5.0';

exports.interfaces = require('./interfaces');
exports.reporters = require('./reporters');
Expand Down
67 changes: 61 additions & 6 deletions mocha.js
Expand Up @@ -688,7 +688,7 @@ require.register("mocha.js", function(module, exports, require){
* Library version.
*/

exports.version = '0.4.0';
exports.version = '0.5.0';

exports.interfaces = require('./interfaces');
exports.reporters = require('./reporters');
Expand Down Expand Up @@ -1773,6 +1773,51 @@ function title(test) {

}); // module: reporters/tap.js

require.register("reporters/teamcity.js", function(module, exports, require){

/**
* Module dependencies.
*/

var Base = require('./base');

/**
* Expose `Teamcity`.
*/

exports = module.exports = Teamcity;

function Teamcity(runner) {
Base.call(this, runner);
var stats = this.stats;

runner.on('start', function() {
console.log("##teamcity[testSuiteStarted name='mocha.suite']");
});

runner.on('test', function(test) {
console.log("##teamcity[testStarted name='%s']", test.fullTitle());
});

runner.on('fail', function(test, err) {
console.log("##teamcity[testFailed name='%s' message='%s']", test.fullTitle(), err.message);
});

runner.on('pending', function(test) {
console.log("##teamcity[testIgnored name='%s' message='pending']", test.fullTitle());
});

runner.on('test end', function(test) {
console.log("##teamcity[testFinished name='%s' duration='%s']", test.fullTitle(), test.duration);
});

runner.on('end', function() {
console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']", stats.duration);
});
}

}); // module: reporters/teamcity.js

require.register("runnable.js", function(module, exports, require){

/**
Expand Down Expand Up @@ -2253,14 +2298,15 @@ Runner.prototype.runTests = function(suite, fn){
return self.hookUp('afterEach', next);
}

self.emit('pass', test);
test.passed = true;
self.emit('pass', test);
self.emit('test end', test);
self.hookUp('afterEach', next);
});
});
}

this.next = next;
next();
};

Expand Down Expand Up @@ -2330,11 +2376,19 @@ Runner.prototype.run = function(fn){

// uncaught exception
function uncaught(err){
var runnable = self.currentRunnable;
debug('uncaught exception');
self.currentRunnable.clearTimeout();
self.fail(self.currentRunnable, err);
self.emit('test end', self.test);
self.emit('end');
runnable.clearTimeout();
self.fail(runnable, err);

// recover from test
if ('test' == runnable.type) {
self.emit('test end', runnable);
self.hookUp('afterEach', self.next);
// bail on hooks
} else {
self.emit('end');
}
}

process.on('uncaughtException', uncaught);
Expand Down Expand Up @@ -2594,6 +2648,7 @@ module.exports = Test;
function Test(title, fn) {
Runnable.call(this, title, fn);
this.pending = !fn;
this.type = 'test';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "mocha"
, "version": "0.4.0"
, "version": "0.5.0"
, "description": "Test framework inspired by JSpec, Expresso, & Qunit"
, "keywords": ["test", "bdd", "tdd", "tap"]
, "bin": { "mocha": "./bin/mocha" }
Expand Down

0 comments on commit 25e08e0

Please sign in to comment.