Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function getSarifReport(browser: puppeteer.Browser, element: React.ReactElement): Promise {
const page = await browser.newPage();
const testHtml = renderTestHtml(element);
await page.setContent(testHtml);
const axeReport = await new AxePuppeteer(page).disableRules(disabledAxeRules).analyze();
const sarifReport = convertAxeToSarif(axeReport);
await page.close();
return sarifReport;
}