{"action":"opened","issue":{"url":"https://api.github.com/repos/facebook/jest/issues/5754","repository_url":"https://api.github.com/repos/facebook/jest","labels_url":"https://api.github.com/repos/facebook/jest/issues/5754/labels{/name}","comments_url":"https://api.github.com/repos/facebook/jest/issues/5754/comments","events_url":"https://api.github.com/repos/facebook/jest/issues/5754/events","html_url":"https://github.com/facebook/jest/issues/5754","id":303408252,"number":5754,"title":"test called beforeAll is finished ","user":{"login":"raacker","id":12020398,"avatar_url":"https://avatars0.githubusercontent.com/u/12020398?v=4","gravatar_id":"","url":"https://api.github.com/users/raacker","html_url":"https://github.com/raacker","followers_url":"https://api.github.com/users/raacker/followers","following_url":"https://api.github.com/users/raacker/following{/other_user}","gists_url":"https://api.github.com/users/raacker/gists{/gist_id}","starred_url":"https://api.github.com/users/raacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raacker/subscriptions","organizations_url":"https://api.github.com/users/raacker/orgs","repos_url":"https://api.github.com/users/raacker/repos","events_url":"https://api.github.com/users/raacker/events{/privacy}","received_events_url":"https://api.github.com/users/raacker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-08T09:18:17Z","updated_at":"2018-03-08T09:18:17Z","closed_at":null,"author_association":"NONE","body":"<!-- \r\nTHIS IS NOT A HELP FORUM. \r\nIf you are experiencing problems with setting up Jest, please make sure to visit our Help page: \r\nhttps://facebook.github.io/jest/help.html\r\n-->\r\n\r\n<!-- \r\nBefore creating an issue please check the following:\r\n* you are using the latest version of Jest\r\n* try re-installing your node_modules folder \r\n* run Jest once with `--no-cache` to see if that fixes the problem you are experiencing. \r\n-->\r\n\r\n**Do you want to request a _feature_ or report a _bug_?**\r\n_bug_\r\n\r\n**What is the current behavior?**\r\ntest is called before 'beforeAll' is finished\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce and\r\neither a repl.it demo through https://repl.it/languages/jest or a minimal\r\nrepository on GitHub that we can `yarn install` and `yarn test`.**\r\n\r\n**What is the expected behavior?**\r\ntest shouldn't called before 'beforeAll' is called\r\n\r\n**Please provide your exact Jest configuration and mention your Jest, node,\r\nyarn/npm version and operating system.**\r\nAll latest version\r\njest: 21.2.1\r\nnode: 8.10.0\r\n\r\nI'm writing some unit test for async functions which return Promise. \r\n\r\nSo I have setup function to create fake data for database and 4 test cases. And beforeAll is calling setup function.\r\n\r\nwell I already read #4097 and tried bunch of things but it still run first test before 'beforeAll' is finished.\r\n\r\n```\r\nfunction initDB() {\r\n    // call some Model.create();\r\n}\r\n```\r\n\r\n```\r\nbeforeAll(() => initDB());\r\n\r\ntest('test1', () => {\r\n    // promise return call\r\n});\r\n\r\ntest('test2', () => {\r\n    // promise return call\r\n});\r\n\r\ntest('test3', () => {\r\n    // promise return call\r\n});\r\n\r\ntest('test4', () => {\r\n    // promise return call\r\n});\r\n```\r\n\r\nBut output is always\r\n\r\ntest1\r\ninit\r\ntest2\r\ntest3\r\ntest4\r\n\r\nCould you give any inspection about this?\r\n\r\n"}}
{"actor":{"display_login":"raacker"}}