Improve documentation of Singleton functions, change to createInstance (#2585)

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-04-22 10:05:29 +03:00
1 parent 33ca6c9c17
commit b63fdfaff3
15 files changed
+90 -68

No files matched your search

@@ -21,7 +21,7 @@ describe("ExtensionDiscovery", () => {
beforeEach(() => {
ExtensionDiscovery.resetInstance();
ExtensionsStore.resetInstance();
ExtensionsStore.getInstanceOrCreate();
ExtensionsStore.createInstance();
});
it("emits add for added extension", async done => {
@@ -43,7 +43,7 @@ describe("ExtensionDiscovery", () => {
mockedWatch.mockImplementationOnce(() =>
(mockWatchInstance) as any
);
const extensionDiscovery = ExtensionDiscovery.getInstanceOrCreate();
const extensionDiscovery = ExtensionDiscovery.createInstance();
// Need to force isLoaded to be true so that the file watching is started
extensionDiscovery.isLoaded = true;
@@ -83,7 +83,7 @@ describe("ExtensionDiscovery", () => {
mockedWatch.mockImplementationOnce(() =>
(mockWatchInstance) as any
);
const extensionDiscovery = ExtensionDiscovery.getInstanceOrCreate();
const extensionDiscovery = ExtensionDiscovery.createInstance();
// Need to force isLoaded to be true so that the file watching is started
extensionDiscovery.isLoaded = true;
@@ -110,7 +110,7 @@ describe("ExtensionLoader", () => {
});
it.only("renderer updates extension after ipc broadcast", async (done) => {
const extensionLoader = ExtensionLoader.getInstanceOrCreate();
const extensionLoader = ExtensionLoader.createInstance();
expect(extensionLoader.userExtensions).toMatchInlineSnapshot(`Map {}`);
@@ -155,7 +155,7 @@ describe("ExtensionLoader", () => {
// Disable sending events in this test
(ipcRenderer.on as any).mockImplementation();
const extensionLoader = ExtensionLoader.getInstanceOrCreate();
const extensionLoader = ExtensionLoader.createInstance();
await extensionLoader.init();