{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/jest/issues/1097","repository_url":"https://api.github.com/repos/facebook/jest","labels_url":"https://api.github.com/repos/facebook/jest/issues/1097/labels{/name}","comments_url":"https://api.github.com/repos/facebook/jest/issues/1097/comments","events_url":"https://api.github.com/repos/facebook/jest/issues/1097/events","html_url":"https://github.com/facebook/jest/pull/1097","id":157925746,"number":1097,"title":"implement snapshots validation","user":{"login":"kentaromiura","id":87300,"avatar_url":"https://avatars.githubusercontent.com/u/87300?v=3","gravatar_id":"","url":"https://api.github.com/users/kentaromiura","html_url":"https://github.com/kentaromiura","followers_url":"https://api.github.com/users/kentaromiura/followers","following_url":"https://api.github.com/users/kentaromiura/following{/other_user}","gists_url":"https://api.github.com/users/kentaromiura/gists{/gist_id}","starred_url":"https://api.github.com/users/kentaromiura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentaromiura/subscriptions","organizations_url":"https://api.github.com/users/kentaromiura/orgs","repos_url":"https://api.github.com/users/kentaromiura/repos","events_url":"https://api.github.com/users/kentaromiura/events{/privacy}","received_events_url":"https://api.github.com/users/kentaromiura/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":1,"created_at":"2016-06-01T14:46:12Z","updated_at":"2016-06-01T18:26:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/jest/pulls/1097","html_url":"https://github.com/facebook/jest/pull/1097","diff_url":"https://github.com/facebook/jest/pull/1097.diff","patch_url":"https://github.com/facebook/jest/pull/1097.patch"},"body":"Snapshots get cleaned in this way:\r\n\r\n- Everytime a test has at least one `toMatchSnapshot`:\r\n  we keep track of which snapshots didn't run, we delete those in `save`\r\n- If a test file exists but there's no `toMatchSnapshot`:\r\n  same logic as above, plus `save` will now tell if a snapshot existed\r\npreviously so that we can add it to the summary\r\n- if the test file no longer exists:\r\n  we use the hastemap at the end of the run to check if all the\r\nsnapshots have an associated test file, we then delete the orphan one."},"comment":{"url":"https://api.github.com/repos/facebook/jest/issues/comments/223082471","html_url":"https://github.com/facebook/jest/pull/1097#issuecomment-223082471","issue_url":"https://api.github.com/repos/facebook/jest/issues/1097","id":223082471,"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-06-01T18:26:54Z","updated_at":"2016-06-01T18:26:54Z","body":"I left a bunch of comments regarding code style, variable naming and maintenance concerns. Overall your solution looks good and those are just minor comments.\r\n\r\nOne high-level comment: I believe that we should consider the update flag for validation: all validations should make the test file *throw*, even if it was deleted (we'll just produce a \"fake\" result entry). It should then highlight in the summary that snapshots aren't valid any more and have to be cleaned up, and `jest -u` should be used to do that. What do you think?"}}
{"actor":{"display_login":"cpojer"}}