Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 649 Bytes

README.md

File metadata and controls

32 lines (24 loc) · 649 Bytes
ant-design-testing

Easier testing for ant-design-based UI library

Usage

$ pnpm install ant-design-testing -D

then, modify the prefixCls if you need it

// setupTests.ts
import { provider } from 'ant-design-testing';

provider({ prefixCls: 'ant' });
// yourInput.test.tsx
import { input } from 'ant-design-testing';

describe("Test input's fire functions", () => {
    test('fireChange', () => {
        const fn = jest.fn();
        const { container } = render(<Input onChange={fn} />);
        input.fireChange(container, 'test');
        expect(fn).toBeCalled();
    });
});