Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
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 () => {