2013-02-07 34 views
0

我做了以下测试。CoffeeScript中的BusterJs测试

assert = buster.assert 
buster.testCase 'BaseChart', 

    before: -> 
    @el = sinon.spy() 
    @$el = [@el] 
    console.log(@$el) 
    ##[LOG] [function spy() {}] 

    'updates when the model changed': -> 
    console.log(@$el) 
    ##[LOG] undefined 
+0

在''之前''里面有'@'和''模型改变'时更新'? –

+0

这似乎是一个克星测试案例。 –

+0

哟@AndreasKöberle你可以标记这个答案 – jcollum

回答

1

这是胡乱猜测,但变化:

before: ->before: =>

,看看有没有帮助出于某种原因,我@$e在函数之前的测试是未定义已经设置。

相关问题