Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 882 Bytes

README.md

File metadata and controls

36 lines (25 loc) · 882 Bytes

@sa11y/test-utils

Private package providing test utilities for @sa11y packages

Usage

import { beforeEachSetup, domWithA11yIssues, domWithNoA11yIssues } from '@sa11y/test-utils';

import { registerSa11yMatcher } from '@sa11y/jest';

beforeAll(() => {
    registerSa11yMatcher();
});

beforeEach(() => {
    beforeEachSetup();
});

describe('...', () => {
    it('...', async () => {
        document.body.innerHTML = domWithNoA11yIssues;
        await expect(document).toBeAccessible();

        document.body.innerHTML = domWithA11yIssues;
        await expect(document).not.toBeAccessible();
    });
});