Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the API is working but the coverage is always zero. Did I use it right? #736

Closed
k1nh00 opened this issue Aug 27, 2022 · 2 comments
Closed

Comments

@k1nh00
Copy link

k1nh00 commented Aug 27, 2022

hi, I am a user of solidity coverage API. I wrote a node file to collect the coverage of my tests with the methods provided in the API documentation. the code can run smoothly but no coverge is collected. Did I write a wrong logic?

Js

I output the instrumented contract to another file. I started the server and make it serving for 7 seconds to run the tests(triggered by a child process). In the test JS file, the instrumented contract is compiled and the contract is deployed, two transactions are sent. see below:
testJS

but the coverage is always zero. I am so confused. HELP ME WITH IT, PLZ.
the result of code running:
run Result

@k1nh00
Copy link
Author

k1nh00 commented Aug 27, 2022

The instrumented contract is compiled with optimizer off for sure, of course. And the client is a ganache-cli instance.

@cgewecke
Copy link
Member

solidity-coverage is no longer supporting ganache-cli. A link to an example of a recent usage of the API can be found here:

#798 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants