HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/dev/shahnamag/front-end/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