1
0
mirror of https://github.com/morris/vanilla-todo.git synced 2025-08-20 12:51:43 +02:00

combine unit and e2e coverage, simplify test scripts

This commit is contained in:
Morris Brodersen
2024-01-29 23:52:14 +01:00
parent 9991ec23b1
commit dd29d07d31
6 changed files with 81 additions and 38 deletions

View File

@@ -5,7 +5,7 @@ import { test } from 'playwright/test';
// See also https://playwright.dev/docs/api/class-coverage
if (process.env.COVERAGE) {
if (process.env.NODE_V8_COVERAGE) {
test.beforeEach(async ({ page }) => {
await page.coverage.startJSCoverage();
});
@@ -20,9 +20,9 @@ if (process.env.COVERAGE) {
})),
};
await fs.mkdir('coverage/tmp', { recursive: true });
await fs.mkdir(process.env.NODE_V8_COVERAGE, { recursive: true });
await fs.writeFile(
`coverage/tmp/coverage-${randomUUID()}.json`,
path.join(process.env.NODE_V8_COVERAGE, `coverage-${randomUUID()}.json`),
JSON.stringify(output),
);
});