【问题标题】:AngularJS midway testing visit function not workingAngularJS中途测试访问功能不起作用
【发布时间】:2014-05-25 13:00:11
【问题描述】:

我的测试套件:

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",

【问题讨论】:

    标签: angularjs unit-testing coffeescript


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2013-05-29
      • 1970-01-01
      • 2017-07-13
      • 1970-01-01
      • 1970-01-01
      • 2016-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多