Skip to main content
zerotal

Documentation


Documentation / @zerotal/testing / index / assertDatabaseHas

Function: assertDatabaseHas()

assertDatabaseHas(table, where): Promise<void>

Defined in: testing/src/assertions.ts:33

Assert that at least one row in table matches all key/value pairs in where.

Parameters

table

string

where

Record<string, unknown>

Returns

Promise<void>

Example

await assertDatabaseHas('users', { email: 'alice@example.com' });