mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 12:40:50 +00:00
21 lines
407 B
TypeScript
21 lines
407 B
TypeScript
import prettyFormat from 'pretty-format';
|
||
|
||
global['prettyFormat'] = prettyFormat;
|
||
|
||
jest.setTimeout(300000);
|
||
|
||
// 把 console.error 转换成 error,方便断言
|
||
(() => {
|
||
const spy = jest.spyOn(console, 'error');
|
||
beforeAll(() => {
|
||
spy.mockImplementation((message) => {
|
||
console.log(message);
|
||
throw new Error(message);
|
||
});
|
||
});
|
||
afterAll(() => {
|
||
spy.mockRestore();
|
||
});
|
||
})();
|
||
|