redisNotifyProviderConformanceCases

Variable

Signature

const redisNotifyProviderConformanceCases: ConformanceTestCase<NotifyAdapterConformanceContext>[];

redis/src/conformance/notify-provider-conformance.ts:67

Every notify adapter contract case, run through createRedisNotifyAdapter over a provider. Run them one per test in your own test file against a context from createRedisNotifyProviderConformanceContext. Works with any test runner.

Example

TypeScript

import { afterAll, test } from "vitest";

const client = new Redis(url);
const subscribeClient = new Redis(url);
const context = createRedisNotifyProviderConformanceContext({
  createNotifyProvider: async () => createIoredisNotifyProvider({ client, subscribeClient }),
});
afterAll(async () => {
  await client.quit();
  await subscribeClient.quit();
});

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

Used in guides

esc

Search guides, integrations and every exported symbol.

↑ ↓ to navigate↵ to open