mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Improve documentation of Singleton functions, change to createInstance (#2585)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
33ca6c9c17
commit
b63fdfaff3
15 files changed
+90
-68
No files matched your search
@@ -59,7 +59,7 @@ describe("empty config", () => {
|
||||
|
||||
mockFs(mockOpts);
|
||||
|
||||
await ClusterStore.getInstanceOrCreate().load();
|
||||
await ClusterStore.createInstance().load();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -177,7 +177,7 @@ describe("config with existing clusters", () => {
|
||||
|
||||
mockFs(mockOpts);
|
||||
|
||||
return ClusterStore.getInstanceOrCreate().load();
|
||||
return ClusterStore.createInstance().load();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -274,7 +274,7 @@ users:
|
||||
|
||||
mockFs(mockOpts);
|
||||
|
||||
return ClusterStore.getInstanceOrCreate().load();
|
||||
return ClusterStore.createInstance().load();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -316,7 +316,7 @@ describe("pre 2.0 config with an existing cluster", () => {
|
||||
|
||||
mockFs(mockOpts);
|
||||
|
||||
return ClusterStore.getInstanceOrCreate().load();
|
||||
return ClusterStore.createInstance().load();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -386,7 +386,7 @@ describe("pre 2.6.0 config with a cluster that has arrays in auth config", () =>
|
||||
|
||||
mockFs(mockOpts);
|
||||
|
||||
return ClusterStore.getInstanceOrCreate().load();
|
||||
return ClusterStore.createInstance().load();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -430,7 +430,7 @@ describe("pre 2.6.0 config with a cluster icon", () => {
|
||||
|
||||
mockFs(mockOpts);
|
||||
|
||||
return ClusterStore.getInstanceOrCreate().load();
|
||||
return ClusterStore.createInstance().load();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -469,7 +469,7 @@ describe("for a pre 2.7.0-beta.0 config without a workspace", () => {
|
||||
|
||||
mockFs(mockOpts);
|
||||
|
||||
return ClusterStore.getInstanceOrCreate().load();
|
||||
return ClusterStore.createInstance().load();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -505,7 +505,7 @@ describe("pre 3.6.0-beta.1 config with an existing cluster", () => {
|
||||
|
||||
mockFs(mockOpts);
|
||||
|
||||
return ClusterStore.getInstanceOrCreate().load();
|
||||
return ClusterStore.createInstance().load();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { HotbarStore } from "../hotbar-store";
|
||||
describe("HotbarStore", () => {
|
||||
beforeEach(() => {
|
||||
ClusterStore.resetInstance();
|
||||
ClusterStore.getInstanceOrCreate();
|
||||
ClusterStore.createInstance();
|
||||
|
||||
HotbarStore.resetInstance();
|
||||
mockFs({ tmp: { "lens-hotbar-store.json": "{}" } });
|
||||
@@ -17,7 +17,7 @@ describe("HotbarStore", () => {
|
||||
|
||||
describe("load", () => {
|
||||
it("loads one hotbar by default", () => {
|
||||
HotbarStore.getInstanceOrCreate().load();
|
||||
HotbarStore.createInstance().load();
|
||||
expect(HotbarStore.getInstance().hotbars.length).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ describe("user store tests", () => {
|
||||
UserStore.resetInstance();
|
||||
mockFs({ tmp: { "config.json": "{}", "kube_config": "{}" } });
|
||||
|
||||
(UserStore.getInstanceOrCreate() as any).refreshNewContexts = jest.fn(() => Promise.resolve());
|
||||
(UserStore.createInstance() as any).refreshNewContexts = jest.fn(() => Promise.resolve());
|
||||
|
||||
return UserStore.getInstance().load();
|
||||
});
|
||||
@@ -102,7 +102,7 @@ describe("user store tests", () => {
|
||||
}
|
||||
});
|
||||
|
||||
return UserStore.getInstanceOrCreate().load();
|
||||
return UserStore.createInstance().load();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
Reference in new issue
Block a user