当我尝试使用松露运行覆盖范围运行坚固覆盖时,我会收到此错误

发布于 2025-01-25 20:42:22 字数 553 浏览 2 评论 0原文

我尝试运行实力覆盖范围以进行测试案例及其覆盖范围,但是当我运行覆盖范围时,它的给出错误: - 使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

叫嚣ゝ 2025-02-01 20:42:23

固体覆盖与Ganache 7的效果不佳,Ganache 7在最新的松露5.4.x中包装。

解决:

  1. YARN ADD -D (或npm install -save-dev]

  2. 在工作目录中创建一个名为.solcover.js的文件,然后添加此内容(或修改现有内容以包含):

      module.exports = {
      客户:require('ganache-cli'),
    };
     

可以找到更多信息在这里

solidity-coverage doesn't work well with ganache 7, which is packaged in latest Truffle 5.4.x.

To resolve:

  1. yarn add -D [email protected] (or npm install --save-dev [email protected])

  2. Create a file called .solcover.js in your working directory and add this content (or modify the existing content to include):

    module.exports = {
      client: require('ganache-cli'),
    };
    

More info can be found here.

绿光 2025-02-01 20:42:23

可以确认布朗尼以及

覆盖范围的命令正在闲逛而永无止境
将其降低到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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文