mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 03:29:39 +08:00
78cca16779
* chore: default hashed * test: try for clean default hashed * chore: clean up * chore: fix dist * chore: es inject * chore: no hashed in test env * chore: update comment * chore: hack in jest env * chore: try unique entry
27 lines
734 B
TypeScript
27 lines
734 B
TypeScript
import { toHaveNoViolations } from 'jest-axe';
|
|
import '@testing-library/jest-dom';
|
|
import { defaultConfig } from '../components/theme/index';
|
|
|
|
// Not use dynamic hashed for test env since version will change hash dynamically.
|
|
defaultConfig.hashed = false;
|
|
|
|
if (process.env.LIB_DIR === 'dist') {
|
|
jest.mock('../dist/antd', () => {
|
|
const antd = jest.requireActual('../dist/antd');
|
|
antd.theme.defaultConfig.hashed = false;
|
|
|
|
return antd;
|
|
});
|
|
} else if (process.env.LIB_DIR === 'es') {
|
|
jest.mock('../es/theme', () => {
|
|
const esTheme = jest.requireActual('../es/theme');
|
|
if (esTheme.defaultConfig) {
|
|
esTheme.defaultConfig.hashed = false;
|
|
}
|
|
|
|
return esTheme;
|
|
});
|
|
}
|
|
|
|
expect.extend(toHaveNoViolations);
|