From bebf8013c85e8d9d4ddc3b70a1b3cde1b00e8bf5 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 18 May 2021 10:16:08 -0400 Subject: [PATCH] fix unit tests Signed-off-by: Sebastian Malton --- src/common/__tests__/catalog-entity-registry.test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/__tests__/catalog-entity-registry.test.ts b/src/common/__tests__/catalog-entity-registry.test.ts index 3c32bc835e..ae3093ec7a 100644 --- a/src/common/__tests__/catalog-entity-registry.test.ts +++ b/src/common/__tests__/catalog-entity-registry.test.ts @@ -24,7 +24,6 @@ import { WebLink } from "../catalog-entities"; import { CatalogEntityRegistry } from "../catalog"; describe("CatalogEntityRegistry", () => { - let registry: CatalogEntityRegistry; const entity = new WebLink({ metadata: { uid: "test", @@ -41,11 +40,16 @@ describe("CatalogEntityRegistry", () => { }); beforeEach(() => { - registry = new CatalogEntityRegistry(); + CatalogEntityRegistry.createInstance(); + }); + + afterEach(() => { + CatalogEntityRegistry.resetInstance(); }); describe("addSource", () => { it ("allows to add an observable source", () => { + const registry = CatalogEntityRegistry.getInstance(); const source = observable.array([]); registry.addObservableSource("test", source); @@ -57,6 +61,7 @@ describe("CatalogEntityRegistry", () => { }); it ("added source change triggers reaction", (done) => { + const registry = CatalogEntityRegistry.getInstance(); const source = observable.array([]); registry.addObservableSource("test", source); @@ -70,6 +75,7 @@ describe("CatalogEntityRegistry", () => { describe("removeSource", () => { it ("removes source", () => { + const registry = CatalogEntityRegistry.getInstance(); const source = observable.array([]); registry.addObservableSource("test", source);