Skip to main content
zerotal

Documentation


Documentation / zerotal / testing / assertDatabaseCount

Function: assertDatabaseCount()

assertDatabaseCount(table, expected, where?): Promise<void>

Defined in: packages/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 });