{"action":"closed","number":6865,"pull_request":{"url":"https://api.github.com/repos/facebook/jest/pulls/6865","id":209380546,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MzgwNTQ2","html_url":"https://github.com/facebook/jest/pull/6865","diff_url":"https://github.com/facebook/jest/pull/6865.diff","patch_url":"https://github.com/facebook/jest/pull/6865.patch","issue_url":"https://api.github.com/repos/facebook/jest/issues/6865","number":6865,"state":"closed","locked":false,"title":"Add support for globalSetup and globalTeardown in projects","user":{"login":"ranyitz","id":11733036,"node_id":"MDQ6VXNlcjExNzMzMDM2","avatar_url":"https://avatars2.githubusercontent.com/u/11733036?v=4","gravatar_id":"","url":"https://api.github.com/users/ranyitz","html_url":"https://github.com/ranyitz","followers_url":"https://api.github.com/users/ranyitz/followers","following_url":"https://api.github.com/users/ranyitz/following{/other_user}","gists_url":"https://api.github.com/users/ranyitz/gists{/gist_id}","starred_url":"https://api.github.com/users/ranyitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ranyitz/subscriptions","organizations_url":"https://api.github.com/users/ranyitz/orgs","repos_url":"https://api.github.com/users/ranyitz/repos","events_url":"https://api.github.com/users/ranyitz/events{/privacy}","received_events_url":"https://api.github.com/users/ranyitz/received_events","type":"User","site_admin":false},"body":"## Summary\r\nThis PR solves #5441 and adds support for `globalSetup` and `globalTeardown` functions in projects.\r\n\r\n## Motivation\r\nThere are multiple usaged for `projects`. Some use them for multiple packages in a monorepo and some for running multiple environments/runners.\r\n\r\nToday, `globalSetup`/`globalTeadown` are working only in `globalConfig`.\r\n\r\nIn most cases it would be nice if Jest would know how to run only the relevant setup for the specific tests that we choose to run.\r\n\r\nFor example, bootstrap puppeteer only if we are in the `e2e` project, or if we choose to run an e2e file at the moment (which needs setup). It would be also nice to not bootstrap puppeteer if we only run component tests.\r\n\r\n![global-setup-teardown-projects](https://user-images.githubusercontent.com/11733036/44313290-9fa9c180-a40e-11e8-9478-b26679f6bc55.gif)","created_at":"2018-08-19T21:23:42Z","updated_at":"2018-12-25T14:45:29Z","closed_at":"2018-12-25T14:45:29Z","merged_at":"2018-12-25T14:45:28Z","merge_commit_sha":"698c33c26272742b05d88c2b9169a13acc4121a1","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rickhanlonii","id":2440089,"node_id":"MDQ6VXNlcjI0NDAwODk=","avatar_url":"https://avatars0.githubusercontent.com/u/2440089?v=4","gravatar_id":"","url":"https://api.github.com/users/rickhanlonii","html_url":"https://github.com/rickhanlonii","followers_url":"https://api.github.com/users/rickhanlonii/followers","following_url":"https://api.github.com/users/rickhanlonii/following{/other_user}","gists_url":"https://api.github.com/users/rickhanlonii/gists{/gist_id}","starred_url":"https://api.github.com/users/rickhanlonii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickhanlonii/subscriptions","organizations_url":"https://api.github.com/users/rickhanlonii/orgs","repos_url":"https://api.github.com/users/rickhanlonii/repos","events_url":"https://api.github.com/users/rickhanlonii/events{/privacy}","received_events_url":"https://api.github.com/users/rickhanlonii/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":847426897,"node_id":"MDU6TGFiZWw4NDc0MjY4OTc=","url":"https://api.github.com/repos/facebook/jest/labels/cla%20signed","name":"cla signed","color":"ededed","default":false}],"milestone":{"url":"https://api.github.com/repos/facebook/jest/milestones/8","html_url":"https://github.com/facebook/jest/milestone/8","labels_url":"https://api.github.com/repos/facebook/jest/milestones/8/labels","id":3744383,"node_id":"MDk6TWlsZXN0b25lMzc0NDM4Mw==","number":8,"title":"Jest 24","description":"","creator":{"login":"SimenB","id":1404810,"node_id":"MDQ6VXNlcjE0MDQ4MTA=","avatar_url":"https://avatars1.githubusercontent.com/u/1404810?v=4","gravatar_id":"","url":"https://api.github.com/users/SimenB","html_url":"https://github.com/SimenB","followers_url":"https://api.github.com/users/SimenB/followers","following_url":"https://api.github.com/users/SimenB/following{/other_user}","gists_url":"https://api.github.com/users/SimenB/gists{/gist_id}","starred_url":"https://api.github.com/users/SimenB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimenB/subscriptions","organizations_url":"https://api.github.com/users/SimenB/orgs","repos_url":"https://api.github.com/users/SimenB/repos","events_url":"https://api.github.com/users/SimenB/events{/privacy}","received_events_url":"https://api.github.com/users/SimenB/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":15,"state":"open","created_at":"2018-10-16T21:31:36Z","updated_at":"2018-12-25T14:45:29Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/facebook/jest/pulls/6865/commits","review_comments_url":"https://api.github.com/repos/facebook/jest/pulls/6865/comments","review_comment_url":"https://api.github.com/repos/facebook/jest/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/jest/issues/6865/comments","statuses_url":"https://api.github.com/repos/facebook/jest/statuses/7c281f66274a2ca4a36e624d907a9fac771aa291","head":{"label":"ranyitz:global-setup-and-teardown-for-projects","ref":"global-setup-and-teardown-for-projects","sha":"7c281f66274a2ca4a36e624d907a9fac771aa291","user":{"login":"ranyitz","id":11733036,"node_id":"MDQ6VXNlcjExNzMzMDM2","avatar_url":"https://avatars2.githubusercontent.com/u/11733036?v=4","gravatar_id":"","url":"https://api.github.com/users/ranyitz","html_url":"https://github.com/ranyitz","followers_url":"https://api.github.com/users/ranyitz/followers","following_url":"https://api.github.com/users/ranyitz/following{/other_user}","gists_url":"https://api.github.com/users/ranyitz/gists{/gist_id}","starred_url":"https://api.github.com/users/ranyitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ranyitz/subscriptions","organizations_url":"https://api.github.com/users/ranyitz/orgs","repos_url":"https://api.github.com/users/ranyitz/repos","events_url":"https://api.github.com/users/ranyitz/events{/privacy}","received_events_url":"https://api.github.com/users/ranyitz/received_events","type":"User","site_admin":false},"repo":{"id":120682327,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA2ODIzMjc=","name":"jest","full_name":"ranyitz/jest","private":false,"owner":{"login":"ranyitz","id":11733036,"node_id":"MDQ6VXNlcjExNzMzMDM2","avatar_url":"https://avatars2.githubusercontent.com/u/11733036?v=4","gravatar_id":"","url":"https://api.github.com/users/ranyitz","html_url":"https://github.com/ranyitz","followers_url":"https://api.github.com/users/ranyitz/followers","following_url":"https://api.github.com/users/ranyitz/following{/other_user}","gists_url":"https://api.github.com/users/ranyitz/gists{/gist_id}","starred_url":"https://api.github.com/users/ranyitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ranyitz/subscriptions","organizations_url":"https://api.github.com/users/ranyitz/orgs","repos_url":"https://api.github.com/users/ranyitz/repos","events_url":"https://api.github.com/users/ranyitz/events{/privacy}","received_events_url":"https://api.github.com/users/ranyitz/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ranyitz/jest","description":"🃏 Delightful JavaScript Testing.","fork":true,"url":"https://api.github.com/repos/ranyitz/jest","forks_url":"https://api.github.com/repos/ranyitz/jest/forks","keys_url":"https://api.github.com/repos/ranyitz/jest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ranyitz/jest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ranyitz/jest/teams","hooks_url":"https://api.github.com/repos/ranyitz/jest/hooks","issue_events_url":"https://api.github.com/repos/ranyitz/jest/issues/events{/number}","events_url":"https://api.github.com/repos/ranyitz/jest/events","assignees_url":"https://api.github.com/repos/ranyitz/jest/assignees{/user}","branches_url":"https://api.github.com/repos/ranyitz/jest/branches{/branch}","tags_url":"https://api.github.com/repos/ranyitz/jest/tags","blobs_url":"https://api.github.com/repos/ranyitz/jest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ranyitz/jest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ranyitz/jest/git/refs{/sha}","trees_url":"https://api.github.com/repos/ranyitz/jest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ranyitz/jest/statuses/{sha}","languages_url":"https://api.github.com/repos/ranyitz/jest/languages","stargazers_url":"https://api.github.com/repos/ranyitz/jest/stargazers","contributors_url":"https://api.github.com/repos/ranyitz/jest/contributors","subscribers_url":"https://api.github.com/repos/ranyitz/jest/subscribers","subscription_url":"https://api.github.com/repos/ranyitz/jest/subscription","commits_url":"https://api.github.com/repos/ranyitz/jest/commits{/sha}","git_commits_url":"https://api.github.com/repos/ranyitz/jest/git/commits{/sha}","comments_url":"https://api.github.com/repos/ranyitz/jest/comments{/number}","issue_comment_url":"https://api.github.com/repos/ranyitz/jest/issues/comments{/number}","contents_url":"https://api.github.com/repos/ranyitz/jest/contents/{+path}","compare_url":"https://api.github.com/repos/ranyitz/jest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ranyitz/jest/merges","archive_url":"https://api.github.com/repos/ranyitz/jest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ranyitz/jest/downloads","issues_url":"https://api.github.com/repos/ranyitz/jest/issues{/number}","pulls_url":"https://api.github.com/repos/ranyitz/jest/pulls{/number}","milestones_url":"https://api.github.com/repos/ranyitz/jest/milestones{/number}","notifications_url":"https://api.github.com/repos/ranyitz/jest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ranyitz/jest/labels{/name}","releases_url":"https://api.github.com/repos/ranyitz/jest/releases{/id}","deployments_url":"https://api.github.com/repos/ranyitz/jest/deployments","created_at":"2018-02-07T22:55:48Z","updated_at":"2018-12-18T17:00:59Z","pushed_at":"2018-12-25T14:36:09Z","git_url":"git://github.com/ranyitz/jest.git","ssh_url":"git@github.com:ranyitz/jest.git","clone_url":"https://github.com/ranyitz/jest.git","svn_url":"https://github.com/ranyitz/jest","homepage":"https://facebook.github.io/jest/","size":79937,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"230e593c07689ecc401868c588c05506b1c2a212","user":{"login":"facebook","id":69631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5NjMx","avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA2Mjg2OQ==","name":"jest","full_name":"facebook/jest","private":false,"owner":{"login":"facebook","id":69631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5NjMx","avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","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},"html_url":"https://github.com/facebook/jest","description":"Delightful JavaScript 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":"2018-12-25T14:42:22Z","pushed_at":"2018-12-25T14:45:28Z","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":"https://jestjs.io","size":131723,"stargazers_count":22424,"watchers_count":22424,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3000,"mirror_url":null,"archived":false,"open_issues_count":534,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3000,"open_issues":534,"watchers":22424,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/jest/pulls/6865"},"html":{"href":"https://github.com/facebook/jest/pull/6865"},"issue":{"href":"https://api.github.com/repos/facebook/jest/issues/6865"},"comments":{"href":"https://api.github.com/repos/facebook/jest/issues/6865/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/jest/pulls/6865/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/jest/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/jest/pulls/6865/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/jest/statuses/7c281f66274a2ca4a36e624d907a9fac771aa291"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"SimenB","id":1404810,"node_id":"MDQ6VXNlcjE0MDQ4MTA=","avatar_url":"https://avatars1.githubusercontent.com/u/1404810?v=4","gravatar_id":"","url":"https://api.github.com/users/SimenB","html_url":"https://github.com/SimenB","followers_url":"https://api.github.com/users/SimenB/followers","following_url":"https://api.github.com/users/SimenB/following{/other_user}","gists_url":"https://api.github.com/users/SimenB/gists{/gist_id}","starred_url":"https://api.github.com/users/SimenB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimenB/subscriptions","organizations_url":"https://api.github.com/users/SimenB/orgs","repos_url":"https://api.github.com/users/SimenB/repos","events_url":"https://api.github.com/users/SimenB/events{/privacy}","received_events_url":"https://api.github.com/users/SimenB/received_events","type":"User","site_admin":false},"comments":11,"review_comments":13,"maintainer_can_modify":false,"commits":15,"additions":386,"deletions":29,"changed_files":21}}
{"actor":{"display_login":"SimenB"}}