{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/6104","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/6104/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/6104/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/6104/events","html_url":"https://github.com/facebook/react-native/issues/6104","id":135744057,"number":6104,"title":"Promises broken in Jest tests ","user":{"login":"cgreening","id":706944,"avatar_url":"https://avatars.githubusercontent.com/u/706944?v=3","gravatar_id":"","url":"https://api.github.com/users/cgreening","html_url":"https://github.com/cgreening","followers_url":"https://api.github.com/users/cgreening/followers","following_url":"https://api.github.com/users/cgreening/following{/other_user}","gists_url":"https://api.github.com/users/cgreening/gists{/gist_id}","starred_url":"https://api.github.com/users/cgreening/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgreening/subscriptions","organizations_url":"https://api.github.com/users/cgreening/orgs","repos_url":"https://api.github.com/users/cgreening/repos","events_url":"https://api.github.com/users/cgreening/events{/privacy}","received_events_url":"https://api.github.com/users/cgreening/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"cpojer","id":13352,"avatar_url":"https://avatars.githubusercontent.com/u/13352?v=3","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-02-23T13:56:56Z","updated_at":"2016-04-12T09:58:50Z","closed_at":null,"body":"We have a very simple test case that reproduces this issue:\r\n```js\r\ndescribe('promises', function() {\r\n  it('should resolve', function(done) {\r\n    new Promise((resolve, reject) => {\r\n      resolve('it works');\r\n    }).then((result) => {\r\n      expect(result).toEqual('it works');\r\n      done();\r\n    }, (error) => {\r\n      expect(error).toBeFalsy();\r\n      done(error);\r\n    });\r\n  });\r\n});\r\n```\r\n\r\nresult:\r\n\r\n```\r\nUsing Jest CLI v0.8.2, jasmine2\r\n FAIL  __tests__/api_tests.js (5.02s)\r\n● promises › it should resolve\r\n  - Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.\r\n1 test failed, 0 tests passed (1 total in 1 test suite, run time 5.736s)\r\nnpm ERR! Test failed.  See above for more details.\r\n```\r\n\r\nexpected:\r\n\r\n```\r\nUsing Jest CLI v0.8.2, jasmine2\r\n PASS  __tests__/api_tests.js (0.212s)\r\n1 test passed (1 total in 1 test suite, run time 0.894s)\r\n```\r\n\r\nWe've tracked it down to this commit:\r\n\r\nhttps://github.com/facebook/react-native/commit/3ff39870ce776c653823e1733363be0401896294\r\n\r\nand this line in file `jestSupport/env.js`\r\n\r\n```js\r\nglobal.Promise = require('promise');\r\n```\r\n\r\nWhen we comment out this line the promise resolves as expected.\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/208826777","html_url":"https://github.com/facebook/react-native/issues/6104#issuecomment-208826777","issue_url":"https://api.github.com/repos/facebook/react-native/issues/6104","id":208826777,"user":{"login":"dooburt","id":1137899,"avatar_url":"https://avatars.githubusercontent.com/u/1137899?v=3","gravatar_id":"","url":"https://api.github.com/users/dooburt","html_url":"https://github.com/dooburt","followers_url":"https://api.github.com/users/dooburt/followers","following_url":"https://api.github.com/users/dooburt/following{/other_user}","gists_url":"https://api.github.com/users/dooburt/gists{/gist_id}","starred_url":"https://api.github.com/users/dooburt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dooburt/subscriptions","organizations_url":"https://api.github.com/users/dooburt/orgs","repos_url":"https://api.github.com/users/dooburt/repos","events_url":"https://api.github.com/users/dooburt/events{/privacy}","received_events_url":"https://api.github.com/users/dooburt/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T09:58:50Z","updated_at":"2016-04-12T09:58:50Z","body":"Any update on this issue? I've just started getting it and don't really want to touch the library..."}}