{"_id":"stories","_rev":"15-16bdea56e5e32ef36cb057b58cd844d2","name":"stories","description":"Given/When/Then integration awesomeness for Node.js","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"stories","version":"1.0.0","description":"Given/When/Then integration awesomeness for Node.js","homepage":"http://github.com/nharbour/node-stories","keywords":["testing","bdd","cucumber","tdd","test"],"author":{"name":"Tobias Svensson","email":"tobiassvn@googlemail.com"},"maintainers":[{"name":"Eugene Ware","email":"eugene@noblesamurai.com"}],"licenses":["MIT"],"dependencies":{},"main":"./lib/story","repository":{"type":"git","url":"git://github.com/nharbour/node-stories.git"},"_id":"stories@1.0.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.2.18","_nodeVersion":"v0.3.7","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"f6e629de52ea55541bd49d61bf2d02f292a1784f","tarball":"https://registry.npmjs.org/stories/-/stories-1.0.0.tgz","integrity":"sha512-n7ATKf1yosl/+OzWGMJi2WB0hSUv+WB6mcn2Clbcci1hhYTV6ffJTzvs3xEYvyNUyRTUmgm0kJF3i+zVAQng9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLCFBkQBy7qIKitiUhnruPUqXI8/s6A1H3IZZFz6GuRQIhALvsrQMYvk0HPBjsxG3DCCZEpGmq0ZoT652VwlindP/8"}]}},"1.0.1":{"name":"stories","version":"1.0.1","description":"Given/When/Then integration awesomeness for Node.js","homepage":"http://github.com/nharbour/node-stories","keywords":["testing","bdd","cucumber","tdd","test"],"author":{"name":"Tobias Svensson","email":"tobiassvn@googlemail.com"},"maintainers":[{"name":"Eugene Ware","email":"eugene@noblesamurai.com"}],"licenses":["MIT"],"dependencies":{},"main":"./lib/story","repository":{"type":"git","url":"git://github.com/nharbour/node-stories.git"},"_id":"stories@1.0.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.2.18","_nodeVersion":"v0.3.7","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"4271e71ba22a71ea92b7683cf397d26a10a546b4","tarball":"https://registry.npmjs.org/stories/-/stories-1.0.1.tgz","integrity":"sha512-/4tbUoeMYU7FS/l86aasRuh4qY+ZgANpIOlKcJkeKKYHdJTP67NTDDuPd9KG6HCkyWWomK0x4TOV0F/2Eg32gg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGFFxOD5mvBv6kuw7yzWJ5LdY2wIAt2yF1PaElA952e3AiBHRcxI2JjnZeLzGHTTbak1qntbk/pJWS7FsT0bLSg4KQ=="}]}},"1.0.2":{"name":"stories","version":"1.0.2","description":"Given/When/Then integration awesomeness for Node.js","homepage":"http://github.com/nharbour/node-stories","keywords":["testing","bdd","cucumber","tdd","test"],"author":{"name":"Tobias Svensson","email":"tobiassvn@googlemail.com"},"maintainers":[{"name":"Eugene Ware","email":"eugene@noblesamurai.com"}],"licenses":["MIT"],"dependencies":{},"main":"./lib/story","repository":{"type":"git","url":"git://github.com/nharbour/node-stories.git"},"_id":"stories@1.0.2","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.2.18","_nodeVersion":"v0.3.7","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"8d15ead97e0d889bca1256f9e98b57b6adaacb6b","tarball":"https://registry.npmjs.org/stories/-/stories-1.0.2.tgz","integrity":"sha512-lQY8/e+pl3qRtyJ8MqDoAGP0pUsLc1YXu50osuk5HY7hZpPrJGfyT3LtP/ONJRwVP+y1OcpRhNUkW+eJ4O3SCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFbnHCrQHBAQ//bdT6mohOL+xbJAKuoGxg2Ldgm5lZ1HAiArqipwP7tuvPju+pY31tZCmfm51DEBdAcap3pR7epRQw=="}]}},"1.0.3":{"name":"stories","version":"1.0.3","description":"Given/When/Then integration awesomeness for Node.js","homepage":"http://github.com/nharbour/node-stories","keywords":["testing","bdd","cucumber","tdd","test"],"author":{"name":"Tobias Svensson","email":"tobiassvn@googlemail.com"},"maintainers":[{"name":"Eugene Ware","email":"eugene@noblesamurai.com"}],"licenses":["MIT"],"dependencies":{},"main":"./lib/story","repository":{"type":"git","url":"git://github.com/nharbour/node-stories.git"},"_id":"stories@1.0.3","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.2.18","_nodeVersion":"v0.3.7","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"e3a0cb2116de81e0d58aeeba715149c03d55a99f","tarball":"https://registry.npmjs.org/stories/-/stories-1.0.3.tgz","integrity":"sha512-qNYNvdhZMG+yifrjDSViUAdOViTYQaLXMGXt2PQBsj8MOWgDFLiYAVympkOl0HsmWpNfVURpdBkaf44FPZHa3Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3YkWc8QweHnNnsGHG/C/CIsXaVeM4qX0hgm3WSBDRlAIhAOccRAWXLNlyK0GrqhbNMyeXeKc78e1MGiRfTxcoZGy3"}]}},"1.0.4":{"name":"stories","version":"1.0.4","description":"Given/When/Then integration awesomeness for Node.js","homepage":"http://github.com/nharbour/node-stories","keywords":["testing","bdd","cucumber","tdd","test"],"author":{"name":"Tobias Svensson","email":"tobiassvn@googlemail.com"},"maintainers":[{"name":"Eugene Ware","email":"eugene@noblesamurai.com"}],"licenses":["MIT"],"dependencies":{},"main":"./lib/story","repository":{"type":"git","url":"git://github.com/nharbour/node-stories.git"},"_id":"stories@1.0.4","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.2.18","_nodeVersion":"v0.3.7","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"c51e8b8df3312906933971ae4fec1d803336569e","tarball":"https://registry.npmjs.org/stories/-/stories-1.0.4.tgz","integrity":"sha512-MZ/hVtAbCxx6EB8AEQuVsj5Z8WzFOWeneSHtcCVaTv7JIqjjpibsJobXLtVwP4bpKJjrS68jV4fALzc8JeTt2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfLb5b9tig2Lty/kIMMI7Y6oC3YgRXRmmfCzefPKVGHAiAGqWh+bMtjVPsLs5dyGD63FUpeOTgaKIqDG4jgkPJ7lw=="}]}},"1.0.5":{"name":"stories","version":"1.0.5","description":"Given/When/Then integration awesomeness for Node.js","homepage":"http://github.com/eugeneware/node-stories","keywords":["testing","bdd","cucumber","tdd","test"],"author":{"name":"Tobias Svensson","email":"tobiassvn@googlemail.com"},"maintainers":[{"name":"eugeneware","email":"eugene@noblesamurai.com"}],"licenses":["MIT"],"dependencies":{},"main":"./lib/story","repository":{"type":"git","url":"git://github.com/eugeneware/node-stories.git"},"readme":"node-stories\n============\n\nLightweight Given/When/Then/And/But blocks with async-support for Node.js.\n\nThe basics\n----------\n\nNode-stories uses the same kind of metaprogramming most other JavaScript\ntesting suites are using. A silly example:\n\n    process.mixin(require('./story'));\n\n    new Feature('Using an Array as a queue', function () {\n        var assert = require(\"assert\");\n\n        Given('An empty Array', function () {\n            a = []\n        })\n        When('I add some elements', function () {\n            a.push(1)\n            a.push(2)\n            a.push(3)\n            a.push(4)\n        })\n        And('I shift an element off the Array', function () {\n            element = a.shift()\n        })\n        Then('I should get the first element from the Array', function () {\n            assert.equal(element, 1)\n        })\n        And('I should have the remaining elements left', function () {\n            assert.equal(a.length, 3)\n        })\n        But('I should not have the shifted element left', function () {\n            a.forEach(function (e) { assert.notEqual(e, element) })\n        })\n    })\n\nNow when you run this:\n\n    node my_feature.js\n\nThen you should see in your terminal:\n\n    Feature: Using an Array as a queue\n\n      Given An empty Array\n      When I add some elements\n      And I shift an element off the Array\n      Then I should get the first element from the Array\n      And I should have the remaining elements left\n\nObviously, this is colorized and always displays the errors together with each\nfailing step.\n\nAsync DSL\n---------\n\nNode-story has a human-readable DSL for deferring evaluation of steps\nuntil a step specifying asynchronous behavior has completed or,\noptionally, timed-out. Nothing of this pollutes the global namespace and\nnode-stories uses some fancy accessor trickery to keep things readable:\n\nDefine how many `passes` are expected:\n* `await(5).passes`\n* `await(1).pass`\n\nOptionally you can define a timeout (in milliseconds):\n* `await(6).passes.withTimeout(2500)`\n\nEmit a passed test:\n* `passed`\n\nEmit a failed test:\n* `failed`\n\nNote: `failed` will automatically display the error object passed to the\ncallback, eg. by `addErrback()`, and display.\n\nAsync Features\n--------------\n\nUsing the async helpers, node-stories will synchronously run your features:\n\n    new Feature('A passing, async feature', function () {\n        var emitter;\n        Given('An event emitter', function () {\n            emitter = new process.EventEmitter()\n        })\n        And('A timed, emitted success', function () {\n            setTimeout(function () { emitter.emit('success') }, 1500)\n        })\n        Then('This step will wait until the block has finished', function () {\n            await(1).pass\n            emitter.addListener('success', function () {\n                passed\n            })\n        })\n        And(\"This step won't run any earlier\", function () {\n            // Do some more assertions here.\n        })\n    })\n\nMore examples\n-------------\n\nHave a look into the `examples/` directory (which, before you ask, are also used for\ntesting node-stories).\n\nWhat about deep nesting?\n------------------------\n\nDeep nesting is currently __not__ supported by node-stories. A Feature should\ndescribe one thing in the most concise way possible and deep nesting should not\nbe neccessary. At least that is my style. However, if you fancy support for\nnesting, feel free to fork and send me a pull request.\n\nAnd what about matchers?\n------------------------\n\nNode-stories is matcher independent. You can use Node's built-in `assert`\nmodule or the matchers of your favorite unit-test/spec suite. As long as they\nthrow errors on failed assertions, just like the `assert` module, everything\n(the console output) should be fine.\n\nContributions\n-------------\n\nI wrote this so I can add some simple integration tests to some of the projects\nI am currently working on. However, feature requests and contributions are of\ncourse welcome.\n\nLicense\n-------\n\n* The MIT License\n\nCopyright (c) 2009 Tobias Svensson (tobiassvn@googlemail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n","readmeFilename":"README.md","_id":"stories@1.0.5","dist":{"shasum":"d6db02994a4489a4db895d93c6219c4b26733ff4","tarball":"https://registry.npmjs.org/stories/-/stories-1.0.5.tgz","integrity":"sha512-UGhWF0YcO7dp10n8P4tMxbZNPPthz+z79r6Tf7SCI+rlESTtzCZdWVHgC/AUgjd/WW0qCXa+CPbtBSj5wjYXtw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDoKyHwkveUhghREqbyMmR8LgOdPYnWLvXw+yxTwqZTMAiEAok8VKPcaes+mKDc11iAT4o2yG+lAurWCWhj1FAKZVVk="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"eugeneware","email":"eugene@noblesamurai.com"}}},"maintainers":[{"name":"eugeneware","email":"eugene@noblesamurai.com"}],"time":{"modified":"2022-06-27T00:34:34.304Z","created":"2011-02-12T10:06:59.835Z","1.0.0":"2011-02-12T10:07:00.714Z","1.0.1":"2011-02-12T10:20:19.431Z","1.0.2":"2011-02-12T10:23:20.480Z","1.0.3":"2011-02-12T10:26:14.505Z","1.0.4":"2011-02-12T11:04:18.794Z","1.0.5":"2013-06-11T16:36:02.964Z"},"author":{"name":"Tobias Svensson","email":"tobiassvn@googlemail.com"},"repository":{"type":"git","url":"git://github.com/eugeneware/node-stories.git"}}