@storacha/client
Version:
Client for the storacha.network w3up api
28 lines • 1.28 kB
TypeScript
export function group<Context>({ before, after }: {
before: (assert: Assert) => PromiseLike<Context>;
after: (context: Context) => unknown;
}): (suite: Suite<Context>) => Suite;
export function test(suite: Suite<void> | Record<string, Suite>): void;
export function setup(): (Promise<import("@storacha/upload-api/types").UcantoServerTestContext & {
connect: () => Promise<import("@storacha/client").Client>;
client: import("@storacha/client").Client;
cleanup: () => void;
}>);
export const withContext: (suite: Suite<import("@storacha/upload-api/types").UcantoServerTestContext & {
connect: () => Promise<import("@storacha/client").Client>;
client: import("@storacha/client").Client;
cleanup: () => void;
}>) => Suite;
export type Unit<Context = void> = (assert: Assert, context: Context) => unknown;
export type Setup<Context = undefined> = {
before?: (() => Context | PromiseLike<Context>) | undefined;
after?: (() => PromiseLike<unknown> | unknown) | undefined;
};
export type Suite<Context = undefined> = {
[name: string]: Unit<Context> | Suite<Context>;
};
export type Assert = Omit<typeof assert, "ok"> & {
ok(value: unknown, message?: string): void;
};
import * as assert from 'assert';
//# sourceMappingURL=test.d.ts.map