Skip to main content
zerotal

Documentation


Documentation / @zerotal/testing / index / RefreshDatabaseOptions

Interface: RefreshDatabaseOptions

Defined in: testing/src/refreshDatabase.ts:20

Properties

connection?

optional connection?: SQLInstance

Defined in: testing/src/refreshDatabase.ts:21


migrate?

optional migrate?: string | boolean

Defined in: testing/src/refreshDatabase.ts:28

Build the schema by running the project's migrations before the suite. true uses database/migrations; pass a string for a different directory.

Prefer this over hand-written DDL in setup — see migrateDatabase.


setup?

optional setup?: (db) => void | Promise<void>

Defined in: testing/src/refreshDatabase.ts:29

Parameters

db

SQLInstance

Returns

void | Promise<void>


teardown?

optional teardown?: (db) => void | Promise<void>

Defined in: testing/src/refreshDatabase.ts:30

Parameters

db

SQLInstance

Returns

void | Promise<void>