mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
28 lines
581 B
JavaScript
28 lines
581 B
JavaScript
import logger from '../src/logger';
|
|
|
|
export function globalBeforeAll() {
|
|
logger.__getLogs = () => {
|
|
const logs = {};
|
|
// Taken from https://github.com/nuxt-contrib/consola/blob/master/src/types.js
|
|
[
|
|
'silent',
|
|
'fatal',
|
|
'error',
|
|
'warn',
|
|
'log',
|
|
'info',
|
|
'success',
|
|
'debug',
|
|
'trace',
|
|
'verbose',
|
|
].forEach(level => {
|
|
logs[level] = logger[level].mock.calls.map(c => (c.length === 1 ? c[0] : c));
|
|
});
|
|
return logs;
|
|
};
|
|
}
|
|
|
|
export function globalBeforeEach() {
|
|
logger.mockTypes(() => jest.fn());
|
|
}
|