From be012534ff9a25ac6c67c6e743363f9e6f1868d1 Mon Sep 17 00:00:00 2001 From: Marcus Pousette Date: Wed, 13 Dec 2023 22:50:56 +0100 Subject: [PATCH] fix: update test --- .../programs/data/document/src/__tests__/profile.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/programs/data/document/src/__tests__/profile.test.ts b/packages/programs/data/document/src/__tests__/profile.test.ts index 975d6d6f4..49ddb27b1 100644 --- a/packages/programs/data/document/src/__tests__/profile.test.ts +++ b/packages/programs/data/document/src/__tests__/profile.test.ts @@ -3,7 +3,7 @@ import { Documents } from "../index.js"; import { Program } from "@peerbit/program"; import { v4 as uuid } from "uuid"; import { randomBytes } from "@peerbit/crypto"; -import { waitFor } from "@peerbit/time"; +import { waitForResolved } from "@peerbit/time"; import { TestSession } from "@peerbit/test-utils"; /** @@ -73,7 +73,7 @@ describe("profile", () => { await session.stop(); }); it("puts", async () => { - let COUNT = 100; + let COUNT = 10; const writeStore = stores[0]; let promises: Promise[] = []; for (let i = 0; i < COUNT; i++) { @@ -85,6 +85,8 @@ describe("profile", () => { await writeStore.docs.put(doc, { unique: true }); } await Promise.all(promises); - await waitFor(() => stores[stores.length - 1].docs.index.size === COUNT); + await waitForResolved(() => + expect(stores[stores.length - 1].docs.index.size).toEqual(COUNT) + ); }); });