Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6 from gaye/bug-986206
Browse files Browse the repository at this point in the history
Bug 986206 - Report filenames on test failures r=jgriffin
  • Loading branch information
Gareth Aye committed Mar 28, 2014
2 parents d768822 + fa8d346 commit b0dd220
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/tbpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ TBPL.prototype = {
*/
onFail: function(test, err) {
var title = this.getTitle(test);
console.log('TEST-UNEXPECTED-FAIL | %s', title);
console.log('TEST-UNEXPECTED-FAIL | %s | %s', test.file, title);
this.failing += 1;
},

Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"name": "mocha-tbpl-reporter",
"version": "0.0.7",

"author": "Gareth Aye <gaye@mozilla.com>",
"version": "0.1.0",
"author": "The Gaia Team <dev-gaia@lists.mozilla.org>",
"description": "Mocha reporter for TBPL (tinderboxpushlog)",
"license": "MIT",

"dependencies": {
"mocha": "1.12.0"
"mocha": "git://github.com/visionmedia/mocha.git#64396afeefe0927e2ba4bf588642372421b81ed5"
},

"peerDependencies": {
"mocha": ">=1.18.2"
},

"devDependencies": {
Expand All @@ -25,7 +28,7 @@

"repository": {
"type": "git",
"url": "https://github.com/mozilla-b2g/mocha-tbpl-reporter.git"
"url": "git://github.com/mozilla-b2g/mocha-tbpl-reporter.git"
},

"scripts": {
Expand Down
8 changes: 7 additions & 1 deletion test/tbpl_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,20 @@ suite('TBPL', function() {

test('#onFail', function() {
var failing = subject.failing;
var file = 'doge_such_broke_test.js';
subject.onFail({
file: file,
fullTitle: function() {
return 'some title';
}
});

assert.strictEqual(subject.failing, failing + 1);
assert.ok(log.calledWith('TEST-UNEXPECTED-FAIL | %s', 'some title'));
assert.ok(log.calledWith(
'TEST-UNEXPECTED-FAIL | %s | %s',
file,
'some title'
));
});

test('#onPass', function() {
Expand Down

0 comments on commit b0dd220

Please sign in to comment.