1 var BaseReporter = require('./base')
3 var ProgressReporter = function (formatError, reportSlow) {
4 BaseReporter.call(this, formatError, reportSlow)
6 this.writeCommonMsg = function (msg) {
7 this.write(this._remove() + msg + this._render())
10 this.specSuccess = function () {
11 this.write(this._refresh())
14 this.onBrowserComplete = function () {
15 this.write(this._refresh())
18 this.onRunStart = function () {
20 this._isRendered = false
23 this.onBrowserStart = function (browser) {
24 this._browsers.push(browser)
26 if (this._isRendered) {
30 this.write(this._refresh())
33 this._remove = function () {
34 if (!this._isRendered) {
39 this._browsers.forEach(function () {
40 cmd += '\x1B[1A' + '\x1B[2K'
43 this._isRendered = false
48 this._render = function () {
49 this._isRendered = true
51 return this._browsers.map(this.renderBrowser).join('\n') + '\n'
54 this._refresh = function () {
55 return this._remove() + this._render()
60 module.exports = ProgressReporter