当我尝试使用松露运行覆盖范围运行坚固覆盖时,我会收到此错误
我尝试运行实力覆盖范围以进行测试案例及其覆盖范围,但是当我运行覆盖范围时,它的给出错误: - 使用Local Node_modules的Truffle库(Truffle Run Cover)命令(松露运行覆盖范围)
。
固体覆盖范围清理,关闭Ganache服务器 检测到未经手的重新注射 承诺 { TypeError:无法从类未声明的对象中读取私人成员 在__classPrivateFieldget(c:\ users \ rahulmuwal \ downloads \ SmartContract(2)\ SmartContract \ node_modules \ truffle \ node_modules \ node_modules \ node_modules \ ganache \ ganache \ ganache \ dist \ node \ node \ node \ node \ node \ node \ node \ webpack \ core \ core \ core \ core \ lib \ lib \ lib \ src:\ src:\ src:
I try to run solidity coverage for testing test case and its coverage but when I run coverage command its give error like this : -
command used (truffle run coverage)
Using Truffle library from local node_modules.
solidity-coverage cleaning up, shutting down ganache server
UnhandledRejections detected
Promise {
TypeError: Cannot read private member from an object whose class did not declare it
at __classPrivateFieldGet (C:\Users\RahulMuwal\Downloads\smartcontract (2)\smartcontract\node_modules\truffle\node_modules\ganache\dist\node\webpack:\Ganache\core\lib\src\server.js:10:94)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
固体覆盖与Ganache 7的效果不佳,Ganache 7在最新的松露5.4.x中包装。
解决:
YARN ADD -D
(或npm install -save-dev
]
)在工作目录中创建一个名为
.solcover.js
的文件,然后添加此内容(或修改现有内容以包含):可以找到更多信息在这里。
solidity-coverage doesn't work well with ganache 7, which is packaged in latest Truffle 5.4.x.
To resolve:
yarn add -D [email protected]
(ornpm install --save-dev [email protected]
)Create a file called
.solcover.js
in your working directory and add this content (or modify the existing content to include):More info can be found here.
可以确认布朗尼以及
覆盖范围的命令正在闲逛而永无止境
将其降低到Ganache 6(Ganache-Cli)的作品
提到这一点,因为我浪费了很多小时试图弄清楚这一点,并希望这可以节省某人的痛苦
Can confirm this is happening with brownie as well
The coverage command just hangs out and never ends
lowering it to ganache 6 (ganache-cli) works
Mentioning this as I wasted many hours trying to figure this one out and hopefully this saves someone the misery