Skip to main content
Version: Next

ServiceFactoryTester.getSubject()

Home > @backstage/backend-test-utils > ServiceFactoryTester > getSubject

Returns the service instance for the subject.

Signature:

getSubject(...args: 'root' extends TScope ? [] : [pluginId?: string]): Promise<TInstances extends 'multiton' ? TService[] : TService>;

Parameters

ParameterTypeDescription
args'root' extends TScope ? [] : [pluginId?: string]

Returns:

Promise<TInstances extends 'multiton' ? TService[] : TService>

Remarks

If the subject is a plugin scoped service factory a plugin ID can be provided to instantiate the service for a specific plugin.

By default the plugin ID 'test' is used.