Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / karma / lib / reporters / dots.js
1 var BaseReporter = require('./base')
2
3 var DotsReporter = function (formatError, reportSlow) {
4   BaseReporter.call(this, formatError, reportSlow)
5
6   var DOTS_WRAP = 80
7
8   this.onRunStart = function () {
9     this._browsers = []
10     this._dotsCount = 0
11   }
12
13   this.onBrowserStart = function (browser) {
14     this._browsers.push(browser)
15   }
16
17   this.writeCommonMsg = function (msg) {
18     if (this._dotsCount) {
19       this._dotsCount = 0
20       msg = '\n' + msg
21     }
22
23     this.write(msg)
24
25   }
26
27   this.specSuccess = function () {
28     this._dotsCount = (this._dotsCount + 1) % DOTS_WRAP
29     this.write(this._dotsCount ? '.' : '.\n')
30   }
31
32   this.onBrowserComplete = function (browser) {
33     this.writeCommonMsg(this.renderBrowser(browser) + '\n')
34   }
35
36   this.onRunComplete = function (browsers, results) {
37     if (browsers.length > 1 && !results.disconnected && !results.error) {
38       if (!results.failed) {
39         this.write(this.TOTAL_SUCCESS, results.success)
40       } else {
41         this.write(this.TOTAL_FAILED, results.failed, results.success)
42       }
43     }
44   }
45 }
46
47 // PUBLISH
48 module.exports = DotsReporter