{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel-jest/issues/36","labels_url":"https://api.github.com/repos/babel/babel-jest/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel-jest/issues/36/comments","events_url":"https://api.github.com/repos/babel/babel-jest/issues/36/events","html_url":"https://github.com/babel/babel-jest/issues/36","id":99741056,"number":36,"title":"requiring react from test silently fails with iojs","user":{"login":"neojski","id":3188532,"avatar_url":"https://avatars.githubusercontent.com/u/3188532?v=3","gravatar_id":"","url":"https://api.github.com/users/neojski","html_url":"https://github.com/neojski","followers_url":"https://api.github.com/users/neojski/followers","following_url":"https://api.github.com/users/neojski/following{/other_user}","gists_url":"https://api.github.com/users/neojski/gists{/gist_id}","starred_url":"https://api.github.com/users/neojski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neojski/subscriptions","organizations_url":"https://api.github.com/users/neojski/orgs","repos_url":"https://api.github.com/users/neojski/repos","events_url":"https://api.github.com/users/neojski/events{/privacy}","received_events_url":"https://api.github.com/users/neojski/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-07T22:30:53Z","updated_at":"2015-10-03T20:04:46Z","closed_at":"2015-09-10T02:16:00Z","body":"After issue #35 I installed iojs (v3.0.0). But the following fails: \r\n\r\n```js\r\n// __tests__/sum-test.js\r\njest.dontMock('../sum');\r\n\r\ndescribe('sum', function() {\r\n it('adds 1 + 2 to equal 3', function() {\r\n   require('react');\r\n   var sum = require('../sum');\r\n   expect(sum(1, 2)).toBe(3);\r\n }); \r\n});\r\n```\r\n\r\nwith a long error:\r\n```\r\n\r\n> @ test /home/neo/asdf\r\n> jest\r\n\r\nUsing Jest CLI v0.4.17\r\nWaiting on 1 test...\r\n FAIL  __tests__/test.js (0.507s)\r\n● sum › it adds 1 + 2 to equal 3\r\n  - TypeError: /home/neo/asdf/node_modules/react/addons.js: /home/neo/asdf/node_modules/react/lib/ReactWithAddons.js: /home/neo/asdf/node_modules/react/lib/LinkedStateMixin.js: /home/neo/asdf/node_modules/react/lib/ReactLink.js: /home/neo/asdf/node_modules/react/lib/React.js: /home/neo/asdf/node_modules/react/lib/ReactComponent.js: /home/neo/asdf/node_modules/react/lib/ReactUpdateQueue.js: /home/neo/asdf/node_modules/react/lib/ReactUpdates.js: CallbackQueue.getPooled is not a function\r\n        at Object.<anonymous> (/home/neo/asdf/node_modules/react/lib/ReactUpdates.js:26:39)\r\n        at Object.runContentWithLocalBindings (/home/neo/asdf/node_modules/jest-cli/src/lib/utils.js:495:17)\r\n        at Loader._execModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:236:9)\r\n        at Loader.requireModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:905:12)\r\n        at Loader._generateMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:267:30)\r\n        at Loader.requireMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:801:43)\r\n        at Loader.requireModuleOrMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:924:17)\r\n        at Object.<anonymous> (/home/neo/asdf/node_modules/react/lib/ReactUpdateQueue.js:18:20)\r\n        at Object.runContentWithLocalBindings (/home/neo/asdf/node_modules/jest-cli/src/lib/utils.js:495:17)\r\n        at Loader._execModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:236:9)\r\n        at Loader.requireModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:905:12)\r\n        at Loader._generateMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:267:30)\r\n        at Loader.requireMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:801:43)\r\n        at Loader.requireModuleOrMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:924:17)\r\n        at Object.<anonymous> (/home/neo/asdf/node_modules/react/lib/ReactComponent.js:14:24)\r\n        at Object.runContentWithLocalBindings (/home/neo/asdf/node_modules/jest-cli/src/lib/utils.js:495:17)\r\n        at Loader._execModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:236:9)\r\n        at Loader.requireModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:905:12)\r\n        at Loader._generateMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:267:30)\r\n        at Loader.requireMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:801:43)\r\n        at Loader.requireModuleOrMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:924:17)\r\n        at Object.<anonymous> (/home/neo/asdf/node_modules/react/lib/React.js:18:22)\r\n        at Object.runContentWithLocalBindings (/home/neo/asdf/node_modules/jest-cli/src/lib/utils.js:495:17)\r\n        at Loader._execModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:236:9)\r\n        at Loader.requireModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:905:12)\r\n        at Loader._generateMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:267:30)\r\n        at Loader.requireMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:801:43)\r\n        at Loader.requireModuleOrMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:924:17)\r\n        at Object.<anonymous> (/home/neo/asdf/node_modules/react/lib/ReactLink.js:38:13)\r\n        at Object.runContentWithLocalBindings (/home/neo/asdf/node_modules/jest-cli/src/lib/utils.js:495:17)\r\n        at Loader._execModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:236:9)\r\n        at Loader.requireModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:905:12)\r\n        at Loader._generateMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:267:30)\r\n        at Loader.requireMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:801:43)\r\n        at Loader.requireModuleOrMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:924:17)\r\n        at Object.<anonymous> (/home/neo/asdf/node_modules/react/lib/LinkedStateMixin.js:15:17)\r\n        at Object.runContentWithLocalBindings (/home/neo/asdf/node_modules/jest-cli/src/lib/utils.js:495:17)\r\n        at Loader._execModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:236:9)\r\n        at Loader.requireModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:905:12)\r\n        at Loader._generateMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:267:30)\r\n        at Loader.requireMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:801:43)\r\n        at Loader.requireModuleOrMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:924:17)\r\n        at Object.<anonymous> (/home/neo/asdf/node_modules/react/lib/ReactWithAddons.js:21:24)\r\n        at Object.runContentWithLocalBindings (/home/neo/asdf/node_modules/jest-cli/src/lib/utils.js:495:17)\r\n        at Loader._execModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:236:9)\r\n        at Loader.requireModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:905:12)\r\n        at Loader._generateMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:267:30)\r\n        at Loader.requireMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:801:43)\r\n        at Loader.requireModuleOrMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:924:17)\r\n        at Object.<anonymous> (/home/neo/asdf/node_modules/react/addons.js:1:115)\r\n        at Object.runContentWithLocalBindings (/home/neo/asdf/node_modules/jest-cli/src/lib/utils.js:495:17)\r\n        at Loader._execModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:236:9)\r\n        at Loader.requireModule (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:905:12)\r\n        at Loader._generateMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:267:30)\r\n        at Loader.requireMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:801:43)\r\n        at Loader.requireModuleOrMock (/home/neo/asdf/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:924:17)\r\n        at Spec.<anonymous> (/home/neo/asdf/__tests__/test.js:6:5)\r\n        at jasmine.Block.execute (/home/neo/asdf/node_modules/jest-cli/vendor/jasmine/jasmine-1.3.0.js:1065:17)\r\n        at jasmine.Queue.next_ (/home/neo/asdf/node_modules/jest-cli/vendor/jasmine/jasmine-1.3.0.js:2098:31)\r\n        at null._onTimeout (/home/neo/asdf/node_modules/jest-cli/vendor/jasmine/jasmine-1.3.0.js:2088:18)\r\n        at Timer.listOnTimeout (timers.js:89:15)\r\n1 test failed, 0 tests passed (1 total)\r\nRun time: 0.806s\r\nnpm ERR! Test failed.  See above for more details.\r\n```\r\n\r\nI'm not sure but it looks to me like `jest` is trying to mock `react` but it fails to do so. I tried to tell it to `jest.dontMock('react')` but with no difference.\r\n\r\nJust a side-note: I normally use `gulp` to bundle my scripts with `browserify` that uses babel with config in `package.json` (babelify)."},"comment":{"url":"https://api.github.com/repos/babel/babel-jest/issues/comments/145282615","html_url":"https://github.com/babel/babel-jest/issues/36#issuecomment-145282615","issue_url":"https://api.github.com/repos/babel/babel-jest/issues/36","id":145282615,"user":{"login":"jstejada","id":1271509,"avatar_url":"https://avatars.githubusercontent.com/u/1271509?v=3","gravatar_id":"","url":"https://api.github.com/users/jstejada","html_url":"https://github.com/jstejada","followers_url":"https://api.github.com/users/jstejada/followers","following_url":"https://api.github.com/users/jstejada/following{/other_user}","gists_url":"https://api.github.com/users/jstejada/gists{/gist_id}","starred_url":"https://api.github.com/users/jstejada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstejada/subscriptions","organizations_url":"https://api.github.com/users/jstejada/orgs","repos_url":"https://api.github.com/users/jstejada/repos","events_url":"https://api.github.com/users/jstejada/events{/privacy}","received_events_url":"https://api.github.com/users/jstejada/received_events","type":"User","site_admin":false},"created_at":"2015-10-03T20:04:46Z","updated_at":"2015-10-03T20:04:46Z","body":"same for me. @boourns "}}