使用业力运行单元测试的错误

时间:2016-04-05 15:33:15

标签: javascript angularjs karma-jasmine

这是我从日志中获得的。请告知如何做。谢谢。 我已经尝试卸载和安装phantomjs,清理我的节点模块和bower组件文件夹。 这一切都在以前工作,这一切都在突然发生。不知道我做了什么打破了事情。

 PhantomJS 2.1.1 (Linux 0.0.0) ERROR
      TypeError: Attempted to assign to readonly property.
      at /home/efremfi/genesis/frontend/bower_components/angular-mocks/angular-mocks.js:17


    PhantomJS 2.1.1 (Linux 0.0.0) ERROR
      ReferenceError: Can't find variable: angular
      at /home/efremfi/genesis/frontend/src/app/administrator/administrator.module.js:9


    Missing error handler on `socket`.
    TypeError: Cannot read property '83501663' of null
        at onBrowserComplete (/home/efremfi/genesis/frontend/node_modules/karma-junit-reporter/index.js:102:23)
        at null.<anonymous> (/home/efremfi/genesis/frontend/node_modules/karma/lib/events.js:13:22)
        at emitTwo (events.js:92:20)
        at emit (events.js:172:7)
        at onComplete (/home/efremfi/genesis/frontend/node_modules/karma/lib/browser.js:142:13)
        at Socket.<anonymous> (/home/efremfi/genesis/frontend/node_modules/karma/lib/events.js:13:22)
        at emitTwo (events.js:92:20)
        at Socket.emit (events.js:172:7)
        at Socket.onevent (/home/efremfi/genesis/frontend/node_modules/karma/node_modules/socket.io/lib/socket.js:335:8)
        at Socket.onpacket (/home/efremfi/genesis/frontend/node_modules/karma/node_modules/socket.io/lib/socket.js:295:12)
        at Client.ondecoded (/home/efremfi/genesis/frontend/node_modules/karma/node_modules/socket.io/lib/client.js:193:14)
        at Decoder.Emitter.emit (/home/efremfi/genesis/frontend/node_modules/karma/node_modules/socket.io/node_modules/socket.io-parser/node_modules/component-emitter/index.js:134:20)
        at Decoder.add (/home/efremfi/genesis/frontend/node_modules/karma/node_modules/socket.io/node_modules/socket.io-parser/index.js:247:12)
        at Client.ondata (/home/efremfi/genesis/frontend/node_modules/karma/node_modules/socket.io/lib/client.js:175:18)
        at emitOne (events.js:77:13)
        at Socket.emit (events.js:169:7)
    [11:29:04] 'test:unit' errored after 1.56 s
    [11:29:04] Error: 1
        at formatError (/usr/lib/node_modules/gulp/bin/gulp.js:169:10)
        at Gulp.<anonymous> (/usr/lib/node_modules/gulp/bin/gulp.js:195:15)
        at emitOne (events.js:77:13)
        at Gulp.emit (events.js:169:7)
        at Gulp.Orchestrator._emitTaskDone (/home/efremfi/genesis/frontend/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
        at /home/efremfi/genesis/frontend/node_modules/gulp/node_modules/orchestrator/index.js:275:23
        at finish (/home/efremfi/genesis/frontend/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
        at cb (/home/efremfi/genesis/frontend/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
        at removeAllListeners (/home/efremfi/genesis/frontend/node_modules/karma/lib/server.js:336:7)
        at Server.<anonymous> (/home/efremfi/genesis/frontend/node_modules/karma/lib/server.js:347:9)
        at Server.g (events.js:260:16)
        at emitNone (events.js:72:20)
        at Server.emit (events.js:166:7)
        at emitCloseNT (net.js:1519:8)
        at nextTickCallbackWith1Arg (node.js:431:9)
        at process._tickCallback (node.js:353:17)

1 个答案:

答案 0 :(得分:0)

也许这有用吗?在角度模拟之前首先加载角度的东西。你检查了你的依赖关系吗?

https://github.com/angular/angular.js/issues/13956