{"action":"opened","number":19,"pull_request":{"url":"https://api.github.com/repos/wheresrhys/fetch-mock/pulls/19","id":44782394,"html_url":"https://github.com/wheresrhys/fetch-mock/pull/19","diff_url":"https://github.com/wheresrhys/fetch-mock/pull/19.diff","patch_url":"https://github.com/wheresrhys/fetch-mock/pull/19.patch","issue_url":"https://api.github.com/repos/wheresrhys/fetch-mock/issues/19","number":19,"state":"open","locked":false,"title":"Allow repeated calls to reset and restore","user":{"login":"Lrnk","id":4622378,"avatar_url":"https://avatars.githubusercontent.com/u/4622378?v=3","gravatar_id":"","url":"https://api.github.com/users/Lrnk","html_url":"https://github.com/Lrnk","followers_url":"https://api.github.com/users/Lrnk/followers","following_url":"https://api.github.com/users/Lrnk/following{/other_user}","gists_url":"https://api.github.com/users/Lrnk/gists{/gist_id}","starred_url":"https://api.github.com/users/Lrnk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lrnk/subscriptions","organizations_url":"https://api.github.com/users/Lrnk/orgs","repos_url":"https://api.github.com/users/Lrnk/repos","events_url":"https://api.github.com/users/Lrnk/events{/privacy}","received_events_url":"https://api.github.com/users/Lrnk/received_events","type":"User","site_admin":false},"body":"Hi Rhys, I've done this hacky little fix to allow restore and reset to fail silently when they're not valid to call (called multiple times between new mocking behaviour specified?). I don't fully understand how it works, so you might be able to see a more elegant way to make this work.\r\n\r\nDoing this allows me to put fetchMock.restore in the afterEach function instead of in the then and catch blocks of each test.","created_at":"2015-09-11T13:31:58Z","updated_at":"2015-09-11T13:31:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wheresrhys/fetch-mock/pulls/19/commits","review_comments_url":"https://api.github.com/repos/wheresrhys/fetch-mock/pulls/19/comments","review_comment_url":"https://api.github.com/repos/wheresrhys/fetch-mock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wheresrhys/fetch-mock/issues/19/comments","statuses_url":"https://api.github.com/repos/wheresrhys/fetch-mock/statuses/58fb8c3753d60714019ce82237faf4b74f56c3fc","head":{"label":"Lrnk:master","ref":"master","sha":"58fb8c3753d60714019ce82237faf4b74f56c3fc","user":{"login":"Lrnk","id":4622378,"avatar_url":"https://avatars.githubusercontent.com/u/4622378?v=3","gravatar_id":"","url":"https://api.github.com/users/Lrnk","html_url":"https://github.com/Lrnk","followers_url":"https://api.github.com/users/Lrnk/followers","following_url":"https://api.github.com/users/Lrnk/following{/other_user}","gists_url":"https://api.github.com/users/Lrnk/gists{/gist_id}","starred_url":"https://api.github.com/users/Lrnk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lrnk/subscriptions","organizations_url":"https://api.github.com/users/Lrnk/orgs","repos_url":"https://api.github.com/users/Lrnk/repos","events_url":"https://api.github.com/users/Lrnk/events{/privacy}","received_events_url":"https://api.github.com/users/Lrnk/received_events","type":"User","site_admin":false},"repo":{"id":42309481,"name":"fetch-mock","full_name":"Lrnk/fetch-mock","owner":{"login":"Lrnk","id":4622378,"avatar_url":"https://avatars.githubusercontent.com/u/4622378?v=3","gravatar_id":"","url":"https://api.github.com/users/Lrnk","html_url":"https://github.com/Lrnk","followers_url":"https://api.github.com/users/Lrnk/followers","following_url":"https://api.github.com/users/Lrnk/following{/other_user}","gists_url":"https://api.github.com/users/Lrnk/gists{/gist_id}","starred_url":"https://api.github.com/users/Lrnk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lrnk/subscriptions","organizations_url":"https://api.github.com/users/Lrnk/orgs","repos_url":"https://api.github.com/users/Lrnk/repos","events_url":"https://api.github.com/users/Lrnk/events{/privacy}","received_events_url":"https://api.github.com/users/Lrnk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Lrnk/fetch-mock","description":"Mock http requests made using fetch (or isomorphic-fetch)","fork":true,"url":"https://api.github.com/repos/Lrnk/fetch-mock","forks_url":"https://api.github.com/repos/Lrnk/fetch-mock/forks","keys_url":"https://api.github.com/repos/Lrnk/fetch-mock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lrnk/fetch-mock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lrnk/fetch-mock/teams","hooks_url":"https://api.github.com/repos/Lrnk/fetch-mock/hooks","issue_events_url":"https://api.github.com/repos/Lrnk/fetch-mock/issues/events{/number}","events_url":"https://api.github.com/repos/Lrnk/fetch-mock/events","assignees_url":"https://api.github.com/repos/Lrnk/fetch-mock/assignees{/user}","branches_url":"https://api.github.com/repos/Lrnk/fetch-mock/branches{/branch}","tags_url":"https://api.github.com/repos/Lrnk/fetch-mock/tags","blobs_url":"https://api.github.com/repos/Lrnk/fetch-mock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lrnk/fetch-mock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lrnk/fetch-mock/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lrnk/fetch-mock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lrnk/fetch-mock/statuses/{sha}","languages_url":"https://api.github.com/repos/Lrnk/fetch-mock/languages","stargazers_url":"https://api.github.com/repos/Lrnk/fetch-mock/stargazers","contributors_url":"https://api.github.com/repos/Lrnk/fetch-mock/contributors","subscribers_url":"https://api.github.com/repos/Lrnk/fetch-mock/subscribers","subscription_url":"https://api.github.com/repos/Lrnk/fetch-mock/subscription","commits_url":"https://api.github.com/repos/Lrnk/fetch-mock/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lrnk/fetch-mock/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lrnk/fetch-mock/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lrnk/fetch-mock/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lrnk/fetch-mock/contents/{+path}","compare_url":"https://api.github.com/repos/Lrnk/fetch-mock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lrnk/fetch-mock/merges","archive_url":"https://api.github.com/repos/Lrnk/fetch-mock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lrnk/fetch-mock/downloads","issues_url":"https://api.github.com/repos/Lrnk/fetch-mock/issues{/number}","pulls_url":"https://api.github.com/repos/Lrnk/fetch-mock/pulls{/number}","milestones_url":"https://api.github.com/repos/Lrnk/fetch-mock/milestones{/number}","notifications_url":"https://api.github.com/repos/Lrnk/fetch-mock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lrnk/fetch-mock/labels{/name}","releases_url":"https://api.github.com/repos/Lrnk/fetch-mock/releases{/id}","created_at":"2015-09-11T13:15:47Z","updated_at":"2015-09-11T13:15:47Z","pushed_at":"2015-09-11T13:30:19Z","git_url":"git://github.com/Lrnk/fetch-mock.git","ssh_url":"git@github.com:Lrnk/fetch-mock.git","clone_url":"https://github.com/Lrnk/fetch-mock.git","svn_url":"https://github.com/Lrnk/fetch-mock","homepage":"https://www.npmjs.com/package/fetch-mock","size":395,"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":"wheresrhys:master","ref":"master","sha":"ce0d254188d3f37c307d3d519f01374485f9274d","user":{"login":"wheresrhys","id":447559,"avatar_url":"https://avatars.githubusercontent.com/u/447559?v=3","gravatar_id":"","url":"https://api.github.com/users/wheresrhys","html_url":"https://github.com/wheresrhys","followers_url":"https://api.github.com/users/wheresrhys/followers","following_url":"https://api.github.com/users/wheresrhys/following{/other_user}","gists_url":"https://api.github.com/users/wheresrhys/gists{/gist_id}","starred_url":"https://api.github.com/users/wheresrhys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wheresrhys/subscriptions","organizations_url":"https://api.github.com/users/wheresrhys/orgs","repos_url":"https://api.github.com/users/wheresrhys/repos","events_url":"https://api.github.com/users/wheresrhys/events{/privacy}","received_events_url":"https://api.github.com/users/wheresrhys/received_events","type":"User","site_admin":false},"repo":{"id":34877706,"name":"fetch-mock","full_name":"wheresrhys/fetch-mock","owner":{"login":"wheresrhys","id":447559,"avatar_url":"https://avatars.githubusercontent.com/u/447559?v=3","gravatar_id":"","url":"https://api.github.com/users/wheresrhys","html_url":"https://github.com/wheresrhys","followers_url":"https://api.github.com/users/wheresrhys/followers","following_url":"https://api.github.com/users/wheresrhys/following{/other_user}","gists_url":"https://api.github.com/users/wheresrhys/gists{/gist_id}","starred_url":"https://api.github.com/users/wheresrhys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wheresrhys/subscriptions","organizations_url":"https://api.github.com/users/wheresrhys/orgs","repos_url":"https://api.github.com/users/wheresrhys/repos","events_url":"https://api.github.com/users/wheresrhys/events{/privacy}","received_events_url":"https://api.github.com/users/wheresrhys/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wheresrhys/fetch-mock","description":"Mock http requests made using fetch (or isomorphic-fetch)","fork":false,"url":"https://api.github.com/repos/wheresrhys/fetch-mock","forks_url":"https://api.github.com/repos/wheresrhys/fetch-mock/forks","keys_url":"https://api.github.com/repos/wheresrhys/fetch-mock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wheresrhys/fetch-mock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wheresrhys/fetch-mock/teams","hooks_url":"https://api.github.com/repos/wheresrhys/fetch-mock/hooks","issue_events_url":"https://api.github.com/repos/wheresrhys/fetch-mock/issues/events{/number}","events_url":"https://api.github.com/repos/wheresrhys/fetch-mock/events","assignees_url":"https://api.github.com/repos/wheresrhys/fetch-mock/assignees{/user}","branches_url":"https://api.github.com/repos/wheresrhys/fetch-mock/branches{/branch}","tags_url":"https://api.github.com/repos/wheresrhys/fetch-mock/tags","blobs_url":"https://api.github.com/repos/wheresrhys/fetch-mock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wheresrhys/fetch-mock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wheresrhys/fetch-mock/git/refs{/sha}","trees_url":"https://api.github.com/repos/wheresrhys/fetch-mock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wheresrhys/fetch-mock/statuses/{sha}","languages_url":"https://api.github.com/repos/wheresrhys/fetch-mock/languages","stargazers_url":"https://api.github.com/repos/wheresrhys/fetch-mock/stargazers","contributors_url":"https://api.github.com/repos/wheresrhys/fetch-mock/contributors","subscribers_url":"https://api.github.com/repos/wheresrhys/fetch-mock/subscribers","subscription_url":"https://api.github.com/repos/wheresrhys/fetch-mock/subscription","commits_url":"https://api.github.com/repos/wheresrhys/fetch-mock/commits{/sha}","git_commits_url":"https://api.github.com/repos/wheresrhys/fetch-mock/git/commits{/sha}","comments_url":"https://api.github.com/repos/wheresrhys/fetch-mock/comments{/number}","issue_comment_url":"https://api.github.com/repos/wheresrhys/fetch-mock/issues/comments{/number}","contents_url":"https://api.github.com/repos/wheresrhys/fetch-mock/contents/{+path}","compare_url":"https://api.github.com/repos/wheresrhys/fetch-mock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wheresrhys/fetch-mock/merges","archive_url":"https://api.github.com/repos/wheresrhys/fetch-mock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wheresrhys/fetch-mock/downloads","issues_url":"https://api.github.com/repos/wheresrhys/fetch-mock/issues{/number}","pulls_url":"https://api.github.com/repos/wheresrhys/fetch-mock/pulls{/number}","milestones_url":"https://api.github.com/repos/wheresrhys/fetch-mock/milestones{/number}","notifications_url":"https://api.github.com/repos/wheresrhys/fetch-mock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wheresrhys/fetch-mock/labels{/name}","releases_url":"https://api.github.com/repos/wheresrhys/fetch-mock/releases{/id}","created_at":"2015-04-30T21:27:58Z","updated_at":"2015-09-08T18:30:07Z","pushed_at":"2015-06-24T10:19:40Z","git_url":"git://github.com/wheresrhys/fetch-mock.git","ssh_url":"git@github.com:wheresrhys/fetch-mock.git","clone_url":"https://github.com/wheresrhys/fetch-mock.git","svn_url":"https://github.com/wheresrhys/fetch-mock","homepage":"https://www.npmjs.com/package/fetch-mock","size":395,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":7,"forks":4,"open_issues":7,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wheresrhys/fetch-mock/pulls/19"},"html":{"href":"https://github.com/wheresrhys/fetch-mock/pull/19"},"issue":{"href":"https://api.github.com/repos/wheresrhys/fetch-mock/issues/19"},"comments":{"href":"https://api.github.com/repos/wheresrhys/fetch-mock/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/wheresrhys/fetch-mock/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/wheresrhys/fetch-mock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wheresrhys/fetch-mock/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/wheresrhys/fetch-mock/statuses/58fb8c3753d60714019ce82237faf4b74f56c3fc"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":6,"deletions":2,"changed_files":1}}