Simplify more usages of getDiForUnitTesting

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen authored and Sebastian Malton committed 2023-03-07 11:53:56 -05:00
1 parent 8bab6bde14
commit 4fd01ef8f4
3 files changed
+6 -4

No files matched your search

@@ -13,6 +13,8 @@ describe("get-electron-app-path", () => {
beforeEach(() => { beforeEach(() => {
const di = getDiForUnitTesting(); const di = getDiForUnitTesting();
di.unoverride(getElectronAppPathInjectable);
const appStub = { const appStub = {
name: "some-app-name", name: "some-app-name",
@@ -12,6 +12,8 @@ describe("get-editor-height-from-lines-number", () => {
beforeEach(() => { beforeEach(() => {
const di = getDiForUnitTesting(); const di = getDiForUnitTesting();
di.unoverride(getEditorHeightFromLinesCountInjectable);
getEditorHeightFromLinesNumber = di.inject(getEditorHeightFromLinesCountInjectable); getEditorHeightFromLinesNumber = di.inject(getEditorHeightFromLinesCountInjectable);
}); });
@@ -168,9 +168,7 @@ interface Environment {
} }
export const getApplicationBuilder = () => { export const getApplicationBuilder = () => {
const mainDi = getMainDi({ const mainDi = getMainDi();
doGeneralOverrides: true,
});
runInAction(() => { runInAction(() => {
registerFeature( registerFeature(
@@ -236,7 +234,7 @@ export const getApplicationBuilder = () => {
const createElectronWindowFake: CreateElectronWindow = (configuration) => { const createElectronWindowFake: CreateElectronWindow = (configuration) => {
const windowId = configuration.id; const windowId = configuration.id;
const windowDi = getRendererDi({ doGeneralOverrides: true }); const windowDi = getRendererDi();
overrideForWindow(windowDi, windowId); overrideForWindow(windowDi, windowId);
overrideFsWithFakes(windowDi); overrideFsWithFakes(windowDi);