chore: default hashed (#37154)
* 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 entrypull/37089/head
parent
9b3a4dab70
commit
78cca16779
@ -1,4 +1,26 @@
|
||||
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);
|
||||
|
Loading…
Reference in New Issue