mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Simplify more usages of getDiForUnitTesting
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
8bab6bde14
commit
4fd01ef8f4
@ -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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user