mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
override logger with mocks only when needed for tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
f2a0b72253
commit
9d4b6c52c0
4 files changed
+31
-12
No files matched your search
@@ -34,6 +34,7 @@ import terminalSpawningPoolInjectable from "./components/dock/terminal/terminal-
|
||||
import hostedClusterIdInjectable from "../common/cluster-store/hosted-cluster-id.injectable";
|
||||
import type { GetDiForUnitTestingOptions } from "../test-utils/get-dis-for-unit-testing";
|
||||
import historyInjectable from "./navigation/history.injectable";
|
||||
import { noop } from "./utils";
|
||||
|
||||
export const getDiForUnitTesting = (opts: GetDiForUnitTestingOptions = {}) => {
|
||||
const {
|
||||
@@ -86,11 +87,11 @@ export const getDiForUnitTesting = (opts: GetDiForUnitTestingOptions = {}) => {
|
||||
di.override(focusWindowInjectable, () => () => {});
|
||||
|
||||
di.override(loggerInjectable, () => ({
|
||||
warn: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
info: jest.fn(),
|
||||
silly: jest.fn(),
|
||||
warn: noop,
|
||||
debug: noop,
|
||||
error: noop,
|
||||
info: noop,
|
||||
silly: noop,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user