From 8c3260d4044f789b15900c8518479b8ee32efef3 Mon Sep 17 00:00:00 2001 From: "m1kc (Max Musatov)" Date: Thu, 3 Oct 2013 15:09:53 +0400 Subject: [PATCH] Fix: verbose reporter didn't use its callback to report errors. Code was copied from default.js. --- lib/reporters/verbose.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/reporters/verbose.js b/lib/reporters/verbose.js index 228271b54..ce9490f28 100644 --- a/lib/reporters/verbose.js +++ b/lib/reporters/verbose.js @@ -12,7 +12,7 @@ var nodeunit = require('../nodeunit'), utils = require('../utils'), fs = require('fs'), track = require('../track'), - path = require('path'); + path = require('path'), AssertionError = require('../assert').AssertionError; /** @@ -29,7 +29,7 @@ exports.info = "Verbose tests reporter" * @api public */ -exports.run = function (files, options) { +exports.run = function (files, options, callback) { if (!options) { // load default options @@ -115,6 +115,8 @@ exports.run = function (files, options) { ' assertions (' + assertions.duration + 'ms)' ); } + + if (callback) callback(assertions.failures() ? new Error('We have got test failures.') : undefined); }, testStart: function(name) { tracker.put(name);