Files
upstream-jitsi-meet/tests/prosody/fix-allure-report.cjs
upstream-mirror 1d2bfcac0c
Some checks failed
Prosody Plugin Tests / test (push) Failing after 10m11s
Close stale issues and PRs / stale (push) Failing after 1s
snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
2026-09-15 15:56:32 +05:00

21 lines
767 B
JavaScript

// Post-process the generated Allure report to set default sort order to
// "order" (the order tests ran) instead of alphabetical. Mirrors the same
// hack used in tests/wdio.conf.ts.
'use strict';
const fs = require('fs');
const path = require('path');
const indexFile = path.join(__dirname, 'allure-report', 'index.html');
if (!fs.existsSync(indexFile)) {
console.warn('fix-allure-report: index.html not found, skipping');
process.exit(0);
}
const setting = '{"treeSorting":{"sorter":"sorter.order","ascending":true}}';
const script = `<script>localStorage.setItem("ALLURE_REPORT_SETTINGS_SUITES", '${setting}');</script>`;
const content = fs.readFileSync(indexFile, 'utf8');
fs.writeFileSync(indexFile, content.replace('<body>', `<body>${script}`));