Skip to content

the exclude option from axe.run is not supported #292

Description

@this-miguel

Hello!

first of all thanks for this lib!, it really make easy to test with axe.

I just realize in your README file, this section points to axe-core documentation, and there the run function has an exclude option, here . Their example is:

axe.run(
  {
    exclude: '.ad-banner'
  },
  (err, results) => {
    // ...
  }
);

However I see jest-axe does not support that exclude option. I see this typescript error:

1. typescript: Argument of type '{ rules: { [x: string]: { enabled: boolean; }; }; exclude: string[]; }' is not assignable to parameter of type 'RunOptions'.
     Object literal may only specify known properties, and 'exclude' does not exist in type 'RunOptions'. [2345]

Your interface RunOptions:

	interface RunOptions {
		runOnly?: RunOnly | TagValue[] | string[];
		rules?: Object;
		iframes?: boolean;
		elementRef?: boolean;
		selectors?: boolean;
		resultTypes?: resultGroups[];
		reporter?: ReporterVersion;
		xpath?: boolean;
		absolutePaths?: boolean;
		restoreScroll?: boolean;
		frameWaitTime?: number;
		preload?: boolean;
		performanceTimer?: boolean;
	}

I think there is a missmatch between the version of axe-core you use internally and the last version of axe-core to which your documentation points.

for information, I'm using:

    "jest-axe": "^10.0.0",
    "axe-core": "^4.10.3",

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions