Skip to content

Commit

Permalink
fix(d.ts): RunOptions.reporter can be any string (#4218)
Browse files Browse the repository at this point in the history
Co-authored-by: Steven Lambert <2433219+straker@users.noreply.github.com>
  • Loading branch information
WilcoFiers and straker authored Nov 2, 2023
1 parent d660518 commit e53f5c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions axe.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion typings/axe-core/axe-core-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e53f5c5

Please sign in to comment.