Angular JS - Karma测试失败

时间:2013-11-26 15:24:15

标签: javascript angularjs unit-testing karma-runner

我是Angular的新手,我已经开始使用angularjs.org上提供的基本教程了。在运行业力测试时,我遇到了一个问题,下面是我在命令提示符下看到的错误日志。

Chrome 31.0.1650 (Windows 7) myApp.controllers PhoneListCtrl should set the defa
ult value of orderProp model FAILED
        Error: [ng:areq] Argument 'PhoneListCtrl' is not a function, got undefin
ed
        http://errors.angularjs.org/1.2.0-rc.3/ng/areq?p0=PhoneListCtrl&p1=not%2
0a%20function%2C%20got%20undefined
            at C:/Users/sanath.kumar/My Documents/Projects/angular-seed-master/a
pp/lib/angular/angular.js:78:12
            at assertArg (C:/Users/sanath.kumar/My Documents/Projects/angular-se
ed-master/app/lib/angular/angular.js:1246:11)
            at assertArgFn (C:/Users/sanath.kumar/My Documents/Projects/angular-
seed-master/app/lib/angular/angular.js:1256:3)
            at C:/Users/sanath.kumar/My Documents/Projects/angular-seed-master/a
pp/lib/angular/angular.js:5899:9
            at null.<anonymous> (C:/Users/sanath.kumar/My Documents/Projects/ang
ular-seed-master/test/unit/controllersSpec.js:51:14)
            at Object.invoke (C:/Users/sanath.kumar/My Documents/Projects/angula
r-seed-master/app/lib/angular/angular.js:3374:28)
            at workFn (C:/Users/sanath.kumar/My Documents/Projects/angular-seed-
master/test/lib/angular/angular-mocks.js:2082:20)
        Expected undefined to be 'age'.
        Error: Expected undefined to be 'age'.
            at null.<anonymous> (C:/Users/sanath.kumar/My Documents/Projects/ang
ular-seed-master/test/unit/controllersSpec.js:61:27)
Chrome 31.0.1650 (Windows 7): Executed 5 of 5 (2 FAILED) (0.364 secs / 0.047 sec
Chrome 31.0.1650 (Windows 7): Executed 5 of 5 (2 FAILED) (0.364 secs / 0.047 sec
Chrome 31.0.1650 (Windows 7): Executed 5 of 5 (2 FAILED) (0.364 secs / 0.047 sec
Chrome 31.0.1650 (Windows 7): Executed 5 of 5 (2 FAILED) (0.364 secs / 0.047 sec
Chrome 31.0.1650 (Windows 7): Executed 5 of 5 (2 FAILED) (0.364 secs / 0.047 sec
s)
Chrome 31.0.1650 (Windows 7): Executed 5 of 5 (2 FAILED) (0.412 secs / 0.062 sec
s)
TOTAL: 4 FAILED, 6 SUCCESS

非常感谢任何帮助。 提前致谢

0 个答案:

没有答案