{"_id":"@synconset/factory-girl","_rev":"88-f00883629135ec30df2dc5d7156f96cf","name":"@synconset/factory-girl","dist-tags":{"latest":"5.0.4"},"versions":{"5.0.2":{"name":"@synconset/factory-girl","version":"5.0.2","keywords":["factory","test","bdd","tdd","fixture"],"author":"","license":"MIT","_id":"@synconset/factory-girl@5.0.2","maintainers":[{"name":"dmcnamara1","email":"dmcnamara1@gmail.com"},{"name":"natealmeida","email":"nate.almeida@gmail.com"},{"name":"sdushay","email":"sdushay@gmail.com"},{"name":"thekiteeatingtree","email":"thekiteeatingtree@gmail.com"}],"homepage":"https://github.com/aexmachina/factory-girl#readme","bugs":{"url":"http://github.com/aexmachina/factory-girl/issues"},"dist":{"shasum":"eb7830efab43eb42be9a7174496ae2ce853ff999","tarball":"https://registry.npmjs.org/@synconset/factory-girl/-/factory-girl-5.0.2.tgz","fileCount":77,"integrity":"sha512-LAVzC30M07CncKa1yqbVqRbTdgAAbxSyTSElpRgbTo8te6lPt1YPdI5TLHnu5149mEd7odqOe+Zgo2Hj98DF0A==","signatures":[{"sig":"MEYCIQCohXvnufMD3VPI83NkPvfrXXoZ3gAed6XFjnnXezLRXwIhAJ9OM9OqqCxD/eZOXtWCqP5xKZZSBvoSj7ltHZNszBvc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":987168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6gbOCRA9TVsSAnZWagAArqcP/2hV6yevvfXAK+RPSwsS\nm8YzpeNiwQDty54drK5Yx96BGjDuhMPN8gSrxZMX6lEAVPj2VNdz9ipt3QXg\nKu0SYBMNx9eGE0qdipBsv5ijw/3LiF7M+DuZWtEb8ibe7fHs/MwI+FZ1VnSL\nxsdQlUyDs5fT0R6CY/ENdxdM+Oowm9zBvRAaUUYik2SF6M+398eASVz50DlP\nCHvMocVsOGposjxDmwNmLazH4VQVGA3K+TVo8MRRxhi+vLtvZib+PVGVo1OA\nVWM76D8TeSbeTz3au64V+a63/CktcGX8GUf7JAxwRhziP1wAdb+GjKaDqw3h\n41POHfn7wdqIqDytIlXNLvLFp/rloP0dLQZ736FhKbZgKAtTRFDKT+QRnPBC\nvITQ9Y77B53FKlNJQ809NWTPQEH+QqISgKhuNR847al2k1WPSwJsYaIVTLem\nhffBHnfy2Gh9FRptj2HV61bPXEM+lnbrFQPyHQuS5dPbTlTCqtlwyLxWVu2Y\notPYROsLHhKL8517gvWph1p0EfKiSl3p1UXn0ixK8PxxaxAivJIDCzhiDLo6\nHpJCbm0Wl/L75Y7tdESc52fuVz+NNx0pwQXsDMZ45klGHbLVgSZ+DMExoViC\n8qVPXRNqKFi4QQN+i1yXOriPtAKwMzSCe853IcTbcioZS6atajhE+5VAGJTo\nCc2H\r\n=Qo7p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./src/index","babel":{"plugins":["transform-runtime","transform-class-properties"],"presets":["es2015","stage-0"]},"gitHead":"71f1f01845a8032f61c5020926aee8d0b57ad875","scripts":{"lint":"eslint src test tools","test":"NODE_ENV=test mocha","build":"node tools/build","prepublish":"npm run test && npm run build","test:cover":"NODE_ENV=test babel-node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha"},"_npmUser":{"name":"thekiteeatingtree","email":"thekiteeatingtree@gmail.com"},"licenses":[{"url":"http://github.com/aexmachina/factory-girl/raw/master/LICENSE","type":"MIT"}],"repository":{"url":"git+ssh://git@github.com/aexmachina/factory-girl.git","type":"git"},"_npmVersion":"6.0.0","description":"A factory library for Node.js and JavaScript inspired by factory_girl","directories":{},"_nodeVersion":"8.9.4","dependencies":{"chance":"^1.0.4","babel-runtime":"^6.11.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"del":"^2.2.0","chai":"^3.5.0","knex":"^0.11.7","mocha":"^2.5.3","sinon":"^2.0.0","eslint":"^2.11.1","rollup":"^0.27.0","should":"^6.0.3","sqlite3":"^3.1.4","babelify":"^7.3.0","bluebird":"^2.9.25","istanbul":"^1.0.0-alpha.2","mongoose":"^4.5.4","babel-cli":"^6.8.0","bookshelf":"^0.10.0","redux-orm":"^0.9.0-rc.3","sequelize":"^3.24.0","babel-core":"^6.8.0","browserify":"^13.1.0","sinon-chai":"^2.0.0","babel-eslint":"^6.0.4","mocha-eslint":"^2.1.1","babel-register":"^6.9.0","chai-as-promised":"^5.3.0","babel-preset-es2015":"^6.6.0","eslint-plugin-mocha":"^3.0.0","eslint-plugin-react":"^5.1.1","rollup-plugin-babel":"^2.5.0","babel-preset-stage-0":"^6.5.0","eslint-config-airbnb":"^9.0.1","eslint-plugin-import":"^1.8.1","eslint-plugin-jsx-a11y":"^1.3.0","babel-preset-es2015-rollup":"^1.1.1","babel-plugin-transform-runtime":"^6.8.0"},"_npmOperationalInternal":{"tmp":"tmp/factory-girl_5.0.2_1525286604777_0.38551660025106194","host":"s3://npm-registry-packages"}},"5.0.3":{"name":"@synconset/factory-girl","version":"5.0.3","keywords":["factory","test","bdd","tdd","fixture"],"author":"","license":"MIT","_id":"@synconset/factory-girl@5.0.3","maintainers":[{"name":"dmcnamara1","email":"dmcnamara1@gmail.com"},{"name":"natealmeida","email":"nate.almeida@gmail.com"},{"name":"sdushay","email":"sdushay@gmail.com"},{"name":"thekiteeatingtree","email":"thekiteeatingtree@gmail.com"}],"homepage":"https://github.com/aexmachina/factory-girl#readme","bugs":{"url":"http://github.com/aexmachina/factory-girl/issues"},"dist":{"shasum":"8f5a095f2d5a2595d33a18e5caa40d7d2ad43dc0","tarball":"https://registry.npmjs.org/@synconset/factory-girl/-/factory-girl-5.0.3.tgz","fileCount":10,"integrity":"sha512-UPCPxoSd+O3hjqCn5nB/P9ReGi74NodhQSpktwB8D7XuAMmxjyGIuCTTD8N4udyi5fkZ6wk01RehGuoq4AzVuQ==","signatures":[{"sig":"MEUCIHXC55l63UH/lEssCnEmImlBkqPGYBqJesKPxU0+WMV7AiEAw5lfAuUofarjk97nlJpSYDufMdfjAdW3JN4kogKXN/M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":850035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6gf5CRA9TVsSAnZWagAAtbgQAJZxneilt1kv1x4hhTTd\ndLaj6zcRgBmso740nzJiRzYgq/AHKcjcmVoDmNpk1QNGhvvB/mBfYwYkqjZp\necdZTqnQUsvwJ3+frCDqzMteAekmrBOjcNEP1QcVRyq+MRZpfeBw83DPea0F\n0+g5LI8qmtXGpdf3FFogQgB3mv4l5WltLqLMC/3CC49KniRxHD1rwzv9b/BD\noMJvrJZUtnNc8/P28iRrT+str1Shliat6kyyZznq39yRLObEcI2PW/p4mb/Q\nT1xUdY6aSa8uUlgUt5Q2g0/sgqrZOvcjuumcrmAsPTutV4bPrEdSJEEO28kw\n2pdN50eTNBmzES9fL+gY1iggZeVQ5uxRNS1R2qlijPEVhTgbbEpjuOonHXJV\nKT3VoDWoFrghDJUHVyrKNvQyfAGxN3VPGbZkX8IRt54oCyxA7eFXPA2mBNhc\nZ4IrQHmQjKnXt9ba1jWMymlVTn5tI9ZQoEmpmQzTzoh65xiEP7rIRhTowM0q\nB71ff1oipJDmFrChOXs8+R8kWQgHOQQHcyR0lZxzl/IFdgSrQ+zrPCchi3HP\n9PaT6Nx5bMuv1BXvMzm8vq/dlvbWJ+5v485gFrqi/o4bfOovtIooSlBEu1ir\ntkQ2qIq+4V/GXTcm2w1GUinCaXBo0atQAoiCnK8+ldQeM4UTSocJwlNFabPY\nr0x1\r\n=DkBA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./src/index","_npmUser":{"name":"thekiteeatingtree","email":"thekiteeatingtree@gmail.com"},"licenses":[{"url":"http://github.com/aexmachina/factory-girl/raw/master/LICENSE","type":"MIT"}],"repository":{"url":"git+ssh://git@github.com/aexmachina/factory-girl.git","type":"git"},"_npmVersion":"6.0.0","description":"A factory library for Node.js and JavaScript inspired by factory_girl","directories":{},"_nodeVersion":"8.9.4","dependencies":{"chance":"^1.0.4","babel-runtime":"^6.11.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/factory-girl_5.0.3_1525286903882_0.5978320845877387","host":"s3://npm-registry-packages"}},"5.0.4":{"name":"@synconset/factory-girl","version":"5.0.4","keywords":["factory","test","bdd","tdd","fixture"],"author":"","license":"MIT","_id":"@synconset/factory-girl@5.0.4","maintainers":[{"name":"epjuribe","email":"juribe@ep.com"},{"name":"mpawar0910","email":"mpawar@ep.com"},{"name":"nelson4183","email":"nelson4183@gmail.com"},{"name":"etrangep","email":"etrang@ep.com"},{"name":"bsinhaatep","email":"bsinha@ep.com"},{"name":"sivakrishna","email":"ssingasani@ep.com"},{"name":"kotes-sos","email":"kmannam@ep.com"},{"name":"sveeramala","email":"sveeramala@ep.com"},{"name":"dinesh1312","email":"ddaki@ep.com"},{"name":"praveenpalavali","email":"ppalavali@ep.com"},{"name":"renjith-ep","email":"rrajasekharan@ep.com"},{"name":"vijaykumarep","email":"vkolakaluri@ep.com"},{"name":"prsingh","email":"prsingh@ep.com"},{"name":"kg094467","email":"kgodavarthi@ep.com"},{"name":"ddunhamep","email":"ddunham@ep.com"},{"name":"nesarahippla","email":"nduggegowda@ep.com"},{"name":"kkeshmiri","email":"kkeshmiri@ep.com"},{"name":"rpowers11","email":"rpowers@ep.com"},{"name":"attilivenkat","email":"vattili@ep.com"}],"homepage":"https://github.com/wymsee/factory-girl#readme","bugs":{"url":"https://github.com/wymsee/factory-girl/issues"},"dist":{"shasum":"0ac853458481cb5708733c2f9dd6cecaf89612fa","tarball":"https://registry.npmjs.org/@synconset/factory-girl/-/factory-girl-5.0.4.tgz","fileCount":77,"integrity":"sha512-TuQxvdyQpHenxRgHzFL/W39rDVd6Vn9Bn04/QxltG2rPetLfLajrOr88omornrvexXFrm1PWaz2qHoeGe0Q9ZA==","signatures":[{"sig":"MEUCIQDndtxsaWJ7yc+44e+jH4vm8ZWPuuqcfw8rq/mpGY5XlwIgLKDHXcj05tI9uAHk+//mc5XLaSCV4nQPG8VFKfn76Go=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":892153},"main":"index.js","babel":{"plugins":["transform-runtime","transform-class-properties"],"presets":["es2015","stage-0"]},"gitHead":"8cd171f25871aca2892084863e2c240ccd36af05","scripts":{"lint":"eslint src test tools","test":"NODE_ENV=test mocha","build":"node tools/build","prepublish":"npm run test && npm run build","test:cover":"NODE_ENV=test babel-node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha"},"_npmUser":{"name":"kg094467","email":"kgodavarthi@ep.com"},"licenses":[{"url":"http://github.com/aexmachina/factory-girl/raw/master/LICENSE","type":"MIT"}],"repository":{"url":"git+https://github.com/wymsee/factory-girl.git","type":"git"},"_npmVersion":"10.5.0","description":"A factory library for Node.js and JavaScript inspired by factory_girl","directories":{},"_nodeVersion":"18.20.2","dependencies":{"chance":"^1.0.4","babel-runtime":"^6.11.6"},"_hasShrinkwrap":false,"devDependencies":{"del":"^2.2.0","chai":"^3.5.0","knex":"^0.11.7","mocha":"^2.5.3","sinon":"^7.1.1","eslint":"^2.11.1","rollup":"^0.27.0","should":"^6.0.3","sqlite3":"^3.1.4","babelify":"^7.3.0","bluebird":"^2.9.25","istanbul":"^1.0.0-alpha.2","mongoose":"^4.5.4","babel-cli":"^6.8.0","bookshelf":"^0.10.0","redux-orm":"^0.9.0-rc.3","sequelize":"^3.24.0","babel-core":"^6.8.0","browserify":"^13.1.0","sinon-chai":"^3.2.0","babel-eslint":"^6.0.4","mocha-eslint":"^2.1.1","babel-register":"^6.9.0","chai-as-promised":"^5.3.0","babel-preset-es2015":"^6.6.0","eslint-plugin-mocha":"^3.0.0","eslint-plugin-react":"^5.1.1","rollup-plugin-babel":"^2.5.0","babel-preset-stage-0":"^6.5.0","eslint-config-airbnb":"^9.0.1","eslint-plugin-import":"^1.8.1","eslint-plugin-jsx-a11y":"^1.3.0","babel-preset-es2015-rollup":"^1.1.1","babel-plugin-transform-runtime":"^6.8.0"},"_npmOperationalInternal":{"tmp":"tmp/factory-girl_5.0.4_1731709882445_0.48676076528262535","host":"s3://npm-registry-packages"}}},"time":{"created":"2018-05-02T18:43:24.714Z","modified":"2026-05-20T07:22:25.833Z","5.0.2":"2018-05-02T18:43:24.858Z","5.0.3":"2018-05-02T18:48:24.131Z","5.0.4":"2024-11-15T22:31:22.726Z"},"bugs":{"url":"https://github.com/wymsee/factory-girl/issues"},"license":"MIT","homepage":"https://github.com/wymsee/factory-girl#readme","keywords":["factory","test","bdd","tdd","fixture"],"repository":{"url":"git+https://github.com/wymsee/factory-girl.git","type":"git"},"description":"A factory library for Node.js and JavaScript inspired by factory_girl","maintainers":[{"email":"kmannam@ep.com","name":"kotes-sos"},{"email":"ppalavali@ep.com","name":"praveenpalavali"},{"email":"rrajasekharan@ep.com","name":"renjith-ep"},{"email":"prsingh@ep.com","name":"prsingh"},{"email":"ddunham@ep.com","name":"ddunhamep"},{"email":"nduggegowda@ep.com","name":"nesarahippla"},{"email":"rpowers@ep.com","name":"rpowers11"},{"email":"bsinha@ep.com","name":"bsinhaatep"},{"email":"mpawar@ep.com","name":"mpawar0910"},{"email":"nelson4183@gmail.com","name":"nelson4183"},{"email":"amahale@ep.com","name":"amahaleep"},{"email":"gjafrain@ep.com","name":"gouravep"},{"email":"bkumar@ep.com","name":"baleshkumar-ep"},{"email":"ssingasani@ep.com","name":"sivakrishna"},{"email":"rg@ep.com","name":"ravig-ep"}],"readme":"# factory-girl\n\n[![Build Status](https://travis-ci.org/aexmachina/factory-girl.png)](https://travis-ci.org/aexmachina/factory-girl)\n\n`factory-girl` is a factory library for [Node.js](http://nodejs.org/) and the browser that is inspired by [Factory\\_girl](http://github.com/thoughtbot/factory_girl). It works asynchronously and supports associations and the use of functions for generating attributes.\n\n## Installation\n\nNode.js:\n\n```bash\nnpm install factory-girl\n```\n\nTo use `factory-girl` in the browser or other JavaScript environments, there are\nbuilds for numerous module systems in the `dist/` directory.\n\n## Usage\n\nRefer to [the tutorial](docs/tutorial.md) for a gentle introduction of building a simple\nuser factory.\n\nHere's the crash course:\n\n```javascript\nconst factory = require('factory-girl').factory;\nconst User    = require('../models/user');\n\nfactory.define('user', User, {\n  username: 'Bob',\n  score: 50,\n});\n\nfactory.build('user').then(user => {\n  console.log(user); // => User {username: 'Bob', score: 50}\n});\n```\n\n## Defining Factories\n\nDefine factories using the `factory.define()` method.\n\nFor example:\n\n```javascript\n// Using objects as initializer\nfactory.define('product', Product, {\n  // use sequences to generate values sequentially\n  id: factory.sequence('Product.id', (n) => `product_${n}`),\n  // use functions to compute some complex value\n  launchDate: () => new Date(),\n  // return a promise to populate data asynchronously\n  asyncData: () => fetch('some/resource'),\n});\nfactory.define('user', User, {\n  // seq is an alias for sequence\n  email: factory.seq('User.email', (n) => `user${n}@ymail.com`),\n\n  // use the chance(http://chancejs.com/) library to generate real-life like data\n  about: factory.chance('sentence'),\n\n  // use assoc to associate with other models\n  profileImage: factory.assoc('profile_image', '_id'),\n\n  // or assocMany to associate multiple models\n  addresses: factory.assocMany('address', 2, '_id'),\n\n  // use assocAttrs to embed models that are not persisted\n  creditCardNumber: factory.assocAttrs('credit_card', 'number', {type: 'masterCard'}),\n\n  // use assocAttrs or assocAttrsMany to embed plain json objects\n  twitterDetails: factory.assocAttrs('twitter_details'),\n});\n```\n\n```javascript\n// Using functions as initializer\nfactory.define('account', Account, buildOptions => {\n  let attrs = {\n    confirmed: false,\n    confirmedAt: null\n  };\n\n  // use build options to modify the returned object\n  if (buildOptions.confirmedUser) {\n    attrs.confirmed = true;\n    attrs.confirmedAt = new Date();\n  }\n  return attrs;\n});\n\n// buildOptions can be passed while requesting an object\nfactory.build('account', {}, {confirmed: true});\n```\n\n### Options\n\nOptions can be provided when you define a factory:\n\n```javascript\nfactory.define('user', User, { foo: 'bar' }, options);\n```\n\nAlternatively you can set options for the factory that will get applied for all model-factories:\n\n```javascript\nfactory.withOptions(options);\n```\n\nCurrently the supported options are:\n\n#### `afterBuild: function(model, attrs, buildOptions)`\n\nProvides a function that is called after the model is built.\nThe function should return the instance or a Promise for the instance.\n\n#### `afterCreate: function(model, attrs, buildOptions)`\n\nProvides a function that is called after a new model instance is saved. The function\nshould return the instance or throw an error. For asynchronous functions, it should return\na promise that resolves with the instance or rejects with the error.\n\n```javascript\nfactory.define('user', User, {foo: 'bar'}, {\n  afterBuild: (model, attrs, buildOptions) => {\n    return doSomethingAsync(model).then(() => {\n      doWhateverElse(model);\n      return model;\n    });\n  },\n  afterCreate: (model, attrs, buildOptions) => {\n    modify(model);\n    if ('something' === 'wrong') {\n      throw new Error;\n    }\n    maybeLog('something');\n    return model;\n  }\n});\n```\n\n### Extending Factories\n\nYou can extend a factory using `#extend`:\n\n```js\nfactory.define('user', User, { username: 'Bob', expired: false });\nfactory.extend('user', 'expiredUser', { expired: true });\nfactory.build('expiredUser').then(user => {\n  console.log(user); // => User { username: 'Bob', expired: true });\n});\n```\n\n### `#extend(parent, name, initializer, options = {})`\n\nThe `#extend` method takes the same options as `#define` except you \ncan provide a different `Model` using `options.model`.\n\n## Using Factories\n\n### Factory#attrs\n\nGenerates and returns model attributes as an object hash instead of the model instance.\nThis may be useful where you need a JSON representation of the model e.g. mocking an API\nresponse.\n\n```javascript\nfactory.attrs('post').then(postAttrs => {\n  // postAttrs is a json representation of the Post model\n});\n\nfactory.attrs('post', {title: 'Foo', content: 'Bar'}).then(postAttrs => {\n  // builds post json object and overrides title and content\n});\n\nfactory.attrs('post', {title: 'Foo'}, {hasComments: true}).then(postAttrs => {\n  // builds post json object\n  // overrides title\n  // invokes the initializer function with buildOptions of {hasComments: true}\n});\n```\n\nYou can use `Factory#attrsMany` to generate a set of model attributes\n\n```javascript\nfactory.attrsMany('post', 5, [{title: 'foo1'}, {title: 'foo2'}]).then(postAttrsArray => {\n  // postAttrsArray is an array of 5 post json objects\n  debug(postAttrsArray);\n});\n```\n\n### Factory#build\n\nBuilds a new model instance that is not persisted.\n\n```javascript\nfactory.build('post').then(post => {\n  // post is a Post instance that is not persisted\n});\n```\n\nThe `buildMany` version builds an array of model instances.\n\n```javascript\nfactory.buildMany('post', 5).then(postsArray => {\n  // postsArray is an array of 5 Post instances\n});\n```\n\nSimilar to `Factory#attrs`, you can pass attributes to override or buildOptions.\n\n### Factory#create(name, attrs, buildOptions)\n\nBuilds a new model instance that is persisted.\n\n```js\nfactory.create('post').then(post => {\n  // post is a saved Post instance\n});\n```\n\n### Factory#createMany(name, num, attrs, buildOptions = {})\n\nThe createMany version creates an array of model instances.\n\n```javascript\nfactory.createMany('post', 5).then(postsArray => {\n  // postsArray is an array of 5 Post saved instances\n});\n```\n\nSimilar to `Factory#attrs` and `Factory#build`, you can pass `attrs` to override and\n`buildOptions`. If you pass an array of `attrs` then each element of the array will be\nused as the attrs for a each model created.\n\n### Factory#createMany(name, attrs, buildOptions = {})\n\nIf you can pass an array of `attrs` then you can omit `num` and the length of the array\nwill be used.\n\n### Factory#cleanUp\n\nDestroys all of the created models. This is done using the adapter's `destroy` method.\nIt might be useful to clear all created models before each test or testSuite.\n\n## Adapters\n\nAdapters provide support for different databases and ORMs. Adapters can be registered for\nspecific models, or as the 'default adapter', which is used for any models for which an\nadapter has not been specified. See the adapter docs for usage, but typical usage is:\n\n```javascript\nconst FactoryGirl = require('factory-girl');\nconst factory = FactoryGirl.factory;\nconst adapter = new FactoryGirl.MongooseAdapter();\n\n// use the mongoose adapter as the default adapter\nfactory.setAdapter(adapter);\n\n// Or use it only for one model-factory\nfactory.setAdapter(adapter, 'factory-name');\n```\n\n### ObjectAdapter\n\n`ObjectAdapter` is a simple adapter that uses `const model = new MyModel()`,\n`model.save()` and `model.destroy()`.\n\n```js\nfactory.setAdapter(new factory.ObjectAdapter());\nclass MyModel {\n  save() {\n    // save the model\n  },\n  destroy() {\n    // destroy the model\n  }\n}\nfactory.define('model', MyModel);\n```\n\n## Creating new Factories\n\nYou can create multiple factories which have different settings:\n\n```javascript\nlet anotherFactory = new factory.FactoryGirl();\nanotherFactory.setAdapter(new MongooseAdapter()); // use the Mongoose adapter\n```\n\n## History\n\nThis module started out as a fork of\n[factory-lady](https://github.com/petejkim/factory-lady), but the fork deviated quite a\nbit. This module uses an adapter to talk to your models so it can support different ORMs\nsuch as [Bookshelf](https://github.com/aexmachina/factory-girl-bookshelf),\n[Sequelize](https://github.com/aexmachina/factory-girl-sequelize),\n[JugglingDB](https://github.com/rehanift/factory-girl-jugglingdb), and\n[Mongoose](https://github.com/jesseclark/factory-girl-mongoose) (and doesn't use `throw`\nfor errors that might occur during save).\n\nVersion 4.0 is a complete rewrite with thanks to @chetanism.\n\n## License\n\nCopyright (c) 2016 Chetan Verma.  \nCopyright (c) 2014 Simon Wade.\nCopyright (c) 2011 Peter Jihoon Kim.  \n\nThis software is licensed under the [MIT\nLicense](http://github.com/aexmachina/factory-girl/raw/master/LICENSE.txt).\n","readmeFilename":"README.md"}