mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
chore: update test
This commit is contained in:
parent
d1be33f224
commit
b7fe2078e8
@ -16,9 +16,6 @@ if (
|
||||
}
|
||||
/* @remove-on-es-build-end */
|
||||
|
||||
// Fix vite build error
|
||||
export const theme = null;
|
||||
|
||||
export { default as Affix } from './affix';
|
||||
export type { AffixProps } from './affix';
|
||||
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]'));
|
||||
|
||||
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') {
|
||||
// Server
|
||||
expect(() => {
|
||||
@ -112,7 +115,7 @@ function baseText(doInject: boolean, component: string, options: Options = {}) {
|
||||
expect(child).toMatchSnapshot();
|
||||
}
|
||||
|
||||
errSpy();
|
||||
errSpy.mockRestore();
|
||||
},
|
||||
);
|
||||
jest.useRealTimers();
|
||||
|
@ -10,16 +10,14 @@ export function excludeWarning() {
|
||||
originError(msg, ...rest);
|
||||
});
|
||||
|
||||
return () => {
|
||||
errorSpy.mockRestore();
|
||||
};
|
||||
return errorSpy;
|
||||
}
|
||||
|
||||
export default function excludeAllWarning() {
|
||||
let cleanUp: Function;
|
||||
|
||||
beforeAll(() => {
|
||||
cleanUp = excludeWarning();
|
||||
cleanUp = excludeWarning().mockRestore;
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user