UNPKG

518 BJavaScriptView Raw
1var Result = function () {
2 var startTime = Date.now()
3
4 this.total = this.skipped = this.failed = this.success = 0
5 this.netTime = this.totalTime = 0
6 this.disconnected = this.error = false
7
8 this.totalTimeEnd = function () {
9 this.totalTime = Date.now() - startTime
10 }
11
12 this.add = function (result) {
13 if (result.skipped) {
14 this.skipped++
15 } else if (result.success) {
16 this.success++
17 } else {
18 this.failed++
19 }
20
21 this.netTime += result.time
22 }
23}
24
25module.exports = Result