diff --git a/src/test/setupJest.ts b/src/test/setupJest.ts index 05ac5cb..f24759c 100644 --- a/src/test/setupJest.ts +++ b/src/test/setupJest.ts @@ -1,5 +1,7 @@ -// console.log('setupJest.ts') - import { jestOffline } from '../jestOffline.util' +import { jestLog, jestLogger } from '../testing' jestOffline() + +console.log = console.warn = jestLog +console.error = jestLogger.error.bind(jestLogger) diff --git a/src/testing/testing.util.ts b/src/testing/testing.util.ts index ed23be7..1428f6d 100644 --- a/src/testing/testing.util.ts +++ b/src/testing/testing.util.ts @@ -31,13 +31,13 @@ export function silentConsole(): void { console.table = () => {} } -export const jestLogger = commonLoggerCreate((level, args) => { +export const jestLogger = commonLoggerCreate((_level, args) => { if (process.env['JEST_SILENT']) return // no-op process.stdout.write( args .map(a => inspectAny(a, { - includeErrorStack: level === 'error', + includeErrorStack: true, }), ) .join(' ') + '\n',