Skip to content

Commit

Permalink
chore: fix type errors and update pw dep to 1.45.0
Browse files Browse the repository at this point in the history
  • Loading branch information
radekBednarik committed Jun 25, 2024
1 parent 3022773 commit 80a2dc7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ declare module 'axe-core' {
* @param page
*/
export const injectAxe = async (page: Page): Promise<void> => {
const axe: string = fs.readFileSync(
require.resolve('axe-core/axe.min.js'),
'utf8',
)
const axe: string = fs.readFileSync(require.resolve('axe-core/axe.min.js'), {
encoding: 'utf8',
})
await page.evaluate((axe: string) => window.eval(axe), axe)
}

Expand Down Expand Up @@ -70,7 +69,7 @@ export const getAxeResults = async (
[context, options],
)

return result
return result as Promise<AxeResults>
}

/**
Expand Down Expand Up @@ -143,14 +142,14 @@ export const checkA11y = async (
} else console.log('There were no violations to save in report')
} else if (reporter === 'junit') {
// Get the system root directory
// Construct the file path
// Construct the file path
const outputFilePath = path.join(
process.cwd(),
options?.outputDirPath as any,
options?.outputDir as any,
options?.reportFileName as any,
)

reporterWithOptions = new JUnitReporter(
axeOptions?.detailedReport,
page,
Expand All @@ -160,7 +159,6 @@ export const checkA11y = async (
reporterWithOptions = reporter
}


if (reporter !== 'html')
await reportViolations(impactedViolations, reporterWithOptions)

Expand Down

0 comments on commit 80a2dc7

Please sign in to comment.