Skip to content

Commit

Permalink
include test filename in some error reports
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Feb 21, 2011
1 parent 1ddf5b1 commit 332b522
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/vows
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ if (args.length === 0 || options.watch) {
}

if (! options.watch) {
reporter.report = function (data) {
reporter.report = function (data, filename) {
switch (data[0]) {
case 'subject':
case 'vow':
case 'context':
case 'error':
_reporter.report(data);
_reporter.report(data, filename);
break;
case 'end':
(options.verbose || _reporter.name === 'json') && _reporter.report(data);
Expand All @@ -186,6 +186,7 @@ if (! options.watch) {
}
};
reporter.reset = function () { _reporter.reset && _reporter.reset() };
reporter.print = _reporter.print;

files = args.map(function (a) {
return path.join(process.cwd(), a.replace(fileExt, ''));
Expand Down Expand Up @@ -360,6 +361,7 @@ function importSuites(files) {
return files.reduce(function (suites, f) {
var obj = require(f);
return suites.concat(Object.keys(obj).map(function (s) {
obj[s]._filename = f.replace(process.cwd() + '/', '') + '.js';
return obj[s];
}));
}, [])
Expand Down

0 comments on commit 332b522

Please sign in to comment.