Skip to main content

TestDatabases.create()

Home > @backstage/backend-test-utils > TestDatabases > create

Creates an empty TestDatabases instance, and sets up Jest to clean up all of its acquired resources after all tests finish.

You typically want to create just a single instance like this at the top of your test file or describe block, and then call init many times on that instance inside the individual tests. Spinning up a "physical" database instance takes a considerable amount of time, slowing down tests. But initializing a new logical database inside that instance using init is very fast.

Signature:

static create(options?: {
ids?: TestDatabaseId[];
disableDocker?: boolean;
}): TestDatabases;

Parameters

Parameter

Type

Description

options

{ ids?: TestDatabaseId[]; disableDocker?: boolean; }

(Optional)

**Returns:**

TestDatabases