3
我想用茉莉花&茉莉花jQuery来测试一些JavaScript完成测试CSS转型茉莉花
所以我在功能该位的Javascript
trackTransition =()->
$("#test").on "transitionend MSTransitionEnd webkitTransitionEnd oTransitionEnd",()->
console.log "trans End"
我已经申请了一些在spec.css麦粒肿是添加CSS过渡,并添加一些HTML到夹具,然后在茉莉花规格添加像这样:
describe "Checks when animation finished", ->
beforeEach ->
@trans = spyOnEvent('#test', 'transitionend MSTransitionEnd webkitTransitionEnd oTransitionEnd')
jasmine.Clock.useMock()
trackTransition()
it "Should check when transition ended", ->
expect(@trans).not.toHaveBeenTriggered()
jasmine.Clock.tick(1001)
expect(@trans).toHaveBeenTriggered()
现在我已经测试了这个网页上,并火没有问题,但是在跑步者上失败了,甚至console.log也没有运行。你可以测试过渡吗?
好的,谢谢,tbh它是它触发的函数,但也许我只是单独测试函数。 – 2013-05-03 06:59:14