mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Override dependency for causing side effects
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
b76ff351ac
commit
672e96ee64
@ -44,6 +44,9 @@ import exitAppInjectable from "./electron-app/exit-app.injectable";
|
||||
import setApplicationNameInjectable from "./electron-app/set-application-name.injectable";
|
||||
import getCommandLineSwitchInjectable from "./electron-app/get-command-line-switch.injectable";
|
||||
import isAutoUpdateEnabledInjectable from "./is-auto-update-enabled.injectable";
|
||||
import appEventBusInjectable from "../common/app-event-bus/app-event-bus.injectable";
|
||||
import { EventEmitter } from "../common/event-emitter";
|
||||
import type { AppEvent } from "../common/app-event-bus/event-bus";
|
||||
|
||||
export const getDiForUnitTesting = (
|
||||
{ doGeneralOverrides } = { doGeneralOverrides: false },
|
||||
@ -82,6 +85,9 @@ export const getDiForUnitTesting = (
|
||||
di.override(getCommandLineSwitchInjectable, () => () => "irrelevant");
|
||||
di.override(isAutoUpdateEnabledInjectable, () => () => false);
|
||||
|
||||
// TODO: Remove usages of globally exported appEventBus to get rid of this
|
||||
di.override(appEventBusInjectable, () => new EventEmitter<[AppEvent]>());
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-vars-ts
|
||||
di.override(extensionsStoreInjectable, () => ({ isEnabled: ({ id, isBundled }) => false }) as ExtensionsStore);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user