{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/jest/issues/374","labels_url":"https://api.github.com/repos/facebook/jest/issues/374/labels{/name}","comments_url":"https://api.github.com/repos/facebook/jest/issues/374/comments","events_url":"https://api.github.com/repos/facebook/jest/issues/374/events","html_url":"https://github.com/facebook/jest/pull/374","id":78807708,"number":374,"title":"[io.js] Update jsdom and get jest working on io.js","user":{"login":"ide","id":379606,"avatar_url":"https://avatars.githubusercontent.com/u/379606?v=3","gravatar_id":"","url":"https://api.github.com/users/ide","html_url":"https://github.com/ide","followers_url":"https://api.github.com/users/ide/followers","following_url":"https://api.github.com/users/ide/following{/other_user}","gists_url":"https://api.github.com/users/ide/gists{/gist_id}","starred_url":"https://api.github.com/users/ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ide/subscriptions","organizations_url":"https://api.github.com/users/ide/orgs","repos_url":"https://api.github.com/users/ide/repos","events_url":"https://api.github.com/users/ide/events{/privacy}","received_events_url":"https://api.github.com/users/ide/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/jest/labels/CLA%20Signed","name":"CLA Signed","color":"009900"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2015-05-21T03:36:05Z","updated_at":"2015-06-17T03:48:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/jest/pulls/374","html_url":"https://github.com/facebook/jest/pull/374","diff_url":"https://github.com/facebook/jest/pull/374.diff","patch_url":"https://github.com/facebook/jest/pull/374.patch"},"body":"This gets jest working on io.js 1.8.x and 2.0.x. io.js is reconciling with the Node Foundation so users who are still on Node are on the upgrade path that converges with io.js anyway. What this means is the jest version probably should be bumped to 0.5.0, where 0.4.x is a maintenance branch for legacy Node (typically with semver, a major version bump is required but 0.x.x releases are considered a free-for-all).\r\n\r\nThis diff is near the minimal amount of work to bring jest up to date and pass all of its tests.\r\n\r\n - Upgraded npm dependencies. The major update is jsdom from 0.10.3 to 5.4.3. This lets us drop the indirect contextify dependency.\r\n - Removed harmonize, since io.js uses modern V8 and enables stable ES6 features by default\r\n - Removed the `--harmony` flag from the TestRunner for the same reason (trivia: i added that line once upon a time, let me delete it)\r\n - Replaced jsdom's `run` with io.js's built-in `vm` module\r\n - Added support for curried arguments in the fake `nextTick` implementation, which io.js itself relies on\r\n - Updated the HasteModuleLoader to handle Node built-in modules before `node_modules` -- this fixes an issue I was getting with graceful-fs trying to require smalloc.\r\n - Patched coffeescript to use Array.isArray instead of `instanceof Array`. Working on getting that merged upstream.\r\n\r\nFixes #267 \r\n\r\nTest Plan:\r\n```\r\nnvm install iojs-1\r\nrm -fr node_modules && npm install\r\n\r\nnvm install iojs-2\r\nrm -fr node_modules && npm install\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/jest/issues/comments/112642386","html_url":"https://github.com/facebook/jest/pull/374#issuecomment-112642386","issue_url":"https://api.github.com/repos/facebook/jest/issues/374","id":112642386,"user":{"login":"ide","id":379606,"avatar_url":"https://avatars.githubusercontent.com/u/379606?v=3","gravatar_id":"","url":"https://api.github.com/users/ide","html_url":"https://github.com/ide","followers_url":"https://api.github.com/users/ide/followers","following_url":"https://api.github.com/users/ide/following{/other_user}","gists_url":"https://api.github.com/users/ide/gists{/gist_id}","starred_url":"https://api.github.com/users/ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ide/subscriptions","organizations_url":"https://api.github.com/users/ide/orgs","repos_url":"https://api.github.com/users/ide/repos","events_url":"https://api.github.com/users/ide/events{/privacy}","received_events_url":"https://api.github.com/users/ide/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T03:48:34Z","updated_at":"2015-06-17T03:48:34Z","body":"Here are some new results. I used `vm`, jsdom `<script src>`, and jsdom `<script>` with text content, all all three on io.js outperform master on Node 0.10, so that is a positive outcome! In order of performance on my laptop we have:\r\n\r\n| technique | time | notes |\r\n|-----------|------|-------|\r\n| vm | 2.30 seconds | 31% improvement over master |\r\n| script | 2.57 seconds | the filename in one stack frame becomes unhelpful like `(about:blank:undefined:undefined<script>:10:7)` |\r\n| `<script src>` | 2.80 seconds | the filename in one stack frame gets `file://` prepended to it |\r\n| master | 3.34 seconds | |\r\n\r\nSo I'm thinking that we should commit this with the `<script src>` technique, which is the slowest but provides a helpful stack trace entry and is still faster than master by 16%. Then later it probably makes sense for jsdom to expose the vm context or provide `runScriptWithoutScriptElement` which would let jsdom run about 18% faster compared to `<script src>`.\r\n\r\n---\r\n\r\nMaster on Node 0.10:\r\n```\r\n$ node bin/jest.js \r\nUsing Jest CLI v0.4.13\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-currentTestPath-test.js (0.014s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-genMockFromModule-test.js (0.332s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-NODE_PATH-test.js (0.675s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-getTestEnvData-test.js (0.761s)\r\n PASS  jasmineTestRunner/__tests__/JasmineReporter-test.js (0.135s)\r\n PASS  lib/__tests__/FakeTimers-test.js (0.095s)\r\n PASS  lib/__tests__/moduleMocker-test.js (0.025s)\r\n PASS  lib/__tests__/utils-pathNormalize-test.js (0.14s)\r\n PASS  __tests__/TestRunner-test.js (1.221s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-hasDependency-test.js (1.266s)\r\n PASS  lib/__tests__/utils-normalizeConfig-test.js (0.778s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireModuleOrMock-test.js (1.394s)\r\n PASS  __tests__/TestRunner-fs-test.js (1.834s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireMock-test.js (2.353s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireModule-test.js (2.725s)\r\n15 tests passed (15 total)\r\nRun time: 3.344s\r\n```\r\n\r\n`vm.runInContext` on io.js 2.3.0:\r\n```\r\n$ node bin/jest.js \r\nUsing Jest CLI v0.4.13\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-currentTestPath-test.js (0.018s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-genMockFromModule-test.js (0.25s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-getTestEnvData-test.js (0.315s)\r\n PASS  jasmineTestRunner/__tests__/JasmineReporter-test.js (0.1s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-NODE_PATH-test.js (0.451s)\r\n PASS  lib/__tests__/moduleMocker-test.js (0.022s)\r\n PASS  __tests__/TestRunner-test.js (0.562s)\r\n PASS  lib/__tests__/FakeTimers-test.js (0.094s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-hasDependency-test.js (0.615s)\r\n PASS  lib/__tests__/utils-pathNormalize-test.js (0.054s)\r\n PASS  lib/__tests__/utils-normalizeConfig-test.js (0.235s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireModuleOrMock-test.js (0.641s)\r\n PASS  __tests__/TestRunner-fs-test.js (1.072s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireMock-test.js (1.156s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireModule-test.js (1.207s)\r\n15 tests passed (15 total)\r\nRun time: 2.298s\r\n```\r\n\r\n`<script src>` on io.js 2.3.0:\r\n```\r\n$ node bin/jest.js \r\nUsing Jest CLI v0.4.13\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-currentTestPath-test.js (0.033s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-getTestEnvData-test.js (0.448s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-genMockFromModule-test.js (0.355s)\r\n PASS  jasmineTestRunner/__tests__/JasmineReporter-test.js (0.148s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-NODE_PATH-test.js (0.761s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-hasDependency-test.js (0.773s)\r\n PASS  lib/__tests__/moduleMocker-test.js (0.039s)\r\n PASS  lib/__tests__/FakeTimers-test.js (0.186s)\r\n PASS  lib/__tests__/utils-pathNormalize-test.js (0.088s)\r\n PASS  __tests__/TestRunner-test.js (1.002s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireModuleOrMock-test.js (0.868s)\r\n PASS  lib/__tests__/utils-normalizeConfig-test.js (0.565s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireMock-test.js (1.614s)\r\n PASS  __tests__/TestRunner-fs-test.js (1.712s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireModule-test.js (1.714s)\r\n15 tests passed (15 total)\r\nRun time: 2.798s\r\n```\r\n\r\n`<script>${source}</script>` on io.js 2.3.0:\r\n```\r\n$ node bin/jest.js \r\nUsing Jest CLI v0.4.13\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-currentTestPath-test.js (0.025s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-genMockFromModule-test.js (0.336s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-getTestEnvData-test.js (0.412s)\r\n PASS  jasmineTestRunner/__tests__/JasmineReporter-test.js (0.12s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-NODE_PATH-test.js (0.653s)\r\n PASS  lib/__tests__/moduleMocker-test.js (0.027s)\r\n PASS  lib/__tests__/FakeTimers-test.js (0.117s)\r\n PASS  lib/__tests__/utils-pathNormalize-test.js (0.091s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-hasDependency-test.js (0.875s)\r\n PASS  __tests__/TestRunner-test.js (0.94s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireModuleOrMock-test.js (0.762s)\r\n PASS  __tests__/TestRunner-fs-test.js (1.304s)\r\n PASS  lib/__tests__/utils-normalizeConfig-test.js (0.576s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireMock-test.js (1.432s)\r\n PASS  HasteModuleLoader/__tests__/HasteModuleLoader-requireModule-test.js (1.503s)\r\n15 tests passed (15 total)\r\nRun time: 2.572s\r\n```"}}