Skip to main content

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.

identity()
rootConfig(options)
rootLogger(options)
tokenManager()
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
httpAuth
httpRouter
identity
lifecycle
logger
permissions
rootConfig
rootHttpRouter
rootLifecycle
rootLogger
scheduler
tokenManager
urlReader
userInfo