{
  "name": "grunt-contrib-qunit",
  "description": "Run QUnit unit tests in a headless PhantomJS instance.",
  "version": "0.2.0",
  "homepage": "https://github.com/gruntjs/grunt-contrib-qunit",
  "author": {
    "name": "Grunt Team",
    "url": "http://gruntjs.com/"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/gruntjs/grunt-contrib-qunit.git"
  },
  "bugs": {
    "url": "https://github.com/gruntjs/grunt-contrib-qunit/issues"
  },
  "licenses": [
    {
      "type": "MIT",
      "url": "https://github.com/gruntjs/grunt-contrib-qunit/blob/master/LICENSE-MIT"
    }
  ],
  "main": "Gruntfile.js",
  "engines": {
    "node": ">= 0.8.0"
  },
  "scripts": {
    "test": "grunt test"
  },
  "dependencies": {
    "grunt-lib-phantomjs": "~0.2.0"
  },
  "devDependencies": {
    "grunt-contrib-jshint": "~0.2.0",
    "grunt-contrib-connect": "~0.1.1",
    "grunt-contrib-internal": "~0.4.2",
    "grunt": "~0.4.0",
    "difflet": "~0.2.3"
  },
  "peerDependencies": {
    "grunt": "~0.4.0"
  },
  "keywords": [
    "gruntplugin"
  ],
  "contributors": [
    {
      "name": "\"Cowboy\" Ben Alman",
      "url": "http://benalman.com/"
    },
    {
      "name": "Tyler Kellen",
      "url": "http://goingslowly.com/"
    }
  ],
  "readme": "# grunt-contrib-qunit [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-qunit.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-qunit)\n\n> Run QUnit unit tests in a headless PhantomJS instance.\n\n\n\n## Getting Started\nThis plugin requires Grunt `~0.4.0`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-contrib-qunit --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-contrib-qunit');\n```\n\n\n\n\n## Qunit task\n_Run this task with the `grunt qunit` command._\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\n\nWhen installed by npm, this plugin will automatically download and install [PhantomJS][] locally via the [grunt-lib-phantomjs][] library.\n\n[PhantomJS]: http://www.phantomjs.org/\n[grunt-lib-phantomjs]: https://github.com/gruntjs/grunt-lib-phantomjs\n\nAlso note that running grunt with the `--debug` flag will output a lot of PhantomJS-specific debugging information. This can be very helpful in seeing what actual URIs are being requested and received by PhantomJS.\n### Options\n\n#### timeout\nType: `Number`  \nDefault: `5000`\n\nThe amount of time (in milliseconds) that grunt will wait for a QUnit `start()` call before failing the task with an error.\n\n#### inject\nType: `String`  \nDefault: (built-in)\n\nPath to an alternate QUnit-PhantomJS bridge file to be injected. See [the built-in bridge](https://github.com/gruntjs/grunt-contrib-qunit/blob/master/phantomjs/bridge.js) for more information.\n\n#### urls\nType: `Array`  \nDefault: `[]`\n\nAbsolute `http://` or `https://` urls to be passed to PhantomJS. Specified URLs will be merged with any specified `src` files first. Note that urls must be served by a web server, and since this task doesn't contain a web server, one will need to be configured separately. The [grunt-contrib-connect plugin](https://github.com/gruntjs/grunt-contrib-connect) provides a basic web server.\n\n#### (-- PhantomJS arguments)\nType: `String`  \nDefault: (none)\n\nAdditional `--` style arguments that need to be passed in to PhantomJS may be specified as options, like `{'--option': 'value'}`. This may be useful for specifying a cookies file, local storage file, or a proxy. See the [PhantomJS API Reference][] for a list of `--` options that PhantomJS supports.\n\n### Usage examples\n\n#### Wildcards\nIn this example, `grunt qunit:all` (or `grunt qunit` because `qunit` is a [multi task][]) will test all `.html` files in the test directory _and all subdirectories_. First, the wildcard is expanded to match each individual file. Then, each matched filename is passed to [PhantomJS][] (one at a time).\n\n```js\n// Project configuration.\ngrunt.initConfig({\n  qunit: {\n    all: ['test/**/*.html']\n  }\n});\n```\n\n#### Testing via http:// or https://\nIn circumstances where running unit tests from local files is inadequate, you can specify `http://` or `https://` URLs via the `urls` option. Each URL is passed to [PhantomJS][] (one at a time).\n\nIn this example, `grunt qunit` will test two files, served from the server running at `localhost:8000`.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n  qunit: {\n    all: {\n      options: {\n        urls: [\n          'http://localhost:8000/test/foo.html',\n          'http://localhost:8000/test/bar.html'\n        ]\n      }\n    }\n  }\n});\n```\n\nWildcards and URLs may be combined by specifying both.\n\n#### Using the grunt-contrib-connect plugin\nIt's important to note that grunt does not automatically start a `localhost` web server. That being said, the [grunt-contrib-connect plugin][] `connect` task can be run before the `qunit` task to serve files via a simple [connect][] web server.\n\n[grunt-contrib-connect plugin]: https://github.com/gruntjs/grunt-contrib-connect\n[connect]: http://www.senchalabs.org/connect/\n\nIn the following example, if a web server isn't running at `localhost:8000`, running `grunt qunit` with the following configuration will fail because the `qunit` task won't be able to load the specified URLs. However, running `grunt connect qunit` will first start a static [connect][] web server at `localhost:8000` with its base path set to the Gruntfile's directory. Then, the `qunit` task will be run, requesting the specified URLs.\n\n```js\n// Project configuration.\ngrunt.initConfig({\n  qunit: {\n    all: ['http://localhost:8000/test/foo.html', 'http://localhost:8000/test/bar.html']\n  },\n  connect: {\n    server: {\n      options: {\n        port: 8000,\n        base: '.'\n      }\n    }\n  }\n});\n\n// This plugin provides the \"connect\" task.\ngrunt.loadNpmTasks('grunt-contrib-connect');\n\n// A convenient task alias.\ngrunt.registerTask('test', ['connect', 'qunit']);\n```\n\n#### Custom timeouts and PhantomJS options\nIn the following example, the default timeout value of `5000` is overridden with the value `10000` (timeout values are in milliseconds). Additionally, PhantomJS will read stored cookies from the specified file. See the [PhantomJS API Reference][] for a list of `--` options that PhantomJS supports.\n\n[PhantomJS API Reference]: https://github.com/ariya/phantomjs/wiki/API-Reference\n\n```js\n// Project configuration.\ngrunt.initConfig({\n  qunit: {\n    options: {\n      timeout: 10000,\n      '--cookies-file': 'misc/cookies.txt'\n    },\n    all: ['test/**/*.html']\n  }\n});\n```\n\n#### Events and reporting\n[QUnit callback](http://api.qunitjs.com/category/callbacks/) methods and arguments are also emitted through grunt's event system so that you may build custom reporting tools. Please refer to to the QUnit documentation for more information.\n\nThe events (with arguments) are as follows:\n\n* `qunit.begin`\n* `qunit.moduleStart`: name\n* `qunit.testStart`: name\n* `qunit.log`: result, actual, expected, message, source\n* `qunit.testDone`: name, failed, passed, total\n* `qunit.moduleDone`: name, failed, passed, total\n* `qunit.done`: failed, passed, total, runtime\n\nIn addition to QUnit callback-named events, the following event is emitted when [PhantomJS][] is spawned for a test:\n\n* `qunit.spawn`: url\n\nYou may listen for these events like so:\n\n```js\ngrunt.event.on('qunit.spawn', function (url) {\n  grunt.log.ok(\"Running test: \" + url);\n});\n```\n\n\n## Release History\n\n * 2013-02-27   v0.2.0   Update to use PhantomJS 1.8.1.\n * 2013-02-14   v0.1.1   First official release for Grunt 0.4.0.\n * 2013-01-17   v0.1.1rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.\n * 2013-01-08   v0.1.1rc5   Updating to work with grunt v0.4.0rc5. Switching to this.filesSrc api. Adding \"urls\" option for specifying absolute test URLs.\n * 2012-10-04   v0.1.0   Work in progress, not yet officially released.\n\n---\n\nTask submitted by [\"Cowboy\" Ben Alman](http://benalman.com/)\n\n*This file was generated on Thu Feb 28 2013 11:58:59.*\n",
  "readmeFilename": "README.md",
  "_id": "grunt-contrib-qunit@0.2.0",
  "_from": "grunt-contrib-qunit@0.2.0"
}
