mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-06 09:20:43 +01:00
b4631b0dd1
* Match console method signatures in logService abstraction * Add a few usages of improved signature * Remove reality check test * Improve electron logging
21 lines
359 B
TypeScript
21 lines
359 B
TypeScript
const originalConsole = console;
|
|
|
|
declare let console: any;
|
|
|
|
export function interceptConsole(): {
|
|
log: jest.Mock<any, any>;
|
|
warn: jest.Mock<any, any>;
|
|
error: jest.Mock<any, any>;
|
|
} {
|
|
console = {
|
|
log: jest.fn(),
|
|
warn: jest.fn(),
|
|
error: jest.fn(),
|
|
};
|
|
return console;
|
|
}
|
|
|
|
export function restoreConsole() {
|
|
console = originalConsole;
|
|
}
|