{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/jest/pulls/comments/76544776","id":76544776,"diff_hunk":"@@ -0,0 +1,25 @@\n+const fs = require('fs');\n+const path = require('path');\n+const babel = require('babel-core');\n+\n+const rootDir = path.resolve(__dirname);\n+const options = {plugins: [rootDir + '/../index']};\n+\n+describe('babel-plugin-jest-hoist', () => {\n+\n+  // Read all test dirs\n+  fs.readdirSync(rootDir).forEach(suiteName => {\n+    const filePath = rootDir + '/' + suiteName;\n+\n+    if (fs.statSync(filePath).isDirectory()) {\n+\n+      // Run test case with fixtures\n+      it(suiteName.replace(/-/g, ' '), () => {\n+        const expected = fs.readFileSync(filePath + '/expected.js').toString();\n+        const actual = fs.readFileSync(filePath + '/actual.js').toString();","path":"packages/babel-plugin-jest-hoist/src/__tests__/babel-plugin-jest-hoist-test.js","position":19,"original_position":19,"commit_id":"0054c35e8d691c6a0328ccde0b6a4b88792bf2b5","original_commit_id":"0054c35e8d691c6a0328ccde0b6a4b88792bf2b5","user":{"login":"Daniel15","id":91933,"avatar_url":"https://avatars.githubusercontent.com/u/91933?v=3","gravatar_id":"","url":"https://api.github.com/users/Daniel15","html_url":"https://github.com/Daniel15","followers_url":"https://api.github.com/users/Daniel15/followers","following_url":"https://api.github.com/users/Daniel15/following{/other_user}","gists_url":"https://api.github.com/users/Daniel15/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniel15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniel15/subscriptions","organizations_url":"https://api.github.com/users/Daniel15/orgs","repos_url":"https://api.github.com/users/Daniel15/repos","events_url":"https://api.github.com/users/Daniel15/events{/privacy}","received_events_url":"https://api.github.com/users/Daniel15/received_events","type":"User","site_admin":false},"body":"Can this use the new snapshot feature in Jest 14 instead? It save you having to manually load/update your fixtures. This feature is documented at https://facebook.github.io/jest/blog/2016/07/27/jest-14.html - The examples use React, but it's not actually specific to React at all and can be used for any arbitrary \"expected some blob of text to equal a saved blob of text\"-type tests.","created_at":"2016-08-29T01:41:03Z","updated_at":"2016-08-29T01:41:03Z","html_url":"https://github.com/facebook/jest/pull/1487#discussion_r76544776","pull_request_url":"https://api.github.com/repos/facebook/jest/pulls/1487","_links":{"self":{"href":"https://api.github.com/repos/facebook/jest/pulls/comments/76544776"},"html":{"href":"https://github.com/facebook/jest/pull/1487#discussion_r76544776"},"pull_request":{"href":"https://api.github.com/repos/facebook/jest/pulls/1487"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/jest/pulls/1487","id":82774720,"html_url":"https://github.com/facebook/jest/pull/1487","diff_url":"https://github.com/facebook/jest/pull/1487.diff","patch_url":"https://github.com/facebook/jest/pull/1487.patch","issue_url":"https://api.github.com/repos/facebook/jest/issues/1487","number":1487,"state":"open","locked":false,"title":"Add tests for babel-plugin-jest-hoist","user":{"login":"zackargyle","id":3934294,"avatar_url":"https://avatars.githubusercontent.com/u/3934294?v=3","gravatar_id":"","url":"https://api.github.com/users/zackargyle","html_url":"https://github.com/zackargyle","followers_url":"https://api.github.com/users/zackargyle/followers","following_url":"https://api.github.com/users/zackargyle/following{/other_user}","gists_url":"https://api.github.com/users/zackargyle/gists{/gist_id}","starred_url":"https://api.github.com/users/zackargyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zackargyle/subscriptions","organizations_url":"https://api.github.com/users/zackargyle/orgs","repos_url":"https://api.github.com/users/zackargyle/repos","events_url":"https://api.github.com/users/zackargyle/events{/privacy}","received_events_url":"https://api.github.com/users/zackargyle/received_events","type":"User","site_admin":false},"body":"We were having some issues with Jest not hoisting `jest.mock` calls in our tests, so I put this together to make a fix. But it looks like it's doing what it should be doing. Either way I thought we could merge these in so we have some tests.\r\n\r\nIt's using the fixture actual/expected style that babel itself uses in it's plugin tests. :)","created_at":"2016-08-25T19:02:53Z","updated_at":"2016-08-29T01:41:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ea623e3cf2005b34852f936fd9d87b600bf0415","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/jest/pulls/1487/commits","review_comments_url":"https://api.github.com/repos/facebook/jest/pulls/1487/comments","review_comment_url":"https://api.github.com/repos/facebook/jest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/jest/issues/1487/comments","statuses_url":"https://api.github.com/repos/facebook/jest/statuses/0054c35e8d691c6a0328ccde0b6a4b88792bf2b5","head":{"label":"zackargyle:babel-plugin-tests","ref":"babel-plugin-tests","sha":"0054c35e8d691c6a0328ccde0b6a4b88792bf2b5","user":{"login":"zackargyle","id":3934294,"avatar_url":"https://avatars.githubusercontent.com/u/3934294?v=3","gravatar_id":"","url":"https://api.github.com/users/zackargyle","html_url":"https://github.com/zackargyle","followers_url":"https://api.github.com/users/zackargyle/followers","following_url":"https://api.github.com/users/zackargyle/following{/other_user}","gists_url":"https://api.github.com/users/zackargyle/gists{/gist_id}","starred_url":"https://api.github.com/users/zackargyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zackargyle/subscriptions","organizations_url":"https://api.github.com/users/zackargyle/orgs","repos_url":"https://api.github.com/users/zackargyle/repos","events_url":"https://api.github.com/users/zackargyle/events{/privacy}","received_events_url":"https://api.github.com/users/zackargyle/received_events","type":"User","site_admin":false},"repo":{"id":66576773,"name":"jest","full_name":"zackargyle/jest","owner":{"login":"zackargyle","id":3934294,"avatar_url":"https://avatars.githubusercontent.com/u/3934294?v=3","gravatar_id":"","url":"https://api.github.com/users/zackargyle","html_url":"https://github.com/zackargyle","followers_url":"https://api.github.com/users/zackargyle/followers","following_url":"https://api.github.com/users/zackargyle/following{/other_user}","gists_url":"https://api.github.com/users/zackargyle/gists{/gist_id}","starred_url":"https://api.github.com/users/zackargyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zackargyle/subscriptions","organizations_url":"https://api.github.com/users/zackargyle/orgs","repos_url":"https://api.github.com/users/zackargyle/repos","events_url":"https://api.github.com/users/zackargyle/events{/privacy}","received_events_url":"https://api.github.com/users/zackargyle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zackargyle/jest","description":"Painless JavaScript Unit Testing.","fork":true,"url":"https://api.github.com/repos/zackargyle/jest","forks_url":"https://api.github.com/repos/zackargyle/jest/forks","keys_url":"https://api.github.com/repos/zackargyle/jest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zackargyle/jest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zackargyle/jest/teams","hooks_url":"https://api.github.com/repos/zackargyle/jest/hooks","issue_events_url":"https://api.github.com/repos/zackargyle/jest/issues/events{/number}","events_url":"https://api.github.com/repos/zackargyle/jest/events","assignees_url":"https://api.github.com/repos/zackargyle/jest/assignees{/user}","branches_url":"https://api.github.com/repos/zackargyle/jest/branches{/branch}","tags_url":"https://api.github.com/repos/zackargyle/jest/tags","blobs_url":"https://api.github.com/repos/zackargyle/jest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zackargyle/jest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zackargyle/jest/git/refs{/sha}","trees_url":"https://api.github.com/repos/zackargyle/jest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zackargyle/jest/statuses/{sha}","languages_url":"https://api.github.com/repos/zackargyle/jest/languages","stargazers_url":"https://api.github.com/repos/zackargyle/jest/stargazers","contributors_url":"https://api.github.com/repos/zackargyle/jest/contributors","subscribers_url":"https://api.github.com/repos/zackargyle/jest/subscribers","subscription_url":"https://api.github.com/repos/zackargyle/jest/subscription","commits_url":"https://api.github.com/repos/zackargyle/jest/commits{/sha}","git_commits_url":"https://api.github.com/repos/zackargyle/jest/git/commits{/sha}","comments_url":"https://api.github.com/repos/zackargyle/jest/comments{/number}","issue_comment_url":"https://api.github.com/repos/zackargyle/jest/issues/comments{/number}","contents_url":"https://api.github.com/repos/zackargyle/jest/contents/{+path}","compare_url":"https://api.github.com/repos/zackargyle/jest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zackargyle/jest/merges","archive_url":"https://api.github.com/repos/zackargyle/jest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zackargyle/jest/downloads","issues_url":"https://api.github.com/repos/zackargyle/jest/issues{/number}","pulls_url":"https://api.github.com/repos/zackargyle/jest/pulls{/number}","milestones_url":"https://api.github.com/repos/zackargyle/jest/milestones{/number}","notifications_url":"https://api.github.com/repos/zackargyle/jest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zackargyle/jest/labels{/name}","releases_url":"https://api.github.com/repos/zackargyle/jest/releases{/id}","deployments_url":"https://api.github.com/repos/zackargyle/jest/deployments","created_at":"2016-08-25T16:56:11Z","updated_at":"2016-08-25T16:56:12Z","pushed_at":"2016-08-25T20:19:56Z","git_url":"git://github.com/zackargyle/jest.git","ssh_url":"git@github.com:zackargyle/jest.git","clone_url":"https://github.com/zackargyle/jest.git","svn_url":"https://github.com/zackargyle/jest","homepage":"http://facebook.github.io/jest/","size":4321,"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":"081bdd5ca6f0cd652b60e18bc7a430e17fa734d2","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":15062869,"name":"jest","full_name":"facebook/jest","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/jest","description":"Painless JavaScript Unit Testing.","fork":false,"url":"https://api.github.com/repos/facebook/jest","forks_url":"https://api.github.com/repos/facebook/jest/forks","keys_url":"https://api.github.com/repos/facebook/jest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/jest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/jest/teams","hooks_url":"https://api.github.com/repos/facebook/jest/hooks","issue_events_url":"https://api.github.com/repos/facebook/jest/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/jest/events","assignees_url":"https://api.github.com/repos/facebook/jest/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/jest/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/jest/tags","blobs_url":"https://api.github.com/repos/facebook/jest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/jest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/jest/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/jest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/jest/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/jest/languages","stargazers_url":"https://api.github.com/repos/facebook/jest/stargazers","contributors_url":"https://api.github.com/repos/facebook/jest/contributors","subscribers_url":"https://api.github.com/repos/facebook/jest/subscribers","subscription_url":"https://api.github.com/repos/facebook/jest/subscription","commits_url":"https://api.github.com/repos/facebook/jest/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/jest/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/jest/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/jest/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/jest/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/jest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/jest/merges","archive_url":"https://api.github.com/repos/facebook/jest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/jest/downloads","issues_url":"https://api.github.com/repos/facebook/jest/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/jest/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/jest/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/jest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/jest/labels{/name}","releases_url":"https://api.github.com/repos/facebook/jest/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/jest/deployments","created_at":"2013-12-10T00:18:04Z","updated_at":"2016-08-29T01:05:19Z","pushed_at":"2016-08-28T17:44:34Z","git_url":"git://github.com/facebook/jest.git","ssh_url":"git@github.com:facebook/jest.git","clone_url":"https://github.com/facebook/jest.git","svn_url":"https://github.com/facebook/jest","homepage":"http://facebook.github.io/jest/","size":6314,"stargazers_count":4571,"watchers_count":4571,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":595,"mirror_url":null,"open_issues_count":71,"forks":595,"open_issues":71,"watchers":4571,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/jest/pulls/1487"},"html":{"href":"https://github.com/facebook/jest/pull/1487"},"issue":{"href":"https://api.github.com/repos/facebook/jest/issues/1487"},"comments":{"href":"https://api.github.com/repos/facebook/jest/issues/1487/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/jest/pulls/1487/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/jest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/jest/pulls/1487/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/jest/statuses/0054c35e8d691c6a0328ccde0b6a4b88792bf2b5"}}}}
{"actor":{"display_login":"Daniel15"}}