{"action":"created","issue":{"url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/59","repository_url":"https://api.github.com/repos/americanexpress/jest-image-snapshot","labels_url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/59/comments","events_url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/59/events","html_url":"https://github.com/americanexpress/jest-image-snapshot/issues/59","id":309477326,"node_id":"MDU6SXNzdWUzMDk0NzczMjY=","number":59,"title":"Removed snapshots are not cleaned up","user":{"login":"10xLaCroixDrinker","id":517295,"node_id":"MDQ6VXNlcjUxNzI5NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/517295?v=4","gravatar_id":"","url":"https://api.github.com/users/10xLaCroixDrinker","html_url":"https://github.com/10xLaCroixDrinker","followers_url":"https://api.github.com/users/10xLaCroixDrinker/followers","following_url":"https://api.github.com/users/10xLaCroixDrinker/following{/other_user}","gists_url":"https://api.github.com/users/10xLaCroixDrinker/gists{/gist_id}","starred_url":"https://api.github.com/users/10xLaCroixDrinker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/10xLaCroixDrinker/subscriptions","organizations_url":"https://api.github.com/users/10xLaCroixDrinker/orgs","repos_url":"https://api.github.com/users/10xLaCroixDrinker/repos","events_url":"https://api.github.com/users/10xLaCroixDrinker/events{/privacy}","received_events_url":"https://api.github.com/users/10xLaCroixDrinker/received_events","type":"User","site_admin":false},"labels":[{"id":634729493,"node_id":"MDU6TGFiZWw2MzQ3Mjk0OTM=","url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2018-03-28T18:21:21Z","updated_at":"2018-10-02T19:34:35Z","closed_at":null,"author_association":"MEMBER","body":"When running `jest` with `-u` flag after removing an image snapshot from a test, the image snapshot file is not deleted."},"comment":{"url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/comments/426402178","html_url":"https://github.com/americanexpress/jest-image-snapshot/issues/59#issuecomment-426402178","issue_url":"https://api.github.com/repos/americanexpress/jest-image-snapshot/issues/59","id":426402178,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjQwMjE3OA==","user":{"login":"piratefsh","id":1868400,"node_id":"MDQ6VXNlcjE4Njg0MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/1868400?v=4","gravatar_id":"","url":"https://api.github.com/users/piratefsh","html_url":"https://github.com/piratefsh","followers_url":"https://api.github.com/users/piratefsh/followers","following_url":"https://api.github.com/users/piratefsh/following{/other_user}","gists_url":"https://api.github.com/users/piratefsh/gists{/gist_id}","starred_url":"https://api.github.com/users/piratefsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piratefsh/subscriptions","organizations_url":"https://api.github.com/users/piratefsh/orgs","repos_url":"https://api.github.com/users/piratefsh/repos","events_url":"https://api.github.com/users/piratefsh/events{/privacy}","received_events_url":"https://api.github.com/users/piratefsh/received_events","type":"User","site_admin":false},"created_at":"2018-10-02T19:34:35Z","updated_at":"2018-10-02T19:34:35Z","author_association":"NONE","body":"Here's what I figured out so far:\r\n\r\nI was looking into how `jest-snapshot` detects obsolete snapshots, which can then be removed with `-u`. `jest-snapshot` exports a cleanup function (code [here](https://github.com/facebook/jest/blob/8eefa9690e167e9f056ec5d9532a9df465018c67/packages/jest-snapshot/src/index.js#L30)) that is run by TestScheduler (see code [here](https://github.com/facebook/jest/blob/8eefa9690e167e9f056ec5d9532a9df465018c67/packages/jest-cli/src/TestScheduler.js#L161)).\r\n\r\nTestScheduler is part of the core `jest` codebase. I am thinking of maybe opening an issue to request for custom cleanup functions to be specified so any custom test package can specify their own cleanup and have that be run by TestScheduler. \r\n\r\nAs far as I can tell, there isn't a clean way to add a cleanup function within `jest-image-snapshot` that runs after all tests are completed. Please correct me if this is not the case.\r\n\r\nHappy to hear other thoughts or approaches! @flo-sch @patrickhulce "}}
{"actor":{"display_login":"piratefsh"}}