mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 19:42:54 +08:00
chore: update test
This commit is contained in:
parent
d1be33f224
commit
b7fe2078e8
@ -16,9 +16,6 @@ if (
|
|||||||
}
|
}
|
||||||
/* @remove-on-es-build-end */
|
/* @remove-on-es-build-end */
|
||||||
|
|
||||||
// Fix vite build error
|
|
||||||
export const theme = null;
|
|
||||||
|
|
||||||
export { default as Affix } from './affix';
|
export { default as Affix } from './affix';
|
||||||
export type { AffixProps } from './affix';
|
export type { AffixProps } from './affix';
|
||||||
export { default as Alert } from './alert';
|
export { default as Alert } from './alert';
|
||||||
|
@ -71,7 +71,7 @@ function baseText(doInject: boolean, component: string, options: Options = {}) {
|
|||||||
|
|
||||||
expect(errSpy).not.toHaveBeenCalledWith(expect.stringContaining('[Ant Design CSS-in-JS]'));
|
expect(errSpy).not.toHaveBeenCalledWith(expect.stringContaining('[Ant Design CSS-in-JS]'));
|
||||||
|
|
||||||
errSpy();
|
errSpy.mockRestore();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,6 +96,9 @@ function baseText(doInject: boolean, component: string, options: Options = {}) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inject cssinjs cache to avoid create <style /> element
|
||||||
|
Demo = <StyleProvider cache={createCache()}>{Demo}</StyleProvider>;
|
||||||
|
|
||||||
if (typeof document === 'undefined') {
|
if (typeof document === 'undefined') {
|
||||||
// Server
|
// Server
|
||||||
expect(() => {
|
expect(() => {
|
||||||
@ -112,7 +115,7 @@ function baseText(doInject: boolean, component: string, options: Options = {}) {
|
|||||||
expect(child).toMatchSnapshot();
|
expect(child).toMatchSnapshot();
|
||||||
}
|
}
|
||||||
|
|
||||||
errSpy();
|
errSpy.mockRestore();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
jest.useRealTimers();
|
jest.useRealTimers();
|
||||||
|
@ -10,16 +10,14 @@ export function excludeWarning() {
|
|||||||
originError(msg, ...rest);
|
originError(msg, ...rest);
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return errorSpy;
|
||||||
errorSpy.mockRestore();
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function excludeAllWarning() {
|
export default function excludeAllWarning() {
|
||||||
let cleanUp: Function;
|
let cleanUp: Function;
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
cleanUp = excludeWarning();
|
cleanUp = excludeWarning().mockRestore;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user