differencebetweentimes
Version:
A node package to show the difference between two or more formated times.
25 lines (17 loc) • 770 B
text/coffeescript
assert = require 'assert'
differencebetweentimes = require '../lib/differencebetweentimes'
describe '#convertToTimeString convert timestamp to time string -', ->
time = null
beforeEach ->
time = new Date 0
it 'basic convertion (a complete timestring - with minutes, seconds and milliseconds)', ->
# Setup 01:42.286
time.setMilliseconds('286')
time.setSeconds('42')
time.setMinutes('1')
assert.equal differencebetweentimes.convertToTimeString(time.getTime()), '01:42.286'
it 'convertion short (when timestring have only seconds and milliseconds)', ->
# Setup 46.053
time.setMilliseconds('053')
time.setSeconds('46')
assert.equal differencebetweentimes.convertToTimeString(time.getTime()), '46.053'