testCooldownStore
function in meocord/testing Since 4.1.0
testCooldownStore(
name: string,
factory: () => CooldownStore | Promise<CooldownStore>,
framework: CooldownStoreSuiteFramework,
): voidChecks that a CooldownStore counts calls as MemoryCooldownStore does, as a suite of test cases.
Use it for a store you write over a database, or one you configure, such as Redis. It registers one describe of
cases with the framework you pass, so it runs under Vitest, Jest or any runner with the same three functions.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | What the store is called in the report. |
factory | () => CooldownStore | Promise<CooldownStore> | Makes the store to check, once per case. |
framework | CooldownStoreSuiteFramework | The test framework's |
Examples
import { describe, expect, it } from 'vitest'
testCooldownStore('MemoryCooldownStore', () => new MemoryCooldownStore(), { describe, it, expect })