GitHub

DaffReviewedProductFactory

Model Factory

import { DaffReviewedProductFactory } from '@daffodil/reviews/testing'

Factory for creating DaffReviewedProducts. It will create a product of random kind with the additional review fields.

@Injectable()
class DaffReviewedProductFactory extends DaffModelFactory<DaffReviewedProduct> {
  _instantiationArgs: ConstructorParameters<Klass>
  type: Constructable<DaffAccountRegistration, any[]>

  create(partial: Partial<DaffReviewedProduct> = {}): DaffReviewedProduct
  createMany(
    qty: number = 1
    partial: Partial<T> = {}
  ): T[]
}

() Methods

Parameters
Parameterpartial: Partial<DaffReviewedProduct>
Default{}
Description
createMany
T[]
Parameters
Parameterqty: number
Default1
Description
Parameterpartial: Partial
Default{}
Description