UNPKG

@eflexsystems/factory-bot

Version:

A factory library for Node.js and JavaScript inspired by factory_girl

9 lines (7 loc) 297 B
import Generator from './Generator.js' export default class Assoc extends Generator { async generate(name, key = null, attrs = {}, buildOptions = {}) { const model = await this.factoryGirl.create(name, attrs, buildOptions) return key ? this.getAttribute(name, model, key) : model } }