Skip to main content

@backstage/backend-test-utils

Home > @backstage/backend-test-utils

Test helpers library for Backstage backends

Classes

ClassDescription
ServiceFactoryTesterA utility to help test service factories in isolation.
TestDatabasesEncapsulates the creation of ephemeral test database instances for use inside unit or integration tests.

Functions

FunctionDescription
createMockDirectory(options)Creates a new temporary mock directory that will be removed after the tests have completed.
isDockerDisabledForTests()
setupRequestMockHandlers(worker)Sets up handlers for request mocking
startTestBackend(options)

Interfaces

InterfaceDescription
MockDirectoryA utility for creating a mock directory that is automatically cleaned up.
MockDirectoryContentCallbackContextA context that allows for more advanced file system operations when writing mock directory content.
MockDirectoryContentOptionsOptions for MockDirectory.content().
MockDirectoryOptionsOptions for createMockDirectory().
ServiceFactoryTesterOptionsOptions for ServiceFactoryTester.
TestBackend
TestBackendOptions

Namespaces

NamespaceDescription
mockCredentials
mockServices

Type Aliases

Type AliasDescription
MockDirectoryContentThe content of a mock directory represented by a nested object structure.
MockDirectoryContentCallbackA callback that allows for more advanced file system operations when writing mock directory content.
ServiceMock
TestDatabaseIdThe possible databases to test against.