{"action":"closed","number":11567,"pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/11567","id":98794832,"html_url":"https://github.com/facebook/react-native/pull/11567","diff_url":"https://github.com/facebook/react-native/pull/11567.diff","patch_url":"https://github.com/facebook/react-native/pull/11567.patch","issue_url":"https://api.github.com/repos/facebook/react-native/issues/11567","number":11567,"state":"closed","locked":false,"title":"Jest - Support Immutable Objects for ListViewDataSource mock","user":{"login":"manosim","id":6333409,"avatar_url":"https://avatars.githubusercontent.com/u/6333409?v=3","gravatar_id":"","url":"https://api.github.com/users/manosim","html_url":"https://github.com/manosim","followers_url":"https://api.github.com/users/manosim/followers","following_url":"https://api.github.com/users/manosim/following{/other_user}","gists_url":"https://api.github.com/users/manosim/gists{/gist_id}","starred_url":"https://api.github.com/users/manosim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manosim/subscriptions","organizations_url":"https://api.github.com/users/manosim/orgs","repos_url":"https://api.github.com/users/manosim/repos","events_url":"https://api.github.com/users/manosim/events{/privacy}","received_events_url":"https://api.github.com/users/manosim/received_events","type":"User","site_admin":false},"body":"Currently the jest mock for `ListViewDataSource` has a property called `items` which returns the number of items of the data source. Example from a snapshot:\r\n\r\n    ListViewDataSource {\r\n      \"items\": 6,\r\n    }\r\n\r\nIf the datablob includes immutable Maps like:\r\n\r\n    const dataBlob = {\r\n      'alpha': immutable.Map({ name: 'Alpha' }),\r\n      'beta': immutable.Map({ name: 'Beta' }),\r\n    };\r\n\r\nthen the result is: \r\n\r\n    ListViewDataSource {\r\n      \"items\": NaN,\r\n    }\r\n\r\nThis PR checks if the properties of the `dataBlob` are immutable Maps and then checks whether they are empty.\r\n\r\nThe result for the above dataBlob would be:\r\n\r\n    ListViewDataSource {\r\n      \"items\": 2,\r\n    }","created_at":"2016-12-20T17:48:20Z","updated_at":"2016-12-21T00:58:55Z","closed_at":"2016-12-21T00:58:55Z","merged_at":null,"merge_commit_sha":"88e0e326cfbb865127182f03c68e3fe38d4473ba","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/react-native/pulls/11567/commits","review_comments_url":"https://api.github.com/repos/facebook/react-native/pulls/11567/comments","review_comment_url":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/11567/comments","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/e18d665fd7d71f8571e4174840a42344c1a20727","head":{"label":"manosim:jest-mock-datasource-immutable","ref":"jest-mock-datasource-immutable","sha":"e18d665fd7d71f8571e4174840a42344c1a20727","user":{"login":"manosim","id":6333409,"avatar_url":"https://avatars.githubusercontent.com/u/6333409?v=3","gravatar_id":"","url":"https://api.github.com/users/manosim","html_url":"https://github.com/manosim","followers_url":"https://api.github.com/users/manosim/followers","following_url":"https://api.github.com/users/manosim/following{/other_user}","gists_url":"https://api.github.com/users/manosim/gists{/gist_id}","starred_url":"https://api.github.com/users/manosim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manosim/subscriptions","organizations_url":"https://api.github.com/users/manosim/orgs","repos_url":"https://api.github.com/users/manosim/repos","events_url":"https://api.github.com/users/manosim/events{/privacy}","received_events_url":"https://api.github.com/users/manosim/received_events","type":"User","site_admin":false},"repo":{"id":76978332,"name":"react-native","full_name":"manosim/react-native","owner":{"login":"manosim","id":6333409,"avatar_url":"https://avatars.githubusercontent.com/u/6333409?v=3","gravatar_id":"","url":"https://api.github.com/users/manosim","html_url":"https://github.com/manosim","followers_url":"https://api.github.com/users/manosim/followers","following_url":"https://api.github.com/users/manosim/following{/other_user}","gists_url":"https://api.github.com/users/manosim/gists{/gist_id}","starred_url":"https://api.github.com/users/manosim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manosim/subscriptions","organizations_url":"https://api.github.com/users/manosim/orgs","repos_url":"https://api.github.com/users/manosim/repos","events_url":"https://api.github.com/users/manosim/events{/privacy}","received_events_url":"https://api.github.com/users/manosim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/manosim/react-native","description":"A framework for building native apps with React.","fork":true,"url":"https://api.github.com/repos/manosim/react-native","forks_url":"https://api.github.com/repos/manosim/react-native/forks","keys_url":"https://api.github.com/repos/manosim/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manosim/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manosim/react-native/teams","hooks_url":"https://api.github.com/repos/manosim/react-native/hooks","issue_events_url":"https://api.github.com/repos/manosim/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/manosim/react-native/events","assignees_url":"https://api.github.com/repos/manosim/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/manosim/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/manosim/react-native/tags","blobs_url":"https://api.github.com/repos/manosim/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manosim/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manosim/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/manosim/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manosim/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/manosim/react-native/languages","stargazers_url":"https://api.github.com/repos/manosim/react-native/stargazers","contributors_url":"https://api.github.com/repos/manosim/react-native/contributors","subscribers_url":"https://api.github.com/repos/manosim/react-native/subscribers","subscription_url":"https://api.github.com/repos/manosim/react-native/subscription","commits_url":"https://api.github.com/repos/manosim/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/manosim/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/manosim/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/manosim/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/manosim/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/manosim/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manosim/react-native/merges","archive_url":"https://api.github.com/repos/manosim/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manosim/react-native/downloads","issues_url":"https://api.github.com/repos/manosim/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/manosim/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/manosim/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/manosim/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manosim/react-native/labels{/name}","releases_url":"https://api.github.com/repos/manosim/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/manosim/react-native/deployments","created_at":"2016-12-20T17:39:08Z","updated_at":"2016-12-20T17:39:22Z","pushed_at":"2016-12-20T23:47:54Z","git_url":"git://github.com/manosim/react-native.git","ssh_url":"git@github.com:manosim/react-native.git","clone_url":"https://github.com/manosim/react-native.git","svn_url":"https://github.com/manosim/react-native","homepage":"http://facebook.github.io/react-native/","size":108493,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"2f1d1bdfe8b8e02a7cea48aa530c5a120d46233c","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":29028775,"name":"react-native","full_name":"facebook/react-native","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/react-native","description":"A framework for building native apps with React.","fork":false,"url":"https://api.github.com/repos/facebook/react-native","forks_url":"https://api.github.com/repos/facebook/react-native/forks","keys_url":"https://api.github.com/repos/facebook/react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/react-native/teams","hooks_url":"https://api.github.com/repos/facebook/react-native/hooks","issue_events_url":"https://api.github.com/repos/facebook/react-native/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/react-native/events","assignees_url":"https://api.github.com/repos/facebook/react-native/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/react-native/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/react-native/tags","blobs_url":"https://api.github.com/repos/facebook/react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/react-native/languages","stargazers_url":"https://api.github.com/repos/facebook/react-native/stargazers","contributors_url":"https://api.github.com/repos/facebook/react-native/contributors","subscribers_url":"https://api.github.com/repos/facebook/react-native/subscribers","subscription_url":"https://api.github.com/repos/facebook/react-native/subscription","commits_url":"https://api.github.com/repos/facebook/react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/react-native/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/react-native/merges","archive_url":"https://api.github.com/repos/facebook/react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/react-native/downloads","issues_url":"https://api.github.com/repos/facebook/react-native/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/react-native/labels{/name}","releases_url":"https://api.github.com/repos/facebook/react-native/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/react-native/deployments","created_at":"2015-01-09T18:10:16Z","updated_at":"2016-12-21T00:55:37Z","pushed_at":"2016-12-21T00:58:32Z","git_url":"git://github.com/facebook/react-native.git","ssh_url":"git@github.com:facebook/react-native.git","clone_url":"https://github.com/facebook/react-native.git","svn_url":"https://github.com/facebook/react-native","homepage":"http://facebook.github.io/react-native/","size":108487,"stargazers_count":41847,"watchers_count":41847,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9560,"mirror_url":null,"open_issues_count":829,"forks":9560,"open_issues":829,"watchers":41847,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/react-native/pulls/11567"},"html":{"href":"https://github.com/facebook/react-native/pull/11567"},"issue":{"href":"https://api.github.com/repos/facebook/react-native/issues/11567"},"comments":{"href":"https://api.github.com/repos/facebook/react-native/issues/11567/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/react-native/pulls/11567/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/react-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/react-native/pulls/11567/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/react-native/statuses/e18d665fd7d71f8571e4174840a42344c1a20727"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":10,"review_comments":6,"commits":6,"additions":3,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"facebook-github-bot"}}