Skip to content

smooth-code/factory-girl-objection-adapter

Repository files navigation

factory-girl-objection-adapter

travis npm

This module brings objection support to factory-girl.

npm install factory-girl-objection-adapter

Usage

import { factory } from 'factory-girl'
import ObjectionAdapter from 'factory-girl-objection-adapter'
import User from './models/User'

factory.setAdapter(new ObjectionAdapter())

factory.define('user', User, {
  name: factory.chance('name'),
  email: factory.chance('email'),
})

export default factory

License

MIT