Skip to content

Commit 332b522

Browse files
committed
include test filename in some error reports
1 parent 1ddf5b1 commit 332b522

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/vows

+4-2
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,13 @@ if (args.length === 0 || options.watch) {
169169
}
170170

171171
if (! options.watch) {
172-
reporter.report = function (data) {
172+
reporter.report = function (data, filename) {
173173
switch (data[0]) {
174174
case 'subject':
175175
case 'vow':
176176
case 'context':
177177
case 'error':
178-
_reporter.report(data);
178+
_reporter.report(data, filename);
179179
break;
180180
case 'end':
181181
(options.verbose || _reporter.name === 'json') && _reporter.report(data);
@@ -186,6 +186,7 @@ if (! options.watch) {
186186
}
187187
};
188188
reporter.reset = function () { _reporter.reset && _reporter.reset() };
189+
reporter.print = _reporter.print;
189190

190191
files = args.map(function (a) {
191192
return path.join(process.cwd(), a.replace(fileExt, ''));
@@ -360,6 +361,7 @@ function importSuites(files) {
360361
return files.reduce(function (suites, f) {
361362
var obj = require(f);
362363
return suites.concat(Object.keys(obj).map(function (s) {
364+
obj[s]._filename = f.replace(process.cwd() + '/', '') + '.js';
363365
return obj[s];
364366
}));
365367
}, [])

0 commit comments

Comments
 (0)