redisStateProviderConformanceCases

VariableExperimental

Signature

const redisStateProviderConformanceCases: ConformanceTestCase<RedisStateProviderConformanceContext>[];

redis/src/conformance/state-provider-conformance.ts:296

The provider's eval contract followed by every state adapter contract case the Redis state adapter meets, including the checks of its schema write fence, run through createRedisStateAdapter over a provider. Run them one per test in your own test file against a context from createRedisStateProviderConformanceContext. Works with any test runner.

Example

TypeScript

import { afterAll, test } from "vitest";

const client = new Redis(url);
const context = createRedisStateProviderConformanceContext({
  createStateProvider: async () => createIoredisStateProvider({ client }),
});
afterAll(async () => {
  await client.quit();
});

for (const conformanceCase of redisStateProviderConformanceCases) {
  test(conformanceCase.title, async () => {
    await conformanceCase.run(context);
  });
}

Used in guides

esc

Search guides, integrations and every exported symbol.

↑ ↓ to navigate↵ to open