spur-common
Version:
Common node library that is implemented through the use of spur-ioc and bluebird promises.
19 lines (14 loc) • 371 B
text/coffeescript
describe "Timer", ->
beforeEach ()->
injector().inject (@Timer)=>
afterEach ()->
it "test timer", ->
clock = sinon.useFakeTimers()
timer = new @Timer().start()
clock.tick(25)
expect(timer.stop()).to.equal 25
clock.restore()
it "mockDuration()", ->
@Timer.mockDuration(22)
expect(new @Timer().start().stop())
.to.equal 22