How to use the jest-axe.configureAxe function in jest-axe

To help you get started, we’ve selected a few jest-axe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / jest-axe / jest-axe-tests.ts View on Github external
import { configureAxe, axe, toHaveNoViolations, JestAxe } from 'jest-axe';

expect.extend(toHaveNoViolations);

const newJestWithDefaults: JestAxe = configureAxe();

const newJestWithOptions: JestAxe = configureAxe({
    elementRef: false,
    iframes: false,
    rules: {},
    runOnly: {
        type: 'rules',
        values: [],
    },
    selectors: false,
});

const sameJest: JestAxe = axe;

expect('').toHaveNoViolations();
expect(document.body).toHaveNoViolations();
github DefinitelyTyped / DefinitelyTyped / types / jest-axe / jest-axe-tests.ts View on Github external
import { configureAxe, axe, toHaveNoViolations, JestAxe } from 'jest-axe';

expect.extend(toHaveNoViolations);

const newJestWithDefaults: JestAxe = configureAxe();

const newJestWithOptions: JestAxe = configureAxe({
    elementRef: false,
    iframes: false,
    rules: {},
    runOnly: {
        type: 'rules',
        values: [],
    },
    selectors: false,
});

const sameJest: JestAxe = axe;

expect('').toHaveNoViolations();
expect(document.body).toHaveNoViolations();

async () => {

jest-axe

Custom Jest matcher for aXe for testing accessibility

MIT
Latest version published 5 months ago

Package Health Score

75 / 100
Full package analysis

Popular jest-axe functions