@codechecks/lighthouse-keeper
Version:
Keep an eye on Google Lighthouse score changes
16 lines • 719 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const client_1 = require("@codechecks/client");
const path_1 = require("path");
const fs = require("fs");
const tmp = require("tmp-promise");
const _1 = require(".");
async function uploadHtmlReport(htmlReport) {
const { path: randomDir } = await tmp.dir();
const outputPath = path_1.join(randomDir, "lighthouse-report.html");
fs.writeFileSync(outputPath, htmlReport);
await client_1.codechecks.saveFile(`${_1.ARTIFACT_ROOT}/report.html`, outputPath);
return client_1.codechecks.getArtifactLink(`${_1.ARTIFACT_ROOT}/report.html`);
}
exports.uploadHtmlReport = uploadHtmlReport;
//# sourceMappingURL=uploadHtmlReport.js.map