{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/ava/issues/822","repository_url":"https://api.github.com/repos/sindresorhus/ava","labels_url":"https://api.github.com/repos/sindresorhus/ava/issues/822/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/ava/issues/822/comments","events_url":"https://api.github.com/repos/sindresorhus/ava/issues/822/events","html_url":"https://github.com/sindresorhus/ava/issues/822","id":153972285,"number":822,"title":"beautifyStack error when jsdom is imported","user":{"login":"nfcampos","id":56902,"avatar_url":"https://avatars.githubusercontent.com/u/56902?v=3","gravatar_id":"","url":"https://api.github.com/users/nfcampos","html_url":"https://github.com/nfcampos","followers_url":"https://api.github.com/users/nfcampos/followers","following_url":"https://api.github.com/users/nfcampos/following{/other_user}","gists_url":"https://api.github.com/users/nfcampos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfcampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfcampos/subscriptions","organizations_url":"https://api.github.com/users/nfcampos/orgs","repos_url":"https://api.github.com/users/nfcampos/repos","events_url":"https://api.github.com/users/nfcampos/events{/privacy}","received_events_url":"https://api.github.com/users/nfcampos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sindresorhus/ava/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/sindresorhus/ava/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-10T10:21:23Z","updated_at":"2016-05-12T09:45:42Z","closed_at":null,"body":"## Description\r\n\r\nThe following test file\r\n```js\r\nimport test from 'ava'\r\n\r\nimport {jsdom} from 'jsdom'\r\nglobal.document = jsdom('')\r\nglobal.window = document.defaultView\r\nObject.keys(document.defaultView).forEach((property) => {\r\n  if (typeof global[property] === 'undefined') {\r\n    global[property] = document.defaultView[property]\r\n  }\r\n})\r\n\r\ntest('yay', t => {\r\n  t.is(true, false)\r\n})\r\n```\r\nresults in an error when processing the test failure\r\n<img width=\"533\" alt=\"screen shot 2016-05-10 at 11 13 10\" src=\"https://cloud.githubusercontent.com/assets/56902/15143157/38cbd8c0-16a0-11e6-8a2f-c49ee9732d75.png\">\r\nIt's somehow related to that `Object.keys().forEach()` which copies properties from `window` to `global`. (if I comment it out it doesn't happen)\r\nThat snippet is what we suggest users do to use `enzyme` with `jsdom` https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md\r\nI don't see anything wrong with it, since it doesn't replace any global properties that already existed.\r\nSo I'm not sure whether this is a bug with `ava` or not, but it at least looks like the error message wasn't printed in its entirety. \r\n\r\n## Environment\r\n\r\n```\r\nNode.js v6.0.0\r\ndarwin 15.4.0\r\n```"},"comment":{"url":"https://api.github.com/repos/sindresorhus/ava/issues/comments/218709825","html_url":"https://github.com/sindresorhus/ava/issues/822#issuecomment-218709825","issue_url":"https://api.github.com/repos/sindresorhus/ava/issues/822","id":218709825,"user":{"login":"nfcampos","id":56902,"avatar_url":"https://avatars.githubusercontent.com/u/56902?v=3","gravatar_id":"","url":"https://api.github.com/users/nfcampos","html_url":"https://github.com/nfcampos","followers_url":"https://api.github.com/users/nfcampos/followers","following_url":"https://api.github.com/users/nfcampos/following{/other_user}","gists_url":"https://api.github.com/users/nfcampos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfcampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfcampos/subscriptions","organizations_url":"https://api.github.com/users/nfcampos/orgs","repos_url":"https://api.github.com/users/nfcampos/repos","events_url":"https://api.github.com/users/nfcampos/events{/privacy}","received_events_url":"https://api.github.com/users/nfcampos/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T09:45:42Z","updated_at":"2016-05-12T09:45:42Z","body":"do you guys want a PR adding that option?"}}