Files
SnowLuma/.pnpm-store/v11/files/3a/21c6217f1b7498a893baef375f95ccbd721704bfd8d3a4e16422aafc53025c7ceee66af81d51b48c007f42dc5965017150abd131f825e77697ebcff2d7c16b
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

40 lines
978 B
Plaintext

import { C as COVERAGE_STORE_KEY } from './constants-BCJfMgEg.js';
const mod = {
takeCoverage() {
// @ts-expect-error -- untyped global
return globalThis[COVERAGE_STORE_KEY];
},
startCoverage() {
// @ts-expect-error -- untyped global
const coverageMap = globalThis[COVERAGE_STORE_KEY];
// When isolated, there are no previous results
if (!coverageMap) {
return;
}
for (const filename in coverageMap) {
const branches = coverageMap[filename].b;
for (const key in branches) {
branches[key] = branches[key].map(() => 0);
}
for (const metric of ["f", "s"]) {
const entry = coverageMap[filename][metric];
for (const key in entry) {
entry[key] = 0;
}
}
}
},
async getProvider() {
// to not bundle the provider
const providerPath = "./provider.js";
const { IstanbulCoverageProvider } = await import(
/* @vite-ignore */
providerPath
);
return new IstanbulCoverageProvider();
}
};
export { mod as default };