From e6ed3088db0e092d0e689e3cd6ba59ca3b504156 Mon Sep 17 00:00:00 2001 From: vicnaum Date: Sat, 11 Jan 2025 22:28:37 +0100 Subject: [PATCH] test: coverage scripts added --- .gitignore | 2 ++ coverage.sh | 4 ++++ package.json | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 coverage.sh 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",