{"name":"fake","author":{"name":"Felix Geisendörfer","email":"felix@debuggable.com","url":"http://debuggable.com/"},"description":"Test your JavaScript with focused programmer tests. Fake depedencies.","version":"0.2.2","repository":{"type":"git","url":"git://github.com/felixge/node-fake.git"},"main":"./lib/fake","engines":{"node":">=0.4.0"},"scripts":{"test":"make test"},"dependencies":{},"devDependencies":{"far":"~0.0.7"},"readme":"**Current Status:** This library is ready for experimental usage.\n\n# Fake [![Build Status](https://travis-ci.org/alexindigo/node-fake.png?branch=master)](https://travis-ci.org/alexindigo/node-fake)\n\nTest one thing at a time, fake the rest.\n\n## Tutorial\n\nSet an expectation of a method call on an object:\n\n``` javascript\nvar fake = require('fake')();\nvar object = {};\n\nfake.expect(object, 'method');\n\nobject.method();\n```\n\nIf the last `object.method()` call is not present, an exception will be thrown.\n\nDepending on your [approach to TDD][mocksvsstubs], you may prefer to use\nstubbing over mocking instead:\n\n[mocksvsstubs]: http://martinfowler.com/articles/mocksArentStubs.html\n\n``` javascript\nvar fake = require('fake')();\nvar object = {};\n\nvar objectMethodCall = fake.stub(object, 'method');\n\nobject.method();\n\nassert.equals(objectMethodCall.calls.length, 1);\n```\n\n## API\n\n### fake.expect(object, method, [times, withArgs, andReturn | andHandle])\n\nSet up an ordered expectation. Calling any other methods controlled by fake\nbefore this expectation has been satisifed will throw an exception.\n\n### fake.expectAnytime(object, method, [times, withArgs, andReturn | andHandle])\n\nSet up an unordered expectation. This will only throw an error if this\nexpectation is not verified before the process exits.\n\n### fake.stub(object, method, [times, withArgs, andReturn | andHandle])\n\nSet up an optional expectation. This is useful for pre-filling return values\nfor functions, without caring if the function is ever called.\n\n## Todo\n\n* Report non-matching anytime expectations if they are the closest match\n* Move stacktrace into own module\n* Useful error reporting\n* Partial arguments matching\n* Become self-testing\n* Documentation\n* Handle fake functions being claimed by multiple fakes\n* NodeModuleScene / BrowserScriptScene?\n","readmeFilename":"Readme.md","_id":"fake@0.2.2","dist":{"shasum":"68fe672725ff0f5c89ba92c539b31111f122d1f3","tarball":"http://registry-npm.ywwl.com/fake/download/fake-0.2.2.tgz","integrity":"sha512-FUdhDjHmjvrCB7JM6HkXkWjW1C441b7FctU2/h9V6Xxh/eBOnMDhSbiPDO7T3g4bhd6d9j1ooGgyT4a67rNi2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0sP0pSCfyH34p4Q5tSfw46L9s/4j99kEIhn4NT7oZ9wIgBNTRriz109TMkmvv/2x29FmEasIgtwB82BFEUKmFe4k="}],"size":7254,"noattachment":false,"key":"/fake/-/fake-0.2.2.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"alexindigo","email":"iam@alexindigo.com"},"maintainers":[{"name":"felixge","email":"felix@debuggable.com"},{"name":"alexindigo","email":"iam@alexindigo.com"}],"directories":{},"publish_time":1368687404156,"_cnpm_publish_time":1368687404156,"dist-tags":{"latest":"0.2.2"}}