2020-12-03 13:07:58 +08:00
|
|
|
const originalWarn = console.warn.bind(console.warn);
|
2023-03-23 16:05:28 +08:00
|
|
|
const originalGroupCollapsed = console.warn.bind(console.groupCollapsed);
|
|
|
|
const originalGroupEnd = console.warn.bind(console.groupEnd);
|
|
|
|
const originalDebug = console.warn.bind(console.debug);
|
2022-04-12 14:22:39 +08:00
|
|
|
require('@testing-library/jest-dom');
|
2021-03-17 10:26:41 +08:00
|
|
|
require('moment-timezone');
|
|
|
|
const moment = require('moment');
|
|
|
|
moment.tz.setDefault('Asia/Shanghai');
|
|
|
|
|
2020-12-03 13:07:58 +08:00
|
|
|
global.beforeAll(() => {
|
2023-03-23 16:05:28 +08:00
|
|
|
console.warn =
|
|
|
|
console.groupCollapsed =
|
|
|
|
console.groupEnd =
|
|
|
|
console.debug =
|
|
|
|
msg => {
|
|
|
|
// warning 先关了,实在太吵。
|
|
|
|
// const str = msg.toString();
|
|
|
|
// if (
|
|
|
|
// str.includes('componentWillMount') ||
|
|
|
|
// str.includes('componentWillReceiveProps')
|
|
|
|
// ) {
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// originalWarn(msg);
|
|
|
|
};
|
2020-12-03 13:07:58 +08:00
|
|
|
});
|
|
|
|
global.afterAll(() => {
|
|
|
|
console.warn = originalWarn;
|
2023-03-23 16:05:28 +08:00
|
|
|
console.groupCollapsed = originalGroupCollapsed;
|
|
|
|
console.groupEnd = originalGroupEnd;
|
|
|
|
console.debug = originalDebug;
|
2020-12-03 13:07:58 +08:00
|
|
|
});
|