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

Bug 986206 - Report filenames on test failures r=jgriffin #6

Merged
merged 1 commit into from Mar 28, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tbpl.js
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
@@ -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
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