source: trip-planner-front/node_modules/karma/lib/reporters/dots.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1const BaseReporter = require('./base')
2
3function DotsReporter (formatError, reportSlow, useColors, browserConsoleLogOptions) {
4 BaseReporter.call(this, formatError, reportSlow, useColors, browserConsoleLogOptions)
5
6 const DOTS_WRAP = 80
7 this.EXCLUSIVELY_USE_COLORS = false
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 this.specSuccess = function () {
27 this._dotsCount = (this._dotsCount + 1) % DOTS_WRAP
28 this.write(this._dotsCount ? '.' : '.\n')
29 }
30
31 this.onBrowserComplete = function (browser) {
32 this.writeCommonMsg(this.renderBrowser(browser) + '\n')
33 }
34
35 this.onRunComplete = function (browsers, results) {
36 if (browsers.length > 1 && !results.disconnected && !results.error) {
37 if (!results.failed) {
38 this.write(this.TOTAL_SUCCESS, results.success)
39 } else {
40 this.write(this.TOTAL_FAILED, results.failed, results.success)
41 }
42 }
43 }
44}
45
46// PUBLISH
47module.exports = DotsReporter
Note: See TracBrowser for help on using the repository browser.