gpt4 book ai didi

javascript - 使用 karma 运行单元测试时出错

转载 作者:行者123 更新时间:2023-11-28 06:10:42 26 4
gpt4 key购买 nike

这是我从日志中得到的信息。请建议该怎么做。谢谢。我尝试卸载并安装 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)

最佳答案

也许这有帮助?在 Angular 模拟之前首先加载 Angular 。你检查过你的依赖关系吗?

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

关于javascript - 使用 karma 运行单元测试时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36430844/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com