{"action":"created","issue":{"url":"https://api.github.com/repos/cure53/DOMPurify/issues/129","labels_url":"https://api.github.com/repos/cure53/DOMPurify/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/cure53/DOMPurify/issues/129/comments","events_url":"https://api.github.com/repos/cure53/DOMPurify/issues/129/events","html_url":"https://github.com/cure53/DOMPurify/issues/129","id":121075568,"number":129,"title":"Run node.js with jsdom in the browser grid","user":{"login":"samertm","id":969377,"avatar_url":"https://avatars.githubusercontent.com/u/969377?v=3","gravatar_id":"","url":"https://api.github.com/users/samertm","html_url":"https://github.com/samertm","followers_url":"https://api.github.com/users/samertm/followers","following_url":"https://api.github.com/users/samertm/following{/other_user}","gists_url":"https://api.github.com/users/samertm/gists{/gist_id}","starred_url":"https://api.github.com/users/samertm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samertm/subscriptions","organizations_url":"https://api.github.com/users/samertm/orgs","repos_url":"https://api.github.com/users/samertm/repos","events_url":"https://api.github.com/users/samertm/events{/privacy}","received_events_url":"https://api.github.com/users/samertm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-08T19:00:24Z","updated_at":"2015-12-19T23:27:34Z","closed_at":null,"body":"Following up with https://github.com/cure53/DOMPurify/issues/61.\r\n\r\nHow much work would it take to run DOMPurify's test suite with node.js and jsdom? I'd be willing to help out."},"comment":{"url":"https://api.github.com/repos/cure53/DOMPurify/issues/comments/166033406","html_url":"https://github.com/cure53/DOMPurify/issues/129#issuecomment-166033406","issue_url":"https://api.github.com/repos/cure53/DOMPurify/issues/129","id":166033406,"user":{"login":"Joris-van-der-Wel","id":745898,"avatar_url":"https://avatars.githubusercontent.com/u/745898?v=3","gravatar_id":"","url":"https://api.github.com/users/Joris-van-der-Wel","html_url":"https://github.com/Joris-van-der-Wel","followers_url":"https://api.github.com/users/Joris-van-der-Wel/followers","following_url":"https://api.github.com/users/Joris-van-der-Wel/following{/other_user}","gists_url":"https://api.github.com/users/Joris-van-der-Wel/gists{/gist_id}","starred_url":"https://api.github.com/users/Joris-van-der-Wel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joris-van-der-Wel/subscriptions","organizations_url":"https://api.github.com/users/Joris-van-der-Wel/orgs","repos_url":"https://api.github.com/users/Joris-van-der-Wel/repos","events_url":"https://api.github.com/users/Joris-van-der-Wel/events{/privacy}","received_events_url":"https://api.github.com/users/Joris-van-der-Wel/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T23:27:34Z","updated_at":"2015-12-19T23:27:34Z","body":"One downside of `karma-jsdom-launcher` is that you will be using an older version of jsdom. That library lists jsdom as its dependency and pins it at version 6.x.x, it would have been better if it had listed jsdom as a peerDependency, so that you can specify the version yourself. If I use the jsdom launcher in the same way as you did, I get the same error. However if I force the latest version of jsdom (7.2.1) to be loaded, the results are much better and it actually starts to run tests (`rm -rf node_modules/jsdom && npm i jsdom@latest`). \r\n\r\nThere is still something fishy going on though, my result is `Executed 254 of 1156 (36 FAILED) ERROR`. The last time I was working on jsdom support for DOMPurify, no tests were skipped and the failures were in the single digits.\r\n\r\nAnother downside is that it can make things a bit harder to debug (as you have noticed).\r\n\r\nSomething else that would also be useful to test is that you can use DOMPurify + jsdom without allowing script execution, you do not even have to use `jsdom.env()`. However you will not be able to test that using a karma launcher:\r\n\r\n```javascript\r\nvar document = require('jsdom').jsdom('', {\r\n    FetchExternalResources: false,\r\n    ProcessExternalResources: false\r\n});\r\nvar DOMPurify = require('dompurify')(document.defaultView);\r\nconsole.log(DOMPurify.sanitize('<script>alert(\"hi\");</script><p>hello</p>'));\r\n```\r\n"}}