@takeout/fixture-factory

Fixture factory package for Takeout

Usage no npm install needed!

<script type="module">
  import takeoutFixtureFactory from 'https://cdn.skypack.dev/@takeout/fixture-factory';
</script>

README

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

  1. Update version in package.json
{
  "version": "1.0.1"
}
  1. Build the package
yarn build
  1. Deploy to NPM registery
npm publish