Function circuitBreakerStorageAdapterTestSuite

  • The circuitBreakerStorageAdapterTestSuite function simplifies the process of testing your custom implementation of ICircuitBreakerStorageAdapter with vitest.

    IMPORT_PATH: "@daiso-tech/core/circuit-breaker/test-utilities"

    Returns void

    import { afterEach, beforeEach, describe, expect, test } from "vitest";
    import { circuitBreakerStorageAdapterTestSuite } from "@daiso-tech/core/circuit-breaker/test-utilities";
    import { MemoryCircuitBreakerStorageAdapter } from "@daiso-tech/core/circuit-breaker/memory-circuit-breaker-storage-adapter";
    import { TimeSpan } from "@daiso-tech/core/time-span" from "@daiso-tech/core/time-span";
    import { SuperJsonSerdeAdapter } from "@daiso-tech/core/serde/super-json-serde-adapter";
    import { Serde } from "@daiso-tech/core/serde";

    describe("class: MemoryCircuitBreakerStorageAdapter", () => {
    circuitBreakerStorageAdapterTestSuite({
    createAdapter: () =>
    new MemoryCircuitBreakerStorageAdapter(),
    test,
    beforeEach,
    expect,
    describe,
    });
    });