hardhat
Version:
Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.
31 lines • 1.01 kB
JavaScript
import { getCoverageManager } from "../helpers.js";
export default async () => ({
onTestRunStart: async (context, id, next) => {
await next(context, id);
await testRunStart(context, id);
},
onTestWorkerDone: async (context, id, next) => {
await next(context, id);
await testWorkerDone(context, id);
},
onTestRunDone: async (context, id, next) => {
await next(context, id);
await testRunDone(context, id);
},
});
export async function testRunStart(context, id) {
if (context.globalOptions.coverage === true) {
await getCoverageManager(context).clearData(id);
}
}
export async function testWorkerDone(context, id) {
if (context.globalOptions.coverage === true) {
await getCoverageManager(context).saveData(id);
}
}
export async function testRunDone(context, id) {
if (context.globalOptions.coverage === true) {
await getCoverageManager(context).report(id);
}
}
//# sourceMappingURL=test.js.map