HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/node_modules/karma/lib/browser_result.js
'use strict'

class BrowserResult {
  constructor (total = 0) {
    this.startTime = Date.now()

    this.total = total
    this.skipped = this.failed = this.success = 0
    this.netTime = this.totalTime = 0
    this.disconnected = this.error = false
  }

  totalTimeEnd () {
    this.totalTime = Date.now() - this.startTime
  }

  add (result) {
    if (result.skipped) {
      this.skipped++
    } else if (result.success) {
      this.success++
    } else {
      this.failed++
    }

    this.netTime += result.time
  }
}

module.exports = BrowserResult