mirror of
https://github.com/maputnik/editor.git
synced 2026-07-12 17:07:28 +00:00
2e0b7cdb8c
## Launch Checklist This PR replaces cypress with playwright. <img width="1907" height="933" alt="image" src="https://github.com/user-attachments/assets/b52075b3-eb3b-45dc-93dc-8c5e9cfd35dd" /> I hope this will make the end-to-end debugging and fixing easier due to the async await support of playwright which is missing in cypress. This is a pure refactoring change. - [x] Briefly describe the changes in this PR. - [x] Add an entry to `CHANGELOG.md` under the `## main` section. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
24 lines
910 B
TypeScript
24 lines
910 B
TypeScript
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { execFileSync } from "node:child_process";
|
|
|
|
/**
|
|
* Merges the per-test istanbul coverage chunks collected in `.nyc_output` into a
|
|
* report (configured by `.nycrc.json`) once the whole e2e run has finished.
|
|
*/
|
|
export default function globalTeardown(): void {
|
|
const dir = path.resolve(process.cwd(), ".nyc_output");
|
|
const hasCoverage = fs.existsSync(dir) && fs.readdirSync(dir).some((f) => f.endsWith(".json"));
|
|
if (!hasCoverage) {
|
|
console.warn("No coverage data collected; skipping coverage report.");
|
|
return;
|
|
}
|
|
try {
|
|
execFileSync("npx", ["nyc", "report"], { stdio: "inherit" });
|
|
} catch (error) {
|
|
// Don't fail the whole run if the report can't be generated (e.g. when
|
|
// running against a container whose source paths differ from the host).
|
|
console.warn("Failed to generate coverage report:", error);
|
|
}
|
|
}
|