Skip to content

Commit 80a2dc7

Browse files
committed
chore: fix type errors and update pw dep to 1.45.0
1 parent 3022773 commit 80a2dc7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/index.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ declare module 'axe-core' {
3030
* @param page
3131
*/
3232
export const injectAxe = async (page: Page): Promise<void> => {
33-
const axe: string = fs.readFileSync(
34-
require.resolve('axe-core/axe.min.js'),
35-
'utf8',
36-
)
33+
const axe: string = fs.readFileSync(require.resolve('axe-core/axe.min.js'), {
34+
encoding: 'utf8',
35+
})
3736
await page.evaluate((axe: string) => window.eval(axe), axe)
3837
}
3938

@@ -70,7 +69,7 @@ export const getAxeResults = async (
7069
[context, options],
7170
)
7271

73-
return result
72+
return result as Promise<AxeResults>
7473
}
7574

7675
/**
@@ -143,14 +142,14 @@ export const checkA11y = async (
143142
} else console.log('There were no violations to save in report')
144143
} else if (reporter === 'junit') {
145144
// Get the system root directory
146-
// Construct the file path
145+
// Construct the file path
147146
const outputFilePath = path.join(
148147
process.cwd(),
149148
options?.outputDirPath as any,
150149
options?.outputDir as any,
151150
options?.reportFileName as any,
152151
)
153-
152+
154153
reporterWithOptions = new JUnitReporter(
155154
axeOptions?.detailedReport,
156155
page,
@@ -160,7 +159,6 @@ export const checkA11y = async (
160159
reporterWithOptions = reporter
161160
}
162161

163-
164162
if (reporter !== 'html')
165163
await reportViolations(impactedViolations, reporterWithOptions)
166164

0 commit comments

Comments
 (0)