{"bin":{"whiskey":"./bin/whiskey"},"bugs":{"url":"https://github.com/cloudkick/whiskey/issues"},"dist":{"shasum":"89514f33ba7e314202a396e06dbb8a4a0d35eaaf","tarball":"https://registry.npmjs.org/whiskey/-/whiskey-0.8.4.tgz","integrity":"sha512-Tp+tiSlXpQHSKetlO2Swj3YsHqRzNYVSGc/tA2oC3ITav6u7H/q8VSboRQDEyTm659pMxURxxQW0OPH2KRfN4Q==","signatures":[{"sig":"MEUCIQC62LqN3jQtHTbOmMseqchK3JX4gnPCLynqtgJAbrPgXgIgIlV6h1GuKWBcZ4t8e5GY8BUpOBIwciNbaPtQP2/VHYY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./index","name":"whiskey","_from":".","author":{"name":"Cloudkick, Inc.","email":"tomaz+npm@cloudkick.com"},"readme":"# Whiskey\n\nWhiskey is a powerful test runner for Node.js applications and a process\norchestration framework which makes running integration tests with a lot of\nservice / process dependencies easier.\n\n## Features\n\n* Each test file runs isolated in a separate process\n* Support for running multiple tests in parallel in a single suite (`--concurrency` option)\n* Support for running multiple suites in parallel (`--independent-tests` option)\n* Support for a test initialization function which is run before running the tests in a test file\n* Support for a test file timeout\n* Per-test `setUp` / `tearDown` function support\n* Per-suite (test file) `initialize` / `finalize` function support\n* Per-session, or global, setUp / tearDown function support\n* Support for different test reporters (cli, tap)\n* Support for code coverage (cli reporter, html reporter)\n* Support for reporting variables which have leaked into a global scope\n* Nicely formatted reports (colors!)\n* Integration with node debugger\n* Support for generating Makefiles with different Whiskey targets\n\n## Changes\n\nFor changes please see [CHANGES.md](https://github.com/cloudkick/whiskey/blob/master/CHANGES.md) file.\n\n## Installation\n\nInstall it using npm:\n\n```\nnpm install whiskey\n```\n\n## Usage\n\n    whiskey [options] --tests \"<test files>\"\n\n    whiskey [options] --independent-tests \"<test files>\"\n\n    whiskey [options] --tests \"<test files>\"  --independent-tests \"<test files>\"\n\n\n### Available options\n\n * **-t, --tests** - Whitespace separated list of test suites to run sequentially\n * **-T, --independent-tests** - Whitespace separated list of test suites to run concurrently\n * **-m, --max-suites NUMBER** - The number of concurrently executing independent test suites (defaults to 5)\n * **-ti, --test-init-file** - A path to the initialization file which must export\n `init` function and it is called in a child process *before running the tests in\n each test file\n * **-c, --chdir** - An optional path to which the child process will chdir to before\n running the tests\n * **-g, --global-setup-teardown STRING** - Specifies the file containing the globalSetUp and globalTearDown procedures.\n * **--timeout [NUMBER]** - How long to wait for tests to complete before timing\n out\n * **--failfast** - Stop running the tests on a first failure or a timeout\n * **--no-styles** - Don't use styles and colors\n * **--concurrency [NUMBER]** - Maximum number of tests which will run in parallel (defaults to 1)\n * **--quiet** - Don't print stdout and stderr\n * **--real-time** - Print stdout and stderr as soon as it comes in\n * **--test-reporter [cli,tap]** - Which test reporter to use (defaults to cli)\n * **--coverage** - Use this option to enable the test coverage\n * **--coverage-reporter [cli,html]** - Which coverage reporter to use (defaults to cli)\n * **--coverage-dir** - Directory where the coverage HTML report is saved\n * **--scope-leaks** - Record which variables were leaked into a global scope\n * **--scope-leaks-reporter [cli]** - Which scope leak reporter to use (defaults\n   to cli)\n * **--debug NUMBER** - Attach a debugger to a test process listening on the specified port number\n * **--report-timing** - Report each test run time\n * **--dependencies STRING** - Specify path to the dependencies file for the\n   process runner. More information about the process runner can be found at\n   [PROCESS_RUNNER.md](https://github.com/cloudkick/whiskey/blob/master/PROCESS_RUNNER.md)\n * **--only-essential-dependencies** - Only start dependencies required by the tests\n   files which are ran. This option is only applicable if `--dependencies` option\n   is used.\n\nNote: When specifying multiple test a list with the test paths must be quoted,\nfor example: `whiskey --tests \"tests/a.js tests/b.js tests/c.js\"`\n\n## A Note about setUp and tearDown\n\nPresently, two kinds of setup and teardown procedures exist with Whiskey.\nsetUp and tearDown work on a per-test basis; that is, Whiskey invokes setUp\nbefore running a test in a given Javascript file, called a suite and tearDown\nis invoked after a test run has finished.\nIf you run multiple suites in parallel (e.g., via the\n-T/--independent-tests option), you'll get concurrent execution of setups and\nteardowns as well.\n\nSometimes, though, you need longer-lived environmental configurations, or you\nneed safe resource sharing between entire batches of independently running\ntests. For these, you'll want to use globalSetUp and globalTearDown.\n\n * When do I use setUp / tearDown?\n   * When a suite's runtime environment **does not** influence other running suites.\n * When do I use globalSetUp / globalTearDown ?\n   * When a suite's runtime environment **can potentially** interfere with other, concurrently running suites.\n   * **Example:** Attempting to run multiple suites in parallel which rely on a Cassandra schema being in place, and each attempting to reset the schema to a known state on a single Cassandra instance, you'll get Cassandra schema version errors.  Using globalSetUp prevents this by running the schema reset code exactly once for _all_ tests.\n\n## Test File Examples\n\nA simple example (success):\n\n```javascript\nvar called = 0;\n\nexports.test_async_one_equals_one = function(test, assert) {\n  setTimeout(function() {\n    assert.equal(1, 1);\n    called++;\n    test.finish();\n  }, 1000);\n};\n\nexports.tearDown = function(test, assert) {\n  assert.equal(called, 1);\n  test.finish();\n};\n```\n\nA simple example (skipping a test):\n\n```javascript\nvar dbUp = false;\n\nexports.test_query = function(test, assert) {\n  if (!dbUp) {\n    test.skip('Database is not up, skipping...');\n    return;\n  }\n\n  assert.equal(2, 1);\n  test.finish();\n};\n```\n\nA simple example (failure):\n\n```javascript\nexports.test_two_equals_one = function(test, assert) {\n  assert.equal(2, 1);\n  test.finish();\n};\n```\n\nA simple example using the optional BDD module:\n```javascript\nvar bdd = require('whiskey').bdd.init(exports);\nvar describe = bdd.describe;\n\ndescribe('the bdd module', function(it) {\n  it('supports it(), expect(), and toEqual()', function(expect) {\n    expect(true).toEqual(true);\n  });\n});\n```\n\nA simple example demonstrating how to use global setup and teardown functionality:\n``` javascript\nexports['globalSetUp'] = function(test, assert) {\n  // Set up database schema here...\n  // Push known data set to database here...\n  test.finish();\n}\n\nexports['globalTearDown'] = function(test, assert) {\n  // Drop database here...\n  test.finish();\n}\n```\n\nFor more examples please check the `example/` folder, and the `test/run.sh` script.\n\n## Build status\n\n[![Build Status](https://secure.travis-ci.org/cloudkick/whiskey.png)](http://travis-ci.org/cloudkick/whiskey)\n\n## Running Whiskey test suite\n\nTo run the Whiskey test suite, run the following command in the repository root\ndirectory.\n\n```bash\nnpm test\n```\n\nIf all the tests have sucessfully passed, the process should exit with a zero\nstatus code and you should see `* * * Whiskey test suite PASSED. * * *`\nmessage.\n\n## Contributing\n\nTo contribute, fork the repository, create a branch with your changes and open a\npull request.\n\n## Debugging\n\nIf you want to debug your test, you can use the `--debug` option. This will\ncause Whiskey to start the test process with the V8 debugger functionality.\nYou then need to manually connect to the debugger to control it (i.e. using\nnode repl or [node-inspector](https://github.com/dannycoates/node-inspector)).\n\nWhiskey will also by default set a breakpoint at the beginning of your test\nfile.\n\nNote: This option can only be used with a single test file.  Further, you\ncannot use the `--debug` and `--independent-tests` options together.  The\nsemantics just don't make any sense.  To debug a test, make sure you invoke it\nwith `--tests` instead.\n\n## Troubleshooting\n\n### I use `long-stack-straces` module in my own code and all of the tests get reported as succeeded\n\nLong stack traces modules intercepts the default Error object and throws a custom\none. The problem with this is that Whiskey internally relies on attaching the\ntest name to the `Error` object so it can figure out to which test the exception\nbelongs. long-stack-traces throws a custom Error object and as a consequence test\nname attribute gets lost so Whiskey thinks your test didn't throw any exceptions.\n\nThe solution for this problem is to disable `long-stack-trace` module when running\nthe tests. This shouldn't be a big deal, because Whiskey internally already uses\n`long-stack-traces` module which means that you will still get long stack traces\nin the exceptions which were thrown in your tests.\n\n### My test gets reported as \"timeout\" instead of \"failure\"\n\nIf your test gets reported as \"timeout\" instead of \"failure\" your test code most\nlikely looks similar to the one below:\n\n```javascript\nexports.test_failure = function(test, assert){\n  setTimeout(function() {\n    throw \"blaaaaah\";\n    test.finish();\n  },200);\n};\n```\n\nThe problem with this is that if you run tests in parallel (`--concurrency` > 1)\nand you don't use a custom assert object which gets passed to each test function,\nWhiskey can't figure out to which test the exception belongs. As a consequence,\nthe test is reported as \"timed out\" and the exception is reported as \"uncaught\".\n\nThe solution for this problem is to run the tests in sequential mode (drop the\n--concurrency option).\n\n## License\n\nApache 2.0, for more info see [LICENSE](/cloudkick/whiskey/blob/master/LICENSE).\n","engines":{"node":">= 0.4.0"},"scripts":{"lint":"./scripts/lint.sh","test":"make test"},"_npmUser":{"name":"kami","email":"tomaz+npm@tomaz.me"},"homepage":"https://github.com/cloudkick/whiskey","keywords":["whiskey","tests","test runner","testing","tdd","coverage","test coverage","process orchestration"],"licenses":[{"url":"http://www.apache.org/licenses/LICENSE-2.0.html","type":"Apache"}],"repository":{"url":"git://github.com/cloudkick/whiskey.git","type":"git"},"_npmVersion":"1.3.5","description":"Whiskey is a powerful test runner for Node.js applications and a process orchestration framework which makes running integration tests with a lot of service / process dependencies easier.","directories":{"bin":"./bin","lib":"./lib","example":"./example"},"maintainers":[{"name":"kami","email":"tomaz@tomaz.me"}],"contributors":[{"url":"http://www.tomaz.me","name":"Tomaz Muraus","email":"tomaz+npm@tomaz.me"},{"url":"http://russellhaering.com","name":"Russell Haering","email":"russellhaering@gmail.com"},{"url":"http://bjorn.tipling.com","name":"Bjorn Tipling","email":"bjorn@ambientchill.com"},{"url":"http://robert-chiniquy.github.io","name":"Robert Chiniquy","email":"rchiniquy@yahoo.com"},{"name":"Sam Falvo","email":"sam.falvo@rackspace.com"}],"dependencies":{"gex":"= 0.0.1","async":">= 0.1.22","rimraf":"= 1.0.1","sprintf":">= 0.1.1","istanbul":">= 0.1.37","logmagic":"= 0.1.4","terminal":"= 0.1.3","simplesets":"= 1.1.6","underscore":">= 1.4.2","magic-templates":"= 0.1.1"},"readmeFilename":"README.md","devDependencies":{"jshint":"2.1.3"},"_id":"whiskey@0.8.4","version":"0.8.4"}