diff --git a/src/utilities/observables/Concast.ts b/src/utilities/observables/Concast.ts index 5c32a15e046..59c1c9b61a1 100644 --- a/src/utilities/observables/Concast.ts +++ b/src/utilities/observables/Concast.ts @@ -212,11 +212,7 @@ export class Concast extends Observable { } else if (isPromiseLike(value)) { value.then( (obs) => (this.sub = obs.subscribe(this.handlers)), - () => { - // add error handler here to silence unhandled promise rejection - // so the tests can run at all, but do not fix yet - // to show the memory leak - } + this.handlers.error ); } else { this.sub = value.subscribe(this.handlers); diff --git a/src/utilities/observables/__tests__/Concast.ts b/src/utilities/observables/__tests__/Concast.ts index a25277ed4b5..e52b55022b7 100644 --- a/src/utilities/observables/__tests__/Concast.ts +++ b/src/utilities/observables/__tests__/Concast.ts @@ -207,7 +207,7 @@ describe("Concast Observable (similar to Behavior Subject in RxJS)", () => { await expect(observerRefs[0]).toBeGarbageCollected(); }); - it.failing("rejecting a source-wrapping promise of a concast frees all observer references on `this.observers`", async () => { + it("rejecting a source-wrapping promise of a concast frees all observer references on `this.observers`", async () => { const { promise, reject } = deferred>(); const observers: Observer[] = [{ next() {}, error() {} }]; const observerRefs = observers.map((observer) => new WeakRef(observer)); @@ -268,7 +268,7 @@ describe("Concast Observable (similar to Behavior Subject in RxJS)", () => { await expect(observerRefs[0]).toBeGarbageCollected(); }); - it.failing("after subscribing to an already-rejected concast, the reference is freed up again", async () => { + it("after subscribing to an already-rejected concast, the reference is freed up again", async () => { const concast = new Concast([Promise.reject("error")]); await expect(concast.promise).rejects.toBe("error"); await Promise.resolve(); diff --git a/tsconfig.tests.json b/tsconfig.tests.json index d6bb25bd3fd..45c0454886a 100644 --- a/tsconfig.tests.json +++ b/tsconfig.tests.json @@ -1,5 +1,8 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "lib": ["es2015", "esnext.asynciterable", "dom", "ES2021.WeakRef"], + }, "include": ["src/**/__tests__/**/*.ts", "src/**/__tests__/**/*.tsx"], "exclude": [] }