Skip to content

Commit

Permalink
test: cycling references
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Jan 1, 2024
1 parent e31d8ea commit 92b0c82
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/dwait.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit 92b0c82

Please sign in to comment.