{"_id":"@aulamejor/sequelize-mock","_rev":"2-c9e611a9bd789545734cfcd9bcc3b2f1","name":"@aulamejor/sequelize-mock","dist-tags":{"latest":"0.10.3"},"versions":{"0.10.3":{"name":"@aulamejor/sequelize-mock","version":"0.10.3","description":"A simple mock interface specifically for testing code relying on Sequelize models","main":"src/index.js","scripts":{"precommit":"lint-staged","format":"prettier --write {src,test,scripts}/**/*.js","doc-gen":"node scripts/doc-gen.js","test":"nyc --reporter=text --reporter=html mocha","test-report":"nyc report --reporter=html","coverage":"nyc report --reporter=text-lcov","preversion":"npm test","changelog":" node scripts/version.js && git add changelog.md"},"repository":{"type":"git","url":"git+https://bitbucket.org/aulamejor_dev/com.aulamejor.sequelize-mock.git"},"author":{"name":"Aula MEJOR"},"license":"UNLICENSED","dependencies":{"bluebird":"^3.4.6","inflection":"^1.10.0","lodash":"^4.16.4"},"devDependencies":{"dox":"^0.9.0","glob":"^7.1.1","husky":"^0.14.3","istanbul":"^0.4.5","lint-staged":"^7.2.0","mocha":"^3.1.2","moment":"^2.17.1","nyc":"^8.3.1","prettier":"^1.13.5","proxyquire":"^1.7.10","should":"^11.1.1"},"nyc":{"exclude":["src/index.js"],"include":["src/**/*.js"],"all":true},"lint-staged":{"*.js":["prettier --write","git add"]},"gitHead":"f1033afdddfc185b0d94535705f3ef28c6736b8f","homepage":"https://bitbucket.org/aulamejor_dev/com.aulamejor.sequelize-mock#readme","_id":"@aulamejor/sequelize-mock@0.10.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"juanelorganelo","email":"cokenrocknroll@gmail.com"},"dist":{"integrity":"sha512-2LtueiBPgb1S15OOF4Hw4uG1VIpm5/tWaf1DG8Jtn2oFF6ZziHuvjtgScHa6L9lZIDequM7uG68pqr6LWGbTCQ==","shasum":"06b40613536deeb2ec0bd16ebad8a5d9cc71fcd3","tarball":"https://registry.npmjs.org/@aulamejor/sequelize-mock/-/sequelize-mock-0.10.3.tgz","fileCount":45,"unpackedSize":348013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKs64CRA9TVsSAnZWagAAIoQP/AmpzZsiZto0/NfnIHBk\nVJ9Rm0ZI+yr6eiQwyYWQAF8LFFHugjo26AtIbRbxssyjpilzfRaExnysnBVs\n8Gh9EvvNAJYVZ0Dv1eZ+XCwbdEiJSPVPYPi0nI8ZzceejgF/j79MgxQ3/jYx\ni9RXaX7vyH2o+oMjasa/W9fRDU9zyXWjY9PHPdvfHXHiFd9pBs4xTbl8wqDO\nNR2umXP7pEqdFoJowBbjVTlnPsNdVvj1vY/lfZUF3s1R2be9XqZp+sTAGwt7\nzEOiEaS1Ws/8VpdB6cA8IZCoeyJ1ogDiOby6uj/sDgxC4ekACteAV519BNSX\n/dLuYTctdQYxiIXAIL7VUGBWpr98RfLE3P9Kq9mXjGlyTLEyPe4qYlGrwR96\nE9euGzpGSzPvk6GNlulPO9Acb538tOZ4+tzDKRvt7+IIU3AERwZOCqj3H0cE\npxj5X1PmcawIqtBu6iAZ00HLXW5XGCFxrWh9jezIcXp5/ewRXUaJFHXS/gmv\nNXMWeHMv/FrMdSdEDOP1+9M/82o4SnYQ3YMLLoBlXsLDeJJVG4cl5yjaze3f\neApIUQuffkqxLXRfxGvoj/cwlya4tjtQQYIkkgOUypSB7cHSPwLpK+Btjul0\nCQZITQsXy/fXvC7mFhm8Mh5tNNFy307ekd27MD+7RF2r33MX4tmyxiGIdg8L\npRAF\r\n=I5iX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkrBnnjo4tww4sRIL+teSDU1eL3QEArxxMMQ21DJphLAIhAIzfax/jNXCuI5+i9QdZUkUALrbfWhhAaHz2X/FTZf2W"}]},"maintainers":[{"name":"androiderik","email":"erik.genaro@gmail.com"},{"name":"juanelorganelo","email":"cokenrocknroll@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sequelize-mock_0.10.3_1529532088041_0.6827498193655317"},"_hasShrinkwrap":false}},"time":{"created":"2018-06-20T22:01:27.793Z","0.10.3":"2018-06-20T22:01:28.184Z","modified":"2022-04-04T16:24:52.103Z"},"maintainers":[{"email":"erik.genaro@gmail.com","name":"androiderik"}],"description":"A simple mock interface specifically for testing code relying on Sequelize models","homepage":"https://bitbucket.org/aulamejor_dev/com.aulamejor.sequelize-mock#readme","repository":{"type":"git","url":"git+https://bitbucket.org/aulamejor_dev/com.aulamejor.sequelize-mock.git"},"author":{"name":"Aula MEJOR"},"license":"UNLICENSED","readme":"# Sequelize Mock\n[![npm](https://img.shields.io/npm/v/sequelize-mock.svg)](https://www.npmjs.com/package/sequelize-mock) [![CircleCI](https://img.shields.io/circleci/project/BlinkUX/sequelize-mock.svg)](https://circleci.com/gh/BlinkUX/sequelize-mock) [![Coveralls](https://img.shields.io/coveralls/BlinkUX/sequelize-mock.svg)](https://coveralls.io/github/BlinkUX/sequelize-mock) [![MIT License](https://img.shields.io/github/license/BlinkUX/sequelize-mock.svg)](https://github.com/BlinkUX/sequelize-mock) [![Documentation Status](https://readthedocs.org/projects/sequelize-mock/badge/?version=stable)](http://sequelize-mock.readthedocs.io/en/stable/?badge=stable)\n\nA mocking interface designed for testing code that uses [Sequelize](http://sequelizejs.com).\n\nDocumentation at [sequelize-mock.readthedocs.io](https://sequelize-mock.readthedocs.io/)\n\n## Install\n\n```\nnpm i sequelize-mock --save-dev\n```\n\n## Getting Started\n\nThe Mock Models created with this library function as drop in replacements for your unit testing.\n\nStart by importing the library\n\n```javascript\nvar SequelizeMock = require('sequelize-mock');\n```\n\nInitialize the library as you would Sequelize\n\n```javascript\nvar DBConnectionMock = new SequelizeMock();\n```\n\nDefine your models\n\n```javascript\nvar UserMock = DBConnectionMock.define('users', {\n\t\t'email': 'email@example.com',\n\t\t'username': 'blink',\n\t\t'picture': 'user-picture.jpg',\n\t}, {\n\t\tinstanceMethods: {\n\t\t\tmyTestFunc: function () {\n\t\t\t\treturn 'Test User';\n\t\t\t},\n\t\t},\n\t});\n```\n\nOnce Mock models have been defined, you can use them as drop-in replacements for your Sequelize model objects. Data is not retrieved from a database and instead is returned based on the setup of the mock objects, the query being made, and other applied or included information.\n\nFor example, your code might look something like this\n\n```javascript\nUserMock.findOne({\n\twhere: {\n\t\tusername: 'my-user',\n\t},\n}).then(function (user) {\n\t// `user` is a Sequelize Model-like object\n\tuser.get('id');         // Auto-Incrementing ID available on all Models\n\tuser.get('email');      // 'email@example.com'; Pulled from default values\n\tuser.get('username');   // 'my-user'; Pulled from the `where` in the query\n\t\n\tuser.myTestFunc();      // Will return 'Test User' as defined above\n});\n```\n\n## Contributing\n\nThis library is under active development, so you should feel free to submit issues, questions, or pull requests.\n\n## License\n\nCreated by Blink UX and licensed under the MIT license. Check the LICENSE file for more information.\n","readmeFilename":"README.md"}