mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Change typing for after/before window/application start (#7342)
- Now the callback is provided with an object containing either `mainDi` or `windowDi` fields. This should help with confusion over which environment the `di` is for Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
b99b06980e
commit
a63f737adb
62 files changed
+185
-189
No files matched your search
+10
-12
@@ -18,20 +18,18 @@ describe("application-menu-in-legacy-extension-api", () => {
|
||||
beforeEach(async () => {
|
||||
builder = getApplicationBuilder();
|
||||
|
||||
builder.beforeApplicationStart(
|
||||
(mainDi) => {
|
||||
runInAction(() => {
|
||||
mainDi.register(
|
||||
someTopMenuItemInjectable,
|
||||
someNonExtensionBasedMenuItemInjectable,
|
||||
);
|
||||
});
|
||||
builder.beforeApplicationStart(({ mainDi }) => {
|
||||
runInAction(() => {
|
||||
mainDi.register(
|
||||
someTopMenuItemInjectable,
|
||||
someNonExtensionBasedMenuItemInjectable,
|
||||
);
|
||||
});
|
||||
|
||||
logErrorMock = jest.fn();
|
||||
logErrorMock = jest.fn();
|
||||
|
||||
mainDi.override(logErrorInjectable, () => logErrorMock);
|
||||
},
|
||||
);
|
||||
mainDi.override(logErrorInjectable, () => logErrorMock);
|
||||
});
|
||||
|
||||
await builder.startHidden();
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ describe.each(allPlatforms)("application-menu, given platform is '%s'", (platfor
|
||||
|
||||
builder = getApplicationBuilder();
|
||||
|
||||
builder.beforeApplicationStart((mainDi) => {
|
||||
builder.beforeApplicationStart(({ mainDi }) => {
|
||||
mainDi.override(platformInjectable, () => platform);
|
||||
|
||||
mainDi.override(
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ describe("handling-of-orphan-application-menu-items, given orphan menu item", ()
|
||||
|
||||
builder = getApplicationBuilder();
|
||||
|
||||
builder.beforeApplicationStart((mainDi) => {
|
||||
builder.beforeApplicationStart(({ mainDi }) => {
|
||||
const someOrphanMenuItemInjectable = getInjectable({
|
||||
id: "some-orphan-menu-item",
|
||||
instantiate: () => ({
|
||||
|
||||
Reference in new issue
Block a user