Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add category INAPPLICABLE to summary report (#17) #20

Merged
merged 1 commit into from
Nov 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/commands/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ enum WcagLevel {
enum SummaryResult {
PASS = 'PASS',
VIOLATION = 'VIOLATION',
INAPPLICABLE = 'INAPPLICABLE',
}
const config: ConfigValue = getConfig();
const localizedMessage = new MessageLocalization(config.locale);
Expand All @@ -54,7 +55,7 @@ const wcagRegExp = /^wcag(\d{3}|\d{1,2}[a]{1,3})$/;
* Summarize and updates the axe result by their respective result types.
* @param axeResult Axe result object
* @param resultType Axe result types: violation, incomplete, passes, or inapplicable
* @param resultSummary PASS or VIOLATION
* @param resultSummary PASS, VIOLATION, or INAPPLICABLE
* @param summaryObj Object in which to save summary results.
* @param outputByPage When true, the top-level key of summaryObj will be the respective page URLs.
* @param whitelist Whitelisted alerts to be ommited from the output; a subset of the `axe-scan run` output.
Expand Down Expand Up @@ -217,11 +218,11 @@ export default async function (options: CommandOption): Promise<void> {
.analyze();

// Summarize results
// 'inapplicable' summarized as PASS
// 'inapplicable' summarized as INAPPLICABLE
outputObj = summarizeAxeResult(
results,
'inapplicable',
SummaryResult.PASS,
SummaryResult.INAPPLICABLE,
outputObj,
outputByPage
);
Expand Down