Installation
npm install --save @types/jest-axe
Summary
This package contains type definitions for jest-axe (https://github.com/nickcolley/jest-axe).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest-axe.
import { AxeResults, Result, RunOptions, Spec } from 'axe-core';
export interface JestAxeConfigureOptions extends RunOptions {
globalOptions?: Spec | undefined;
}
export const axe: JestAxe;
export type JestAxe = (html: Element | string, options?: RunOptions) => Promise<AxeResults>;
export function configureAxe(options?: JestAxeConfigureOptions): JestAxe;
export interface AssertionsResult {
actual: Result[];
message(): string;
pass: boolean;
}
export type IToHaveNoViolations = (results?: Partial<AxeResults>) => AssertionsResult;
export const toHaveNoViolations: {
toHaveNoViolations: IToHaveNoViolations;
};
declare global {
namespace jest {
interface Matchers<R, T> {
toHaveNoViolations(): R;
}
}
interface Node {}
}
Additional Details
Credits
These definitions were written by erbridge.