Skip to content

Commit 2dd0863

Browse files
authored
Added hardhat test coverage for all tests (#146)
* added scalable hardhat test coverage * added new tests for liqudidty hub * refactor review * restored scripts * fixed code review comments * fixed review v2 * fixed lint issues
1 parent 188f368 commit 2dd0863

File tree

5 files changed

+508
-129
lines changed

5 files changed

+508
-129
lines changed

.solcover.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module.exports = {
2+
skipFiles: [
3+
// Skip test contracts
4+
"testing/",
5+
6+
// Skip echidna/fuzzing contracts
7+
"echidna/",
8+
9+
// Skip utility contracts that are only used for deployment
10+
"utils/PushNativeToken.sol",
11+
12+
// Skip dependencies
13+
"Deps.sol",
14+
],
15+
16+
// Automatically include all test files (scalable approach)
17+
// testfiles: "./test/**/*.ts" - would include all, but we exclude helpers
18+
// For maximum flexibility, remove testfiles entirely to run all tests
19+
// Or use glob pattern to include specific patterns
20+
21+
// Measure coverage for statements, branches, functions, and lines
22+
measureStatementCoverage: true,
23+
measureFunctionCoverage: true,
24+
measureBranchCoverage: true,
25+
measureLineCoverage: true,
26+
27+
// Optionally configure which networks to use for coverage
28+
// providerOptions: {
29+
// default_balance_ether: '10000000000000000000000000',
30+
// },
31+
32+
// Optionally set which mocha reporter to use
33+
mocha: {
34+
grep: "@skip-on-coverage", // Filter describe/it with this comment
35+
invert: true // Run everything except those with @skip-on-coverage
36+
},
37+
38+
// Configure Istanbul (the underlying coverage tool)
39+
istanbulReporter: ["html", "lcov", "text", "json"],
40+
};

hardhat.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
DEFAULT_ADMIN_ROLE, assertAddress,
1313
} from "./scripts/common";
1414
import "hardhat-ignore-warnings";
15+
import "solidity-coverage";
1516

1617
import dotenv from "dotenv";
1718
dotenv.config();

0 commit comments

Comments
 (0)