Trails Packages
    Preparing search index...
    • Creates a new service instance of clazz.

      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.

      Type Parameters

      • References extends {}
      • Interface extends {}

      Parameters

      Returns Service<Interface>

      a new instance of the given service class