Allow html element in addition to string (#37794)

This commit is contained in:
Daniel Nixon 2019-08-27 01:40:59 +10:00 committed by Sheetal Nandi
parent 10035b1b26
commit b167c4b6a9
3 changed files with 7 additions and 2 deletions

View File

@ -34,7 +34,10 @@ export interface AxeOptions {
* @param options Options to run aXe.
* @returns Promise for the results of running aXe.
*/
export type JestAxe = (html: string, options?: AxeOptions) => Promise<AxeResults>;
export type JestAxe = (
html: Element | string,
options?: AxeOptions,
) => Promise<AxeResults>;
/**
* Creates a new aXe verifier function.

View File

@ -17,3 +17,4 @@ const newJestWithOptions: JestAxe = configureAxe({
const sameJest: JestAxe = axe;
expect("").toHaveNoViolations();
expect(document.body).toHaveNoViolations();

View File

@ -2,7 +2,8 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,