amis/packages/amis-core/__tests__/jest.setup.js

25 lines
636 B
JavaScript
Raw Normal View History

const originalWarn = console.warn.bind(console.warn);
require('@testing-library/jest-dom');
require('moment-timezone');
const moment = require('moment');
moment.tz.setDefault('Asia/Shanghai');
2022-06-01 15:06:00 +08:00
const cleanup = require('@testing-library/react').cleanup;
global.beforeAll(() => {
console.warn = msg => {
// warning 先关了,实在太吵。
// const str = msg.toString();
// if (
// str.includes('componentWillMount') ||
// str.includes('componentWillReceiveProps')
// ) {
// return;
// }
// originalWarn(msg);
};
});
global.afterAll(() => {
console.warn = originalWarn;
2022-06-01 15:06:00 +08:00
cleanup();
});