]> git.wincent.com - hextrapolate.git/blob - mocha/watch-reporter.js
eb689961c1f4c6149f4125f5b2712745096e1adf
[hextrapolate.git] / mocha / watch-reporter.js
1 /**
2  * Copyright 2003-present Greg Hurrell. All rights reserved.
3  * Licensed under the terms of the MIT license.
4  */
5
6 var Base = require('mocha').reporters.Base;
7
8 /**
9  * Like the "min" reporter that comes with Mocha[0], but doesn't clear the
10  * screen.
11  *
12  * @see https://github.com/mochajs/mocha/blob/master/lib/reporters/min.js
13  * @see https://github.com/mochajs/mocha/wiki/Third-party-reporters
14  */
15 function WatchReporter(runner) {
16   var self = this;
17   Base.call(this, runner);
18   runner.on('end', function() {
19     if (this.stats.failures) {
20       Base.prototype.epilogue.call(self);
21     }
22   });
23 }
24
25 module.exports = WatchReporter;