diff --git a/.gitignore b/.gitignore index 11ebfea6..df40ead6 100644 --- a/.gitignore +++ b/.gitignore @@ -133,3 +133,5 @@ dist deployment-zk/* !deployment-zk/lensSepoliaTestnet/ cache_forge/solidity-files-cache.json + +lcov.info diff --git a/coverage.sh b/coverage.sh new file mode 100644 index 00000000..59b9d81a --- /dev/null +++ b/coverage.sh @@ -0,0 +1,4 @@ +rm -fr coverage lcov.info +mkdir -p coverage +forge coverage --report lcov +genhtml --ignore-errors inconsistent --ignore-errors corrupt --ignore-errors category --rc derive_function_end_line=0 lcov.info -o coverage/html --branch-coverage >/dev/null 2>&1 || { echo "Error generating coverage report"; exit 1; } diff --git a/package.json b/package.json index 48809f33..bb3a1615 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,8 @@ "compile": "hardhat compile", "clean": "hardhat clean", "test": "hardhat test --network hardhat", + "coverage": "forge coverage", + "coverage:report": "bash coverage.sh", "prepare": "husky", "format": "forge fmt", "prod:abis": "npm run abis && cp -r out/abis ./ABIs",