{"name":"muk-prop","description":"Mock object methods and properties.","keywords":["test","mock","stub"],"version":"0.5.3","repository":{"type":"git","url":"git://github.com/fent/node-muk-prop.git"},"author":{"name":"Roly Fentanes","url":"https://github.com/fent"},"main":"./lib/index.js","scripts":{"test":"istanbul cover node_modules/.bin/_mocha -- -R spec test/*-test.js"},"directories":{"lib":"./lib"},"devDependencies":{"mocha":"*","istanbul":"0"},"license":"MIT","files":["lib"],"gitHead":"69fb3b432fc541c6d7f34d8f3e4aaef45f6a31e4","bugs":{"url":"https://github.com/fent/node-muk-prop/issues"},"homepage":"https://github.com/fent/node-muk-prop#readme","_id":"muk-prop@0.5.3","_shasum":"27b44bd7cadd4ba6064e117cef87ad83156a3587","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.3.0","_npmUser":{"name":"fent","email":"roly426@gmail.com"},"maintainers":[{"name":"fent","email":"roly426@gmail.com"}],"dist":{"shasum":"27b44bd7cadd4ba6064e117cef87ad83156a3587","tarball":"http://registry-npm.ywwl.com/muk-prop/download/muk-prop-0.5.3.tgz","integrity":"sha512-lhwqQP6FhWaAPL0lBgo17EPWFBFkdDWVcSzZEZ+69ajOrxEMDLL3NGUowG9zRr05A9C0raNs17b4oGd2qYv9SQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBkAI683kDFjT7rT8YZ7GfcSX3VDnYET8sTLSkcYJpY6AiBmFvqIl8vEdIqJ1rDoJXqReiGnr3PJWELnZjrVvZyaLA=="}],"size":2479,"noattachment":false,"key":"/muk-prop/-/muk-prop-0.5.3.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/muk-prop-0.5.3.tgz_1484981028656_0.7240952285937965"},"readme":"# muk-prop.js\n\n[![Build Status](https://secure.travis-ci.org/fent/muk-prop.js.svg)](http://travis-ci.org/fent/muk-prop.js)\n[![Dependency Status](https://david-dm.org/fent/muk-prop.js.svg)](https://david-dm.org/fent/muk-prop.js)\n[![codecov](https://codecov.io/gh/fent/muk-prop.js/branch/master/graph/badge.svg)](https://codecov.io/gh/fent/muk-prop.js)\n\n![muk](muk.gif)\n\n# Usage\n\nObject method mocking.\n\n```js\nconst fs = require('fs');\nconst muk = require('muk-prop');\n\nmuk(fs, 'readFile', (path, callback) => {\n  process.nextTick(callback.bind(null, null, 'file contents here'));\n});\n```\n\nObject props mocking with setter/getter.\n\n```js\nconst muk = require('muk-prop');\n\nconst obj = { _a: 1 };\nmuk(obj, 'a', {\n  set: (val) => obj._a = val * 2,\n  get: (val) => obj._a,\n});\n\nobj.a = 2;\nconsole.log(obj.a); // 4\n```\n\nCheck if member has been mocked.\n\n```js\nmuk.isMocked(fs, 'readFile'); // true\n```\n\nRestore all mocked methods/props after tests.\n\n```js\nmuk.restore();\n\nfs.readFile(file, (err, data) => {\n  // will actually read from `file`\n});\n```\n\n\n# Install\n\n    npm install muk-prop\n\n\n# Tests\nTests are written with [mocha](https://mochajs.org)\n\n```bash\nnpm test\n```\n","publish_time":1484981030603,"_cnpm_publish_time":1484981030603,"dist-tags":{"latest":"3.0.2"}}