Documentation / @zerotal/testing / index / assertDatabaseCount
Function: assertDatabaseCount()
assertDatabaseCount(
table,expected,where?):Promise<void>
Defined in: testing/src/assertions.ts:53
Assert that table contains exactly expected rows (optionally filtered by where).
Parameters
table
string
expected
number
where?
Record<string, unknown> = {}
Returns
Promise<void>
Example
await assertDatabaseCount('users', 3);
await assertDatabaseCount('posts', 1, { published: 1 });