From e53f5c5184a0e5f75db65e7929a9da84d7ee6df6 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 2 Nov 2023 15:50:20 +0100 Subject: [PATCH] fix(d.ts): RunOptions.reporter can be any string (#4218) Co-authored-by: Steven Lambert <2433219+straker@users.noreply.github.com> --- axe.d.ts | 4 ++-- typings/axe-core/axe-core-tests.ts | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/axe.d.ts b/axe.d.ts index 7f33941d94..8ecd9de75a 100644 --- a/axe.d.ts +++ b/axe.d.ts @@ -6,7 +6,7 @@ declare namespace axe { type TagValue = string; - type ReporterVersion = 'v1' | 'v2' | 'raw' | 'raw-env' | 'no-passes'; + type ReporterVersion = 'v1' | 'v2' | 'raw' | 'rawEnv' | 'no-passes'; type RunOnlyType = 'rule' | 'rules' | 'tag' | 'tags'; @@ -131,7 +131,7 @@ declare namespace axe { interface RunOptions { runOnly?: RunOnly | TagValue[] | string[] | string; rules?: RuleObject; - reporter?: ReporterVersion; + reporter?: ReporterVersion | string; resultTypes?: resultGroups[]; selectors?: boolean; ancestry?: boolean; diff --git a/typings/axe-core/axe-core-tests.ts b/typings/axe-core/axe-core-tests.ts index 094b30d64c..5d421307a8 100644 --- a/typings/axe-core/axe-core-tests.ts +++ b/typings/axe-core/axe-core-tests.ts @@ -2,7 +2,13 @@ import * as axe from '../../axe'; var context: any = document; var $fixture = [document]; -var options = { iframes: false, selectors: false, elementRef: false }; +var options: axe.RunOptions = { + iframes: false, + selectors: false, + elementRef: false +}; +options.reporter = 'rawEnv'; +options.reporter = 'custom'; axe.run(context, {}, (error: Error, results: axe.AxeResults) => { if (error) {