codigo0/node_modules/@vitest/coverage-v8/dist/browser.js
planetazuzu 5d7a6500fe refactor: Fase 1 - Clean Architecture, refactorización modular y eliminación de duplicidades
-  Ticket 1.1: Estructura Clean Architecture en backend
-  Ticket 1.2: Schemas Zod compartidos
-  Ticket 1.3: Refactorización drugs.ts (1362 → 8 archivos modulares)
-  Ticket 1.4: Refactorización procedures.ts (3583 → 6 archivos modulares)
-  Ticket 1.5: Eliminación de duplicidades (~50 líneas)

Cambios principales:
- Creada estructura Clean Architecture en backend/src/
- Schemas Zod compartidos en backend/src/shared/schemas/
- Refactorización modular de drugs y procedures
- Utilidades genéricas en src/utils/ (filter, validation)
- Eliminados scripts obsoletos y documentación antigua
- Corregidos errores: QueryClient, import test-error-handling
- Build verificado y funcionando correctamente
2026-01-25 21:09:47 +01:00

59 lines
1.4 KiB
JavaScript

import { cdp } from 'vitest/browser';
import { l as loadProvider } from './load-provider-CdgAx3rL.js';
const session = cdp();
let enabled = false;
const mod = {
async startCoverage() {
if (enabled) {
return;
}
enabled = true;
await session.send("Profiler.enable");
await session.send("Profiler.startPreciseCoverage", {
callCount: true,
detailed: true
});
},
async takeCoverage() {
const coverage = await session.send("Profiler.takePreciseCoverage");
const result = [];
// Reduce amount of data sent over rpc by doing some early result filtering
for (const entry of coverage.result) {
if (filterResult(entry)) {
result.push({
...entry,
url: decodeURIComponent(entry.url.replace(window.location.origin, ""))
});
}
}
return { result };
},
stopCoverage() {
// Browser mode should not stop coverage as same V8 instance is shared between tests
},
async getProvider() {
return loadProvider();
}
};
function filterResult(coverage) {
if (!coverage.url.startsWith(window.location.origin)) {
return false;
}
if (coverage.url.includes("/node_modules/")) {
return false;
}
if (coverage.url.includes("__vitest_browser__")) {
return false;
}
if (coverage.url.includes("__vitest__/assets")) {
return false;
}
if (coverage.url === window.location.href) {
return false;
}
return true;
}
export { mod as default };