Skip to content

Commit

Permalink
fix: report path
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhinaba Ghosh authored and Abhinaba Ghosh committed Jan 10, 2024
1 parent f41bca6 commit 10d7fe0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Reporter, { ConfigOptions, AxeOptions } from './types'
import { CreateReport, createHtmlReport, Options } from 'axe-html-reporter'
import JUnitReporter from './reporter/junitReporter'
import * as path from 'path'
import * as os from 'os'

declare global {
interface Window {
Expand Down Expand Up @@ -151,10 +150,7 @@ export const checkA11y = async (
options?.outputDir as any,
options?.reportFileName as any,
)

console.log('outputfile:', outputFilePath);


reporterWithOptions = new JUnitReporter(
axeOptions?.detailedReport,
page,
Expand All @@ -164,10 +160,11 @@ export const checkA11y = async (
reporterWithOptions = reporter
}


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

if (reporter === 'v2' || reporter !== 'html')
if (reporter === 'v2' || (reporter !== 'html' && reporter !== 'junit'))
testResultDependsOnViolations(impactedViolations, skipFailures)
}

Expand Down
4 changes: 1 addition & 3 deletions test/a11y.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ describe('Playwright web page accessibility test using junit reporter', () => {
reportFileName: 'accessibility-audit.xml',
},
)
description === 'on page with detectable accessibility issues'
? expect.assertions(1)
: expect.assertions(0)


expect(
fs.existsSync(
Expand Down

0 comments on commit 10d7fe0

Please sign in to comment.