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