@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.
37 lines (36 loc) • 1.25 kB
TypeScript
/**
* @module Serde
*/
import { type TestAPI, type ExpectStatic } from "vitest";
import type { IFlexibleSerdeAdapter } from "../../../serde/contracts/_module-exports.js";
/**
*
* IMPORT_PATH: `"@daiso-tech/core/serde/test-utilities"`
* @group TestUtilities
*/
export type FlexibleSerdeAdapterSuiteSettings = {
expect: ExpectStatic;
test: TestAPI;
createAdapter: () => IFlexibleSerdeAdapter;
};
/**
* The `flexibleSerdeAdapterTestSuite` function simplifies the process of testing your custom implementation of {@link IFlexibleSerdeAdapter | `IFlexibleSerdeAdapter`} with `vitest`.
*
* IMPORT_PATH: `"@daiso-tech/core/serde/test-utilities"`
* @group TestUtilities
* @example
* ```ts
* import { describe, expect, test } from "vitest";
* import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/adapters";
* import { flexibleSerdeAdapterTestSuite } from "@daiso-tech/core/serde/test-utilities";
*
* describe("class: SuperJsonSerdeAdapter", () => {
* flexibleSerdeAdapterTestSuite({
* createAdapter: () => new SuperJsonSerdeAdapter(),
* expect,
* test,
* });
* });
* ```
*/
export declare function flexibleSerdeAdapterTestSuite(settings: FlexibleSerdeAdapterSuiteSettings): void;