UNPKG

@daiso-tech/core

Version:

The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.

47 lines (46 loc) 1.45 kB
/** * @module FileStorage */ import { type beforeEach, type ExpectStatic, type SuiteAPI, type TestAPI } from "vitest"; import { type IFileStorage } from "../../../file-storage/contracts/_module.js"; import { type ISerde } from "../../../serde/contracts/_module.js"; import { type ITimeSpan } from "../../../time-span/contracts/_module.js"; import { type Promisable } from "../../../utilities/_module.js"; /** * IMPORT_PATH: `"@daiso-tech/core/file-storage/test-utilities"` * @group TestUtilities */ export type FileStorageTestSuiteSettings = { expect: ExpectStatic; test: TestAPI; describe: SuiteAPI; beforeEach: typeof beforeEach; createFileStorage: () => Promisable<{ fileStorage: IFileStorage; serde: ISerde; }>; /** * @default false */ excludeEventTests?: boolean; /** * @default false */ excludeSerdeTests?: boolean; /** * @default * ```ts * import { TimeSpan } from "@daiso-tech/core/time-span" * * TimeSpan.fromMilliseconds(10) * ``` */ eventDispatchWaitTime?: ITimeSpan; }; /** * The `fileStorageTestSuite` function simplifies the process of testing your custom implementation of {@link IFileStorage | `IFileStorage`} with `vitest`. * * IMPORT_PATH: `"@daiso-tech/core/file-storage/test-utilities"` * @group TestUtilities */ export declare function fileStorageTestSuite(settings: FileStorageTestSuiteSettings): void;