{"_id":"mocha-jsdom","_rev":"362955","name":"mocha-jsdom","description":"Simple integration of jsdom into mocha tests","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"time":{"modified":"2021-07-13T08:57:19.000Z","created":"2014-09-26T11:15:37.521Z","2.0.0":"2018-06-04T23:09:54.593Z","1.2.0":"2018-06-04T22:55:08.499Z","1.1.0":"2016-02-22T14:44:08.497Z","1.0.0":"2015-07-03T16:24:09.600Z","0.5.0":"2015-06-26T07:06:14.753Z","0.4.0":"2015-05-25T10:09:19.574Z","0.3.0":"2015-04-04T02:13:44.669Z","0.2.1":"2015-02-19T05:43:57.783Z","0.2.0":"2014-11-05T06:45:45.811Z","0.1.1":"2014-09-27T14:51:44.427Z","0.1.0":"2014-09-26T11:15:37.521Z"},"users":{"samar":true,"fanyegong":true,"zeke":true,"piorek":true,"addi90":true,"raxion":true},"author":{"name":"Rico Sta. Cruz","email":"rico@ricostacruz.com"},"repository":{"type":"git","url":"git+https://github.com/rstacruz/mocha-jsdom.git"},"versions":{"2.0.0":{"name":"mocha-jsdom","description":"Simple integration of jsdom into mocha tests","version":"2.0.0","author":{"name":"Rico Sta. Cruz","email":"rico@ricostacruz.com"},"bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"devDependencies":{"chai":"4.1.2","istanbul":"0.4.5","jquery":"3.3.1","mocha":"5.2.0","mocha-standard":"1.0.0","standard":"11.0.1"},"directories":{"test":"test"},"homepage":"https://github.com/rstacruz/mocha-jsdom#readme","keywords":["jsdom","mocha"],"license":"MIT","main":"index.js","peerDependencies":{"mocha":"*"},"repository":{"type":"git","url":"git+https://github.com/rstacruz/mocha-jsdom.git"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec","test":"mocha"},"browser":"browser.js","dependencies":{"jsdom":"^11.11.0"},"gitHead":"aec009b2f2bd2b83e6e987c6daa3b3c7089406ef","_id":"mocha-jsdom@2.0.0","_npmVersion":"6.0.1","_nodeVersion":"8.10.0","_npmUser":{"name":"rstacruz","email":"dropbox@ricostacruz.com"},"dist":{"shasum":"a77922342247011fb510b1b645f3d2bc100521ac","size":28922,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-2.0.0.tgz"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mocha-jsdom_2.0.0_1528153794469_0.925111159217876"},"_hasShrinkwrap":false,"publish_time":1528153794593,"_cnpm_publish_time":1528153794593},"1.2.0":{"name":"mocha-jsdom","description":"Simple integration of jsdom into mocha tests","version":"1.2.0","author":{"name":"Rico Sta. Cruz","email":"rico@ricostacruz.com"},"bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"devDependencies":{"chai":"4.1.2","istanbul":"0.4.5","jquery":"3.3.1","jsdom":"~11.11.0","mocha":"5.2.0","mocha-standard":"1.0.0","standard":"11.0.1"},"directories":{"test":"test"},"homepage":"https://github.com/rstacruz/mocha-jsdom#readme","keywords":["jsdom","mocha"],"license":"MIT","main":"index.js","peerDependencies":{"jsdom":">10.0.0","mocha":"*"},"repository":{"type":"git","url":"git+https://github.com/rstacruz/mocha-jsdom.git"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec","test":"mocha"},"browser":"browser.js","gitHead":"05115ca432e211f12bd73db2ad342bbe99ab054c","_id":"mocha-jsdom@1.2.0","_npmVersion":"6.0.1","_nodeVersion":"8.10.0","_npmUser":{"name":"rstacruz","email":"dropbox@ricostacruz.com"},"dist":{"shasum":"779905bde5ff50915c27cf633c785d2807a81b44","size":28667,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-1.2.0.tgz"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mocha-jsdom_1.2.0_1528152908413_0.02215234697749935"},"_hasShrinkwrap":false,"publish_time":1528152908499,"_cnpm_publish_time":1528152908499},"1.1.0":{"name":"mocha-jsdom","description":"Simple integration of jsdom into mocha tests","version":"1.1.0","author":{"name":"Rico Sta. Cruz","email":"rico@ricostacruz.com"},"bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"devDependencies":{"chai":"3.4.0","istanbul":"0.4.0","jquery":"2.1.4","jsdom":"7.0.2","mocha":"2.3.3","mocha-standard":"1.0.0","standard":"5.3.1"},"directories":{"test":"test"},"homepage":"https://github.com/rstacruz/mocha-jsdom#readme","keywords":["jsdom","mocha"],"license":"MIT","main":"index.js","peerDependencies":{"jsdom":"*","mocha":"*"},"repository":{"type":"git","url":"git+https://github.com/rstacruz/mocha-jsdom.git"},"scripts":{"coverage":"istanbul cover _mocha -- -R spec","test":"mocha"},"browser":"browser.js","gitHead":"3c185738d1cc7859ecf8497aab303e6aedee41b4","_id":"mocha-jsdom@1.1.0","_shasum":"e1576fbd0601cc89d358a213a0e5585d1b7c7a01","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.0","_npmUser":{"name":"rstacruz","email":"dropbox@ricostacruz.com"},"dist":{"shasum":"e1576fbd0601cc89d358a213a0e5585d1b7c7a01","size":7477,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-1.1.0.tgz"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/mocha-jsdom-1.1.0.tgz_1456152244892_0.6712639445904642"},"publish_time":1456152248497,"_cnpm_publish_time":1456152248497,"_hasShrinkwrap":false},"1.0.0":{"name":"mocha-jsdom","description":"Simple integration of jsdom into mocha tests","version":"1.0.0","author":{"name":"Rico Sta. Cruz","email":"rico@ricostacruz.com"},"bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"devDependencies":{"blanket":"^1.1.6","chai":"^3.0.0","coveralls":"^2.11.2","jquery":"^2.1.1","jsdom":">=3.1.2","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.1","mocha-standard":"0.0.5","standard":"^4.3.3"},"directories":{"test":"test"},"homepage":"https://github.com/rstacruz/mocha-jsdom#readme","keywords":["jsdom","mocha"],"license":"MIT","main":"index.js","peerDependencies":{"jsdom":"*","mocha":"*"},"repository":{"type":"git","url":"git+https://github.com/rstacruz/mocha-jsdom.git"},"scripts":{"coverage":"env COVERAGE=1 mocha -R html-cov > coverage.html && open coverage.html","test":"mocha"},"browser":"browser.js","gitHead":"d5945df924be883a6c2def12bd86a54d3f56e035","_id":"mocha-jsdom@1.0.0","_shasum":"3ac3d9380ca374e26c215aa1403cedbb62abff9b","_from":".","_npmVersion":"2.11.3","_nodeVersion":"2.3.1","_npmUser":{"name":"rstacruz","email":"rico@ricostacruz.com"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"dist":{"shasum":"3ac3d9380ca374e26c215aa1403cedbb62abff9b","size":7427,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-1.0.0.tgz"},"publish_time":1435940649600,"_cnpm_publish_time":1435940649600,"deprecated":"Consider jsdom-global instead. https://www.npmjs.com/package/jsdom-global","_hasShrinkwrap":false},"0.5.0":{"name":"mocha-jsdom","version":"0.5.0","description":"Simple integration of jsdom into mocha tests","main":"index.js","scripts":{"test":"mocha","coverage":"env COVERAGE=1 mocha -R html-cov > coverage.html && open coverage.html"},"author":{"name":"Rico Sta. Cruz","email":"hi@ricostacruz.com"},"license":"MIT","keywords":["mocha","jsdom"],"repository":{"type":"git","url":"git+https://github.com/rstacruz/mocha-jsdom.git"},"devDependencies":{"blanket":"^1.1.6","chai":"^3.0.0","coveralls":"^2.11.2","jquery":"^2.1.1","jsdom":">=3.1.2","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.1","mocha-standard":"0.0.5","standard":"^4.3.3"},"peerDependencies":{"mocha":"*","jsdom":"*"},"gitHead":"376d91448ee8c1f341d317af53200aef8aa8aca9","bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"homepage":"https://github.com/rstacruz/mocha-jsdom#readme","_id":"mocha-jsdom@0.5.0","_shasum":"977495fe4a3d4bed9815b374b9b885172785c4b1","_from":".","_npmVersion":"2.11.1","_nodeVersion":"2.3.0","_npmUser":{"name":"rstacruz","email":"rico@ricostacruz.com"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"dist":{"shasum":"977495fe4a3d4bed9815b374b9b885172785c4b1","size":6468,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-0.5.0.tgz"},"directories":{},"publish_time":1435302374753,"_cnpm_publish_time":1435302374753,"_hasShrinkwrap":false},"0.4.0":{"name":"mocha-jsdom","version":"0.4.0","description":"Simple integration of jsdom into mocha tests","main":"index.js","scripts":{"test":"mocha","coverage":"env COVERAGE=1 mocha -R html-cov > coverage.html && open coverage.html"},"author":{"name":"Rico Sta. Cruz","email":"hi@ricostacruz.com"},"license":"MIT","keywords":["mocha","jsdom"],"repository":{"type":"git","url":"git+https://github.com/rstacruz/mocha-jsdom.git"},"devDependencies":{"blanket":"^1.1.6","chai":"^1.9.1","coveralls":"^2.11.2","jquery":"^2.1.1","jsdom":">=3.1.2","mocha":"^1.21.4","mocha-clean":"^0.2.0","mocha-lcov-reporter":"0.0.1"},"peerDependencies":{"mocha":"*","jsdom":"*"},"gitHead":"7f6334fa2fb93ff285f4c6830780d073c8f4dd3c","bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"homepage":"https://github.com/rstacruz/mocha-jsdom#readme","_id":"mocha-jsdom@0.4.0","_shasum":"b80ae9b2797997d2303d2516a2f20505ba91b64c","_from":".","_npmVersion":"2.9.0","_nodeVersion":"2.0.2","_npmUser":{"name":"rstacruz","email":"rico@ricostacruz.com"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"dist":{"shasum":"b80ae9b2797997d2303d2516a2f20505ba91b64c","size":5367,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-0.4.0.tgz"},"directories":{},"publish_time":1432548559574,"_cnpm_publish_time":1432548559574,"_hasShrinkwrap":false},"0.3.0":{"name":"mocha-jsdom","version":"0.3.0","description":"Simple integration of jsdom into mocha tests","main":"index.js","scripts":{"test":"mocha","coverage":"env COVERAGE=1 mocha -R html-cov > coverage.html && open coverage.html"},"author":{"name":"Rico Sta. Cruz","email":"hi@ricostacruz.com"},"license":"MIT","keywords":["mocha","jsdom"],"repository":{"type":"git","url":"https://github.com/rstacruz/mocha-jsdom.git"},"devDependencies":{"blanket":"^1.1.6","chai":"^1.9.1","coveralls":"^2.11.2","jquery":"^2.1.1","jsdom":">=3.1.2","mocha":"^1.21.4","mocha-clean":"^0.2.0","mocha-lcov-reporter":"0.0.1"},"peerDependencies":{"mocha":"*","jsdom":"*"},"gitHead":"fd6b4209370349f3eb47b73c7c28ce571bdb7fbd","bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"homepage":"https://github.com/rstacruz/mocha-jsdom","_id":"mocha-jsdom@0.3.0","_shasum":"6f7f61c48e6d89afe3fb3d26841f3ab2ede82b7b","_from":".","_npmVersion":"2.1.3","_nodeVersion":"1.6.2","_npmUser":{"name":"rstacruz","email":"rico@ricostacruz.com"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"dist":{"shasum":"6f7f61c48e6d89afe3fb3d26841f3ab2ede82b7b","size":4685,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-0.3.0.tgz"},"directories":{},"publish_time":1428113624669,"_cnpm_publish_time":1428113624669,"_hasShrinkwrap":false},"0.2.1":{"name":"mocha-jsdom","version":"0.2.1","description":"Simple integration of jsdom into mocha tests","main":"index.js","scripts":{"test":"mocha","coverage":"env COVERAGE=1 mocha -R html-cov > coverage.html && open coverage.html"},"author":{"name":"Rico Sta. Cruz","email":"hi@ricostacruz.com"},"license":"MIT","keywords":["mocha","jsdom"],"repository":{"type":"git","url":"https://github.com/rstacruz/mocha-jsdom.git"},"devDependencies":{"blanket":"^1.1.6","chai":"^1.9.1","coveralls":"^2.11.2","jquery":"^2.1.1","jsdom":"^1.0.0-pre.7","mocha":"^1.21.4","mocha-clean":"^0.2.0","mocha-lcov-reporter":"0.0.1"},"peerDependencies":{"mocha":"*","jsdom":"*"},"gitHead":"2ca1c0bb9ada0b82b39b7eac9bb28a9308f26d46","bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"homepage":"https://github.com/rstacruz/mocha-jsdom","_id":"mocha-jsdom@0.2.1","_shasum":"80777c6cfe7885c67b69b696f042712200a83b56","_from":".","_npmVersion":"2.5.1","_nodeVersion":"1.2.0","_npmUser":{"name":"rstacruz","email":"rico@ricostacruz.com"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"dist":{"shasum":"80777c6cfe7885c67b69b696f042712200a83b56","size":4577,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-0.2.1.tgz"},"directories":{},"publish_time":1424324637783,"_cnpm_publish_time":1424324637783,"_hasShrinkwrap":false},"0.2.0":{"name":"mocha-jsdom","version":"0.2.0","description":"Simple integration of jsdom into mocha tests","main":"index.js","scripts":{"test":"mocha","coverage":"env COVERAGE=1 mocha -R html-cov > coverage.html && open coverage.html"},"author":{"name":"Rico Sta. Cruz","email":"hi@ricostacruz.com"},"license":"MIT","keywords":["mocha","jsdom"],"repository":{"type":"git","url":"https://github.com/rstacruz/mocha-jsdom.git"},"devDependencies":{"blanket":"^1.1.6","chai":"^1.9.1","coveralls":"^2.11.2","jquery":"^2.1.1","jsdom":"^1.0.0-pre.7","mocha":"^1.21.4","mocha-clean":"^0.2.0","mocha-lcov-reporter":"0.0.1"},"peerDependencies":{"mocha":"*","jsdom":"*"},"gitHead":"e3a9d97157b6ec00ac0c3f8b8f56987a6951e158","bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"homepage":"https://github.com/rstacruz/mocha-jsdom","_id":"mocha-jsdom@0.2.0","_shasum":"6e53edb562291c037955360aa33c69bbf6bd20bc","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"rstacruz","email":"rico@ricostacruz.com"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"dist":{"shasum":"6e53edb562291c037955360aa33c69bbf6bd20bc","size":3826,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-0.2.0.tgz"},"directories":{},"publish_time":1415169945811,"_cnpm_publish_time":1415169945811,"_hasShrinkwrap":false},"0.1.1":{"name":"mocha-jsdom","version":"0.1.1","description":"Simple integration of jsdom into mocha tests","main":"index.js","scripts":{"test":"mocha"},"author":{"name":"Rico Sta. Cruz","email":"hi@ricostacruz.com"},"license":"MIT","keywords":["mocha","jsdom"],"repository":{"type":"git","url":"https://github.com/rstacruz/mocha-jsdom.git"},"devDependencies":{"chai":"^1.9.1","jquery":"^2.1.1","jsdom":"^1.0.0-pre.7","mocha":"^1.21.4","mocha-clean":"^0.2.0"},"peerDependencies":{"mocha":"*","jsdom":"*"},"gitHead":"77233a8a17c7d09318f43381251645bfaf95a934","bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"homepage":"https://github.com/rstacruz/mocha-jsdom","_id":"mocha-jsdom@0.1.1","_shasum":"d776218ea71b8cf78b70855f7da7ed57ad4aecfb","_from":".","_npmVersion":"1.4.16","_npmUser":{"name":"rstacruz","email":"rico@ricostacruz.com"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"dist":{"shasum":"d776218ea71b8cf78b70855f7da7ed57ad4aecfb","size":3543,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-0.1.1.tgz"},"directories":{},"publish_time":1411829504427,"_cnpm_publish_time":1411829504427,"_hasShrinkwrap":false},"0.1.0":{"name":"mocha-jsdom","version":"0.1.0","description":"Simple integration of jsdom into mocha tests","main":"index.js","scripts":{"test":"mocha"},"author":{"name":"Rico Sta. Cruz","email":"hi@ricostacruz.com"},"license":"MIT","keywords":["mocha","jsdom"],"devDependencies":{"chai":"^1.9.1","jquery":"^2.1.1","jsdom":"^1.0.0-pre.7","mocha":"^1.21.4","mocha-clean":"^0.2.0"},"peerDependencies":{"mocha":"*","jsdom":"*"},"gitHead":"9a5f1081ad3196931106784f488508e45ad22a41","_id":"mocha-jsdom@0.1.0","_shasum":"eee0f5f3573b2530d309f9c981100532d7cf15e1","_from":".","_npmVersion":"1.4.16","_npmUser":{"name":"rstacruz","email":"rico@ricostacruz.com"},"maintainers":[{"name":"rstacruz","email":"rico@ricostacruz.com"}],"dist":{"shasum":"eee0f5f3573b2530d309f9c981100532d7cf15e1","size":2848,"noattachment":false,"key":"/mocha-jsdom/-/mocha-jsdom-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-jsdom/download/mocha-jsdom-0.1.0.tgz"},"directories":{},"publish_time":1411730137521,"_cnpm_publish_time":1411730137521,"_hasShrinkwrap":false}},"readme":"> _Deprecation notice:_\n> Consider [jsdom-global](https://github.com/rstacruz/jsdom-global) instead, a simpler alternative that also works outside of Mocha. `mocha-jsdom` still works, but `jsdom-global` is better supported.\n\n---\n\n# mocha-jsdom\n\n> Test frontend libraries in the console using Node.js, [mocha] and [jsdom]. \n\n[![Status](https://travis-ci.org/rstacruz/mocha-jsdom.svg?branch=master)](https://travis-ci.org/rstacruz/mocha-jsdom \"See test builds\")\n\n<br>\n\n## Usage\n\n```sh\n$ npm i --save-dev mocha-jsdom\n```\n\n[![npm version](http://img.shields.io/npm/v/mocha-jsdom.svg?style=flat)](https://npmjs.org/package/mocha-jsdom \"View this project on npm\")\n\nUse `jsdom()` inside your `describe(...)` block (or the global context). It will \nturn your Node.js environment into a mock browser environment supporting the \nfull DOM and browser API. The variables `window`, `document`, `history` (and so \non) will then be available for use.\n\n```js\nvar jsdom = require('mocha-jsdom')\nvar expect = require('chai').expect\n\ndescribe('mocha tests', function () {\n\n  jsdom()\n\n  it('has document', function () {\n    var div = document.createElement('div')\n    expect(div.nodeName).eql('DIV')\n  })\n\n})\n```\n\nSee [examples/basic](examples/basic) for an example of a basic setup.\n\n<br>\n\n## Upgrading to v2.0.0\n\nIf you are coming from mocha-jsdom v1.x, remove `jsdom` if you're not using it before upgrading. `jsdom` is now a direct dependency of `mocha-jsdom`.\n\n```bash\n# using Yarn\nyarn remove jsdom\nyarn upgrade mocha-jsdom\n```\n\n```bash\n# using npm\nnpm uninstall -S -D jsdom\nnpm upgrade mocha-jsdom\n```\n\n<br>\n\n## Node and io.js information\n\nAs of jsdom 4.0.0, [jsdom now requires io.js](https://github.com/tmpvar/jsdom/blob/master/Changelog.md#400) and will not work with Node.js 0.12 or below.\n\n<br>\n\n## How it works\n\nmocha-jsdom is a simple glue to integrate [jsdom] to mocha.\n\nInvoking `jsdom()` will inject `before` and `after` handlers to the current \nmocha suite which will setup and teardown jsdom. Here's what it does:\n\n* __Window__: `global.window` will be available as the jsdom.\n\n* __Globals__: global variables like `document` and `history` are propagated, \n  and they're cleaned up after tests run.\n\n* __Error handling__: jsdom errors are sanitized so that their stack traces are \nshortened.\n\n__NB:__ Before you try this library, learn about jsdom first. In fact, you may be \nable to integrate jsdom into your tests *without* this library; this is mostly \nsyntactic sugar and reasonable defaults.\n\n<br>\n\n## Using with a library\n\nPerfect for testing small DOM-consuming utilities in the console. See \n[test/jquery.js](test/jquery.js) for an example.\n\n```js\ndescribe('mocha tests', function () {\n\n  var $\n  jsdom()\n\n  before(function () {\n    $ = require('jquery')\n  })\n\n  it('works', function () {\n    document.body.innerHTML = '<div>hola</div>'\n    expect($(\"div\").html()).eql('hola')\n  })\n\n})\n```\n\nSee [examples/basic](examples/basic) for an example of a basic setup.\n\n<br>\n\n## Using with a library, alternate\n\nYou can also pass the source code via `src`:\n\n```js\ndescribe('mocha tests', function () {\n  jsdom({\n    src: fs.readFileSync('jquery.js', 'utf-8')\n  })\n\n  ...\n})\n```\n\n<br>\n\n## Configuration\n\nYou can pass jsdom options:\n\n```js\ndescribe('mocha tests', function () {\n  jsdom({\n    parsingMode: 'xml'\n  })\n\n  ...\n})\n```\n\n<br>\n\n## Working with mocha --watch\n\nWhen using with `--watch`, you my encounter strange errors from 3rd-party\nlibraries like jQuery not working properly.\n\nIn these cases, use `require('mocha-jsdom').rerequire` instead of `require()`.\nThis will ensure that the `require()` call will always happen.\n\n```js\nvar $\nvar jsdom = require('mocha-jsdom')\nvar rerequire = jsdom.rerequire\n\njsdom()\n\nbefore(function () {\n  $ = rerequire('jquery')\n})\n```\n\n<br>\n\n## Special config\n\nOther mocha-jsdom specific options:\n\n * `globalize` - propagates to values in `window` to `global`. defaults to true.\n\n * `console` - allows you to use `console.log` inside a jsdom script. defaults \n to true.\n\n * `useEach` - bind to Mocha's `beforeEach`/`afterEach` rather than `before`/`after`.\n defaults to false.\n\n * `skipWindowCheck` - skips checking of `window` at startup. When false,\n mocha-jsdom will throw an error if `window` already exists. Defaults to false.\n\n[jsdom]: https://www.npmjs.org/package/jsdom\n[mocha]: https://www.npmjs.com/package/mocha\n\n<br>\n\n## Testling support\n\nYes, fully compatible with testling. A test suite using jsdom should be able to use testling.\n\nSee [examples/basic](examples/basic/) for a setup that allows for testing via iojs (jsdom), testling, and mocha via the browser.\n\n<br>\n\n## Thanks\n\n> **mocha-jsdom** © 2014-2018 Rico Sta. Cruz. Released under the [MIT] License.<br>\n> Authored and maintained by Rico Sta. Cruz with help from contributors ([list][contributors]).\n\n[![](https://img.shields.io/github/followers/rstacruz.svg?style=social&label=@rstacruz)](https://github.com/rstacruz)\n&nbsp;&nbsp;\n[![](https://img.shields.io/twitter/follow/rstacruz.svg?style=social&label=@rstacruz)](https://twitter.com/rstacruz)\n&nbsp;&nbsp;\n**[ricostacruz.com](http://ricostacruz.com)**\n\n[mit]: http://mit-license.org/\n[contributors]: http://github.com/rstacruz/mocha-jsdom/contributors\n","_attachments":{},"homepage":"https://github.com/rstacruz/mocha-jsdom#readme","bugs":{"url":"https://github.com/rstacruz/mocha-jsdom/issues"},"license":"MIT"}