Skip to content

Commit

Permalink
document runStorageAdapterTests
Browse files Browse the repository at this point in the history
  • Loading branch information
HerbCaudill committed Mar 19, 2024
1 parent fa8a888 commit dec8267
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit dec8267

Please sign in to comment.