Skip to main content
Version: Next

mockServices

Home > @backstage/backend-test-utils > mockServices

Signature:

namespace mockServices 

Functions

FunctionDescription
auth(options)
discovery()
httpAuth(options)

Creates a mock implementation of the HttpAuthService.

By default all requests without credentials are treated as requests from the default mock user principal. This behavior can be configured with the defaultCredentials option.

rootConfig(options)
rootLogger(options)
userInfo(customInfo)

Creates a mock implementation of the UserInfoService.

By default it extracts the user's entity ref from a user principal and returns that as the only ownership entity ref, but this can be overridden by passing in a custom set of user info.

Namespaces

NamespaceDescription
auth
cache
database
discovery
events
httpAuth
httpRouter
lifecycle
logger
permissions
rootConfig
rootHealth
rootHttpRouter
rootLifecycle
rootLogger
scheduler
urlReader
userInfo