1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[EC-515] Re-enable node consoleLog.service test (#3448)

This commit is contained in:
Thomas Rittson
2022-09-08 08:02:53 +10:00
committed by GitHub
parent 04c594203c
commit 233c85f7a3
3 changed files with 29 additions and 30 deletions

View File

@@ -1,32 +1,9 @@
import { ConsoleLogService } from "@bitwarden/common/services/consoleLog.service";
const originalConsole = console;
import { interceptConsole, restoreConsole } from "../shared/interceptConsole";
let caughtMessage: any;
declare let console: any;
export function interceptConsole(interceptions: any): object {
console = {
log: function () {
// eslint-disable-next-line
interceptions.log = arguments;
},
warn: function () {
// eslint-disable-next-line
interceptions.warn = arguments;
},
error: function () {
// eslint-disable-next-line
interceptions.error = arguments;
},
};
return interceptions;
}
export function restoreConsole() {
console = originalConsole;
}
describe("ConsoleLogService", () => {
let logService: ConsoleLogService;
beforeEach(() => {