Takeout Fixture Factory
Fixture factory package for Takeout
Installation
yarn add @takeout/fixture-factory
Usage
// User.fixture.js
import faker from 'faker'
import FixtureFactory from '@takeout/fixture-factory'
function user () {
return {
name: faker.name.findName(),
email: faker.internet.email()
}
}
export default new FixtureFactory(user)
import fixture from './User.fixture.js'
fixture.create()
fixture.get('name') // Yazmin Veum
fixture.data // { name: 'Maddison Roob', email: 'joe.smith@gmail.com' }
Publish package to NPM
- Update version in
package.json
{
"version": "1.0.1"
}
- Build the package
yarn build
- Deploy to NPM registery
npm publish