logging.logger.info('hi', { key: 'value' }); expect(process.stdout.write).toHaveBeenCalled(); const firstLog = process.stdout.write.calls.first().args[0]; expect(firstLog).toEqual('info: hi {"key":"value"}' + '\n'); return reconfigureServer(); logging.logger.info('hi', { key: 'value' }); expect(process.stdout.write).toHaveBeenCalled(); const firstLog = process.stdout.write.calls.first().args[0]; expect(firstLog).toEqual( JSON.stringify({ key: 'value', level: 'info', message: 'hi' }) + '\n'