diff --git a/package-lock.json b/package-lock.json index b066027..f796fba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "jest": "^28.1.3", "jest-each": "^28.1.3", "jest-playwright-preset": "^2.0.0", - "playwright": "^1.41.1", + "playwright": "^1.45.0", "prettier": "^2.7.1", "ts-jest": "^28.0.8", "typescript": "^4.8.4" @@ -3872,33 +3872,33 @@ } }, "node_modules/playwright": { - "version": "1.41.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.1.tgz", - "integrity": "sha512-gdZAWG97oUnbBdRL3GuBvX3nDDmUOuqzV/D24dytqlKt+eI5KbwusluZRGljx1YoJKZ2NRPaeWiFTeGZO7SosQ==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.0.tgz", + "integrity": "sha512-4z3ac3plDfYzGB6r0Q3LF8POPR20Z8D0aXcxbJvmfMgSSq1hkcgvFRXJk9rUq5H/MJ0Ktal869hhOdI/zUTeLA==", "dev": true, "dependencies": { - "playwright-core": "1.41.1" + "playwright-core": "1.45.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.41.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.1.tgz", - "integrity": "sha512-/KPO5DzXSMlxSX77wy+HihKGOunh3hqndhqeo/nMxfigiKzogn8kfL0ZBDu0L1RKgan5XHCPmn6zXd2NUJgjhg==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.0.tgz", + "integrity": "sha512-lZmHlFQ0VYSpAs43dRq1/nJ9G/6SiTI7VPqidld9TDefL9tX87bTKExWZZUF5PeRyqtXqd8fQi2qmfIedkwsNQ==", "dev": true, "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/playwright/node_modules/fsevents": { diff --git a/package.json b/package.json index 64216a8..467f027 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "jest": "^28.1.3", "jest-each": "^28.1.3", "jest-playwright-preset": "^2.0.0", - "playwright": "^1.41.1", + "playwright": "^1.45.0", "prettier": "^2.7.1", "ts-jest": "^28.0.8", "typescript": "^4.8.4" diff --git a/src/index.ts b/src/index.ts index 8f66453..01e936e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,10 +30,9 @@ declare module 'axe-core' { * @param page */ export const injectAxe = async (page: Page): Promise => { - 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) } @@ -70,7 +69,7 @@ export const getAxeResults = async ( [context, options], ) - return result + return result as Promise } /** @@ -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, @@ -160,7 +159,6 @@ export const checkA11y = async ( reporterWithOptions = reporter } - if (reporter !== 'html') await reportViolations(impactedViolations, reporterWithOptions)