From 92b0c827bd396d15c57306a532b5469cbebe8144 Mon Sep 17 00:00:00 2001 From: rzvxa Date: Mon, 1 Jan 2024 18:53:52 +0330 Subject: [PATCH] test: cycling references --- tests/dwait.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/dwait.spec.ts b/tests/dwait.spec.ts index eca08ca..c7b6f62 100644 --- a/tests/dwait.spec.ts +++ b/tests/dwait.spec.ts @@ -123,4 +123,11 @@ describe("dwait Tests", () => { const dwaitFunc = dwait(resolveMock); await expect(dwaitFunc().await).resolves.toEqual(OK); }); + test("should be able to wrap cycling dependencies", async () => { + let dwaitPromise = dwait(resolveClass()); + for (let i = 0, len = 999; i < len; ++i) { + dwaitPromise = dwaitPromise.baz(); + } + await expect(dwaitPromise.foo.await).resolves.toEqual(OKB); + }); });