@revoloo/cypress6
Version:
Cypress.io end to end testing tool
21 lines (16 loc) • 444 B
JavaScript
import { observable, computed, action } from 'mobx'
import { uniqueId } from 'lodash'
import { durationFormatted } from '../lib/utils'
export default class Timer {
milliseconds
constructor (initialMilliseconds = 0) {
this.milliseconds = initialMilliseconds
this.id = uniqueId()
}
reset () {
this.milliseconds = 0
}
get display () {
return durationFormatted(this.milliseconds)
}
}