-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
forge coverage
w/ hardhat
#2355
Comments
This is not planned as it increases complexity of coverage a lot - more cases to cover on project structure, coverage would need to be inside of Anvil that would need to generate a seperate report with raw data we could merge into Anvil should be 1:1 with Hardhat node (or close to), so it should be possible to use solidity-coverage (although slower than Anvil) to generate coverage reports for Hardhat projects that use Anvil |
@onbjerg, this issue is related one I wanted to open. We have a hybrid Hardhat/Foundry project and I tried merging the Hardhat and Forge coverage reports: genhtml foundry-lcov.info hardhat-lcov.info -o hybrid-coverage --branch-coverage From what I can tell, they are not compatible. It works for merging multiple Hardhat or Forge coverage reports. The issues I identified:
Is it possible to produce a report that is compatible with Hardhat? |
Try using a merge-specific tool for lcov files such as For the function hits, it's probably because I opted to name them |
Thank you for the feedback and the suggestion, I tested it out. I'm going to document the results here for future reference:
|
Component
Forge
Describe the feature you would like
Given that foundry supports hardhat integration, it would be great if
forge coverage
result was calculated using hardhat js tests as well.Additional context
No response
The text was updated successfully, but these errors were encountered: