hardhat 3.1.2 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/src/internal/builtin-plugins/coverage/coverage-manager.d.ts +14 -14
- package/dist/src/internal/builtin-plugins/coverage/coverage-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/coverage-manager.js +66 -110
- package/dist/src/internal/builtin-plugins/coverage/coverage-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js +13 -6
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/process-coverage.d.ts +21 -0
- package/dist/src/internal/builtin-plugins/coverage/process-coverage.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/process-coverage.js +291 -0
- package/dist/src/internal/builtin-plugins/coverage/process-coverage.js.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/reports/html.d.ts +3 -0
- package/dist/src/internal/builtin-plugins/coverage/reports/html.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/reports/html.js +37 -0
- package/dist/src/internal/builtin-plugins/coverage/reports/html.js.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/types.d.ts +9 -3
- package/dist/src/internal/builtin-plugins/coverage/types.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/config-resolution.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.js +26 -25
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-info.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-info.js +3 -0
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-info.js.map +1 -1
- package/dist/src/internal/builtin-plugins/test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/test/task-action.js +53 -53
- package/dist/src/internal/builtin-plugins/test/task-action.js.map +1 -1
- package/package.json +3 -2
- package/src/internal/builtin-plugins/coverage/coverage-manager.ts +121 -176
- package/src/internal/builtin-plugins/coverage/hook-handlers/solidity.ts +19 -8
- package/src/internal/builtin-plugins/coverage/process-coverage.ts +442 -0
- package/src/internal/builtin-plugins/coverage/reports/html.ts +56 -0
- package/src/internal/builtin-plugins/coverage/types.ts +8 -3
- package/src/internal/builtin-plugins/network-manager/config-resolution.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.ts +40 -26
- package/src/internal/builtin-plugins/solidity/build-system/solc-info.ts +3 -0
- package/src/internal/builtin-plugins/test/task-action.ts +63 -66
- package/templates/hardhat-3/01-node-test-runner-viem/package.json +1 -1
- package/templates/hardhat-3/02-mocha-ethers/package.json +4 -4
- package/templates/hardhat-3/03-minimal/package.json +1 -1
|
@@ -52,20 +52,16 @@ const runAllTests: NewTaskActionFunction<TestActionArguments> = async (
|
|
|
52
52
|
const testSummaries: Record<
|
|
53
53
|
string,
|
|
54
54
|
{
|
|
55
|
-
failed
|
|
56
|
-
passed
|
|
57
|
-
skipped
|
|
58
|
-
todo
|
|
59
|
-
failureOutput
|
|
55
|
+
failed?: number;
|
|
56
|
+
passed?: number;
|
|
57
|
+
skipped?: number;
|
|
58
|
+
todo?: number;
|
|
59
|
+
failureOutput?: string;
|
|
60
60
|
}
|
|
61
61
|
> = {};
|
|
62
62
|
|
|
63
63
|
let failureIndex = 1;
|
|
64
|
-
const
|
|
65
|
-
const hasMocha = subtasks.some(
|
|
66
|
-
(subtask) => subtask.id[subtask.id.length - 1] === "mocha",
|
|
67
|
-
);
|
|
68
|
-
for (const subtask of subtasks) {
|
|
64
|
+
for (const subtask of thisTask.subtasks.values()) {
|
|
69
65
|
const files = getTestFilesForSubtask(subtask, testFiles, subtasksToFiles);
|
|
70
66
|
|
|
71
67
|
if (files === undefined) {
|
|
@@ -88,86 +84,87 @@ const runAllTests: NewTaskActionFunction<TestActionArguments> = async (
|
|
|
88
84
|
args.verbosity = verbosity;
|
|
89
85
|
}
|
|
90
86
|
|
|
91
|
-
|
|
92
|
-
args.testSummaryIndex = failureIndex;
|
|
87
|
+
const summaryId = subtask.id[subtask.id.length - 1];
|
|
93
88
|
|
|
94
|
-
|
|
89
|
+
if (subtask.options.has("testSummaryIndex")) {
|
|
90
|
+
args.testSummaryIndex = failureIndex;
|
|
95
91
|
|
|
96
92
|
testSummaries[summaryId] = await subtask.run(args);
|
|
97
93
|
failureIndex += testSummaries[summaryId].failed ?? 0;
|
|
94
|
+
} else if (summaryId === "mocha") {
|
|
95
|
+
// mocha doesn't use the testSummaryIndex, but it does return failure & success counts
|
|
96
|
+
testSummaries[summaryId] = await subtask.run(args);
|
|
98
97
|
} else {
|
|
99
98
|
await subtask.run(args);
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
101
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const outputLines: string[] = [];
|
|
102
|
+
const passed: Array<[string, number]> = [];
|
|
103
|
+
const failed: Array<[string, number]> = [];
|
|
104
|
+
const skipped: Array<[string, number]> = [];
|
|
105
|
+
const todo: Array<[string, number]> = [];
|
|
106
|
+
const outputLines: string[] = [];
|
|
109
107
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
for (const [subtaskName, results] of Object.entries(testSummaries)) {
|
|
109
|
+
if (results.passed !== undefined && results.passed > 0) {
|
|
110
|
+
passed.push([subtaskName, results.passed]);
|
|
111
|
+
}
|
|
114
112
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
if (results.failed !== undefined && results.failed > 0) {
|
|
114
|
+
failed.push([subtaskName, results.failed]);
|
|
115
|
+
}
|
|
118
116
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
if (results.skipped !== undefined && results.skipped > 0) {
|
|
118
|
+
skipped.push([subtaskName, results.skipped]);
|
|
119
|
+
}
|
|
122
120
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
if (results.todo !== undefined && results.todo > 0) {
|
|
122
|
+
todo.push([subtaskName, results.todo]);
|
|
123
|
+
}
|
|
126
124
|
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
if (results.failureOutput !== undefined && results.failureOutput !== "") {
|
|
126
|
+
const output = results.failureOutput;
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
128
|
+
if (subtaskName.includes("node")) {
|
|
129
|
+
outputLines.push(`\n${output}\n`);
|
|
130
|
+
} else {
|
|
131
|
+
outputLines.push(output);
|
|
135
132
|
}
|
|
136
133
|
}
|
|
134
|
+
}
|
|
137
135
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (failed.length > 0) {
|
|
143
|
-
logSummaryLine("failing", failed, chalk.red);
|
|
144
|
-
}
|
|
136
|
+
if (passed.length > 0) {
|
|
137
|
+
logSummaryLine("passing", passed, chalk.green);
|
|
138
|
+
}
|
|
145
139
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
140
|
+
if (failed.length > 0) {
|
|
141
|
+
logSummaryLine("failing", failed, chalk.red);
|
|
142
|
+
}
|
|
149
143
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
144
|
+
if (skipped.length > 0) {
|
|
145
|
+
logSummaryLine("skipped", skipped, chalk.cyan);
|
|
146
|
+
}
|
|
153
147
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
.map((o) => {
|
|
158
|
-
const nl = o.match(/\n+$/gm);
|
|
159
|
-
if (nl !== null) {
|
|
160
|
-
return o.replace(new RegExp(`${nl[0]}$`), "\n");
|
|
161
|
-
}
|
|
162
|
-
return o;
|
|
163
|
-
})
|
|
164
|
-
.join("\n"),
|
|
165
|
-
);
|
|
166
|
-
}
|
|
148
|
+
if (todo.length > 0) {
|
|
149
|
+
logSummaryLine("todo", todo, chalk.blue);
|
|
150
|
+
}
|
|
167
151
|
|
|
168
|
-
|
|
152
|
+
if (outputLines.length > 0) {
|
|
153
|
+
console.log(
|
|
154
|
+
outputLines
|
|
155
|
+
.map((o) => {
|
|
156
|
+
const nl = o.match(/\n+$/gm);
|
|
157
|
+
if (nl !== null) {
|
|
158
|
+
return o.replace(new RegExp(`${nl[0]}$`), "\n");
|
|
159
|
+
}
|
|
160
|
+
return o;
|
|
161
|
+
})
|
|
162
|
+
.join("\n"),
|
|
163
|
+
);
|
|
169
164
|
}
|
|
170
165
|
|
|
166
|
+
console.log();
|
|
167
|
+
|
|
171
168
|
if (hre.globalOptions.coverage === true) {
|
|
172
169
|
assertHardhatInvariant(
|
|
173
170
|
hre instanceof HardhatRuntimeEnvironmentImplementation,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"description": "A TypeScript Hardhat project using Node Test Runner and Viem",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"hardhat": "workspace:^3.1.
|
|
8
|
+
"hardhat": "workspace:^3.1.4",
|
|
9
9
|
"@nomicfoundation/hardhat-toolbox-viem": "workspace:^5.0.1",
|
|
10
10
|
"@nomicfoundation/hardhat-ignition": "workspace:^3.0.6",
|
|
11
11
|
"@types/node": "^22.8.5",
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"description": "A TypeScript Hardhat project using Mocha and Ethers.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"hardhat": "workspace:^3.1.
|
|
8
|
+
"hardhat": "workspace:^3.1.4",
|
|
9
9
|
"@nomicfoundation/hardhat-toolbox-mocha-ethers": "workspace:^3.0.2",
|
|
10
|
-
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.
|
|
10
|
+
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.4",
|
|
11
11
|
"@nomicfoundation/hardhat-ignition": "workspace:^3.0.6",
|
|
12
12
|
"@types/chai": "^4.2.0",
|
|
13
13
|
"@types/chai-as-promised": "^8.0.1",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"typescript": "~5.8.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.
|
|
23
|
+
"@nomicfoundation/hardhat-ethers": "workspace:^4.0.4",
|
|
24
24
|
"@nomicfoundation/hardhat-ethers-chai-matchers": "workspace:^3.0.2",
|
|
25
25
|
"@nomicfoundation/hardhat-ignition": "workspace:^3.0.6",
|
|
26
26
|
"@nomicfoundation/hardhat-ignition-ethers": "workspace:^3.0.6",
|
|
27
27
|
"@nomicfoundation/hardhat-keystore": "workspace:^3.0.2",
|
|
28
|
-
"@nomicfoundation/hardhat-mocha": "workspace:^3.0.
|
|
28
|
+
"@nomicfoundation/hardhat-mocha": "workspace:^3.0.9",
|
|
29
29
|
"@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.3",
|
|
30
30
|
"@nomicfoundation/hardhat-typechain": "workspace:^3.0.0",
|
|
31
31
|
"@nomicfoundation/hardhat-verify": "workspace:^3.0.8",
|