The options passed into the constructor of clazz are taking from the options parameter.
This function allows the user to define mock- or test objects as service references.
Most type-checking features are disabled for convenience, but by default this function's types
enforce that a value provided for a reference must match the partial interface of the actually required type.
For example, if a service depends on { ctx: ApplicationContext }, this function ensures
that the test value for ctx implements Partial<ApplicationContext>.
This can of course be disabled by casting the value explicitly.
Creates a new service instance of
clazz.The options passed into the constructor of
clazzare taking from theoptionsparameter.This function allows the user to define mock- or test objects as service references.
Most type-checking features are disabled for convenience, but by default this function's types enforce that a value provided for a reference must match the partial interface of the actually required type.
For example, if a service depends on
{ ctx: ApplicationContext }, this function ensures that the test value forctximplementsPartial<ApplicationContext>. This can of course be disabled by casting the value explicitly.