AngularJS中途测试访问功能不起作用

时间:2014-05-25 13:00:12

标签: angularjs unit-testing coffeescript

我的测试套件:

describe 'test loading page', ->
  tester = undefined
  beforeEach ->
    if tester then tester.destroy
    tester = ngMidwayTester 'angularjsGettingStartedApp'

  it "should defined dubFuntion and evaluate directive", (done) ->
    tester.visit '/superman' , () ->
      expect(1).toEqual(2) 
      done()

结果

Chrome 34.0.1847 (Linux): Executed 0 of 1 SUCCESS (0 secs / 0 secs)
Chrome 34.0.1847 (Linux): Executed 0 of 1 SUCCESS (0 secs / 0 secs)
Chrome 34.0.1847 (Linux): Executed 1 of 1 SUCCESS (0.182 secs / 0.166 secs)
PhantomJS 1.9.7 (Linux): Executed 1 of 1 SUCCESS (0.046 secs / 0.183 secs)
TOTAL: 2 SUCCESS

无论我尝试什么,它总是返回SUCCESS - 似乎访问回调没有被某种原因调用??? ,我用:

"angular": "1.2.15",
"grunt-karma": "^0.8.3",
"karma-chrome-launcher": "^0.1.3",
"karma-jasmine": "^0.1.5",
"karma-ng-scenario": "^0.1.0",
"karma-phantomjs-launcher": "^0.1.4",

1 个答案:

答案 0 :(得分:0)

我不知道为什么" karma-jasmine":" ^ 0.1.5"完成功能缺失,但升级到" karma-jasmine":" ~0.2.0"时,它可以正常工作。