I'm trying to mock a logging service that have static getters.
static get error(): Function {
return console.error.bind(console, 'Error: ');
}
Tried with:
jest.spyOn(ConsoleLoggingService, 'error').mockImplementation(() => 'blah');
but I get TypeError: Cannot set property info of function ConsoleLoggingService() {} which has only a getter
Also tried:
jest.spyOn(ConsoleLoggingService, 'error', 'get').mockImplementation(() => 'blah');
And get TypeError: console_logging_service_1.ConsoleLoggingService.error is not a function
Any suggestions?
Thanks