{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/jest/issues/306","repository_url":"https://api.github.com/repos/facebook/jest","labels_url":"https://api.github.com/repos/facebook/jest/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/facebook/jest/issues/306/comments","events_url":"https://api.github.com/repos/facebook/jest/issues/306/events","html_url":"https://github.com/facebook/jest/issues/306","id":61925203,"number":306,"title":"Doesn't seem to be mocking Reflux action.","user":{"login":"jehoshua02","id":625814,"avatar_url":"https://avatars.githubusercontent.com/u/625814?v=3","gravatar_id":"","url":"https://api.github.com/users/jehoshua02","html_url":"https://github.com/jehoshua02","followers_url":"https://api.github.com/users/jehoshua02/followers","following_url":"https://api.github.com/users/jehoshua02/following{/other_user}","gists_url":"https://api.github.com/users/jehoshua02/gists{/gist_id}","starred_url":"https://api.github.com/users/jehoshua02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jehoshua02/subscriptions","organizations_url":"https://api.github.com/users/jehoshua02/orgs","repos_url":"https://api.github.com/users/jehoshua02/repos","events_url":"https://api.github.com/users/jehoshua02/events{/privacy}","received_events_url":"https://api.github.com/users/jehoshua02/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-16T00:02:36Z","updated_at":"2016-02-17T10:31:32Z","closed_at":"2016-02-17T10:31:32Z","body":"I am using React with the [Reflux](https://github.com/spoike/refluxjs) framework and I would like to assert that a component is calling a particular reflux action after user interaction. But it doesn't seem that the reflux action is being mocked out appropriately so that I can assert it was called by the component. In fact, it seems like the component is getting the real action when it executes, but my test gets the mock.\r\n\r\nMy code is up on [github](https://github.com/jehoshua02/react-scrum/tree/62ba82577af83284958b4c84d0517f4b040e0782).\r\n\r\nThe issue can be reproduced with the following commands:\r\n\r\n```shell\r\ngit clone https://github.com/jehoshua02/react-scrum.git\r\ncd react-scrum\r\ngit checkout 62ba8\r\nnpm install\r\nnpm test\r\n```\r\n\r\nI have some code in there that logs out the action that the component is seeing, and again the action as the test sees it. It's clear that they are not the same.\r\n\r\nHow should I go about finding what is causing the problem? Are there known workarounds for this sort of thing? I'd like to keep moving forward building my application but not if I can't do it with TDD.\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/jest/issues/comments/185143436","html_url":"https://github.com/facebook/jest/issues/306#issuecomment-185143436","issue_url":"https://api.github.com/repos/facebook/jest/issues/306","id":185143436,"user":{"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},"created_at":"2016-02-17T10:31:32Z","updated_at":"2016-02-17T10:31:32Z","body":"I recommend unmocking reflux by default by putting it into the `unmockedModulePathPatterns`."}}