在流星中安装摩卡后出错



我想对我的软件进行一些测试,所以我按照互联网上的一些教程并找出软件包 实用流星:摩卡.但是在安装软件包并打开本地(不编写任何测试(之后。我收到错误大喊大叫:

socket-stream-client.js:100 Uncaught TypeError: _this._launchConnection is not a function
at new ClientStream (socket-stream-client.js:100)
at new Connection (ddp-client.js:435)
at Object.DDP.connect (ddp-client.js:2340)
at client_convenience.js (ddp-client.js:125)
at fileEvaluate (modules-runtime.js:353)
at require (modules-runtime.js:248)
at client.js (ddp-client.js:54)
at fileEvaluate (modules-runtime.js:353)
at require (modules-runtime.js:248)
at ddp-client.js:2381
ddp.js:14 Uncaught TypeError: Cannot read property 'DDP' of undefined
at ddp.js:14
at ddp.js:23
allow-deny.js:22 Uncaught TypeError: Cannot read property 'DDP' of undefined
at allow-deny.js:22
at allow-deny.js:566
mongo.js:17 Uncaught TypeError: Cannot read property 'AllowDeny' of undefined
at mongo.js:17
at mongo.js:871
accounts-base.js:23 Uncaught TypeError: Cannot read property 'DDP' of undefined
at accounts-base.js:23
at accounts-base.js:1462
service-configuration.js:17 Uncaught TypeError: Cannot read property 'Accounts' of undefined
at service-configuration.js:17
at service-configuration.js:73
accounts-password.js:17 Uncaught TypeError: Cannot read property 'Accounts' of undefined
at accounts-password.js:17
at accounts-password.js:329
accounts-ui-unstyled.js:19 Uncaught TypeError: Cannot read property 'ServiceConfiguration' of undefined
at accounts-ui-unstyled.js:19
at accounts-ui-unstyled.js:2113
meteortoys_toykit.js:26 Uncaught TypeError: Cannot read property 'Mongo' of undefined
at meteortoys_toykit.js:26
at meteortoys_toykit.js:410
msavin_mongol.js:20 Uncaught TypeError: Cannot read property 'Mongo' of undefined
at msavin_mongol.js:20
at msavin_mongol.js:1058
autoupdate.js:20 Uncaught TypeError: Cannot read property 'DDP' of undefined
at autoupdate.js:20
at autoupdate.js:231
practicalmeteor_mocha.js:18 Uncaught TypeError: Cannot read property 'DDP' of undefined
at practicalmeteor_mocha.js:18
at practicalmeteor_mocha.js:13186
livedata.js:14 Uncaught TypeError: Cannot read property 'DDP' of undefined
at livedata.js:14
at livedata.js:27
global-imports.js:3 Uncaught TypeError: Cannot read property 'Mongo' of undefined
at global-imports.js:3
meteor.js:1081 Uncaught Error: Can't find test driver package: practicalmeteor:mocha
at meteor.js:1081
at maybeReady (meteor.js:871)
at HTMLDocument.loadingCompleted (meteor.js:883)

我正在使用流星 1.6.1.1

我会把这个作为一个答案,因为它可能仍然与新用户达到相同点有关。

practialmeteor:mocha是一个推荐的软件包,但不再与 Meteor 兼容>=1.6.1,并且不再维护它的可能性非常高(正如您在他们的开放 gh 问题上看到的那样(。

替代套餐包括

  • cultofcoders:mocha

  • meteortesting:mocha

我也遇到过这样的事情,所以我真的花了一些时间才弄清楚。

根据带有Angular教程的Meteor Todo应用程序,建议使用practicalmeteor:mocha包。有趣的是,meteortesting:mocha用于典型的脚手架项目。

"scripts": {
"start": "meteor run",
"test": "meteor test --once --driver-package meteortesting:mocha",
"test-app": "TEST_WATCH=1 meteor test --full-app --driver-package meteortesting:mocha",
"visualize": "meteor --production --extra-packages bundle-visualizer"
},

但是,仅使用从practicalmeteor:mocha分叉的cultofcoders:mocha才起作用。

meteor remove practicalmeteor:mocha
meteor add cultofcoders:mocha
meteor test --driver-package cultofcoders:mocha

享受编码!

最新更新