From dec8267441a1280b8911e08f8eabe37664fd37d1 Mon Sep 17 00:00:00 2001 From: Herb Caudill Date: Tue, 19 Mar 2024 16:22:17 +0100 Subject: [PATCH] document runStorageAdapterTests --- .../src/helpers/tests/storage-adapter-tests.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/automerge-repo/src/helpers/tests/storage-adapter-tests.ts b/packages/automerge-repo/src/helpers/tests/storage-adapter-tests.ts index dbf768d74..a69bbb89f 100644 --- a/packages/automerge-repo/src/helpers/tests/storage-adapter-tests.ts +++ b/packages/automerge-repo/src/helpers/tests/storage-adapter-tests.ts @@ -8,6 +8,15 @@ const PAYLOAD_C = new Uint8Array([2, 111, 74, 131, 236, 96, 142, 193]) const LARGE_PAYLOAD = new Uint8Array(100000).map((_, i) => Math.random() * 256) +/** + * Runs a series of tests against a storage adapter. + * + * The `setup` function should return an object containing: + * + * - `adapter`: The adapter to be tested + * - `teardown`: An optional function to be called after the tests have been run. + * This can be used to clean up any resources that were created during the test. + */ export function runStorageAdapterTests(_setup: SetupFn, title?: string): void { const setup = async () => { const { adapter, teardown = NO_OP } = await _setup()