{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/20178","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/20178/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/20178/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/20178/events","html_url":"https://github.com/facebook/react-native/pull/20178","id":340794342,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxMTIyNzY3","number":20178,"title":"[ GENERAL ][ BUGFIX ][ jest/preprocessor.js ] - Invalid use of destructuring","user":{"login":"umairda","id":19181092,"node_id":"MDQ6VXNlcjE5MTgxMDky","avatar_url":"https://avatars2.githubusercontent.com/u/19181092?v=4","gravatar_id":"","url":"https://api.github.com/users/umairda","html_url":"https://github.com/umairda","followers_url":"https://api.github.com/users/umairda/followers","following_url":"https://api.github.com/users/umairda/following{/other_user}","gists_url":"https://api.github.com/users/umairda/gists{/gist_id}","starred_url":"https://api.github.com/users/umairda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umairda/subscriptions","organizations_url":"https://api.github.com/users/umairda/orgs","repos_url":"https://api.github.com/users/umairda/repos","events_url":"https://api.github.com/users/umairda/events{/privacy}","received_events_url":"https://api.github.com/users/umairda/received_events","type":"User","site_admin":false},"labels":[{"id":869759799,"node_id":"MDU6TGFiZWw4Njk3NTk3OTk=","url":"https://api.github.com/repos/facebook/react-native/labels/:white_check_mark:Release%20Notes","name":":white_check_mark:Release Notes","color":"0e8a16","default":false},{"id":934239421,"node_id":"MDU6TGFiZWw5MzQyMzk0MjE=","url":"https://api.github.com/repos/facebook/react-native/labels/:white_check_mark:Test%20Plan","name":":white_check_mark:Test Plan","color":"0e8a16","default":false},{"id":196858975,"node_id":"MDU6TGFiZWwxOTY4NTg5NzU=","url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"ffffff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-12T20:53:36Z","updated_at":"2018-07-13T22:00:58Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/20178","html_url":"https://github.com/facebook/react-native/pull/20178","diff_url":"https://github.com/facebook/react-native/pull/20178.diff","patch_url":"https://github.com/facebook/react-native/pull/20178.patch"},"body":"Test Plan:\r\n----------\r\nI had the same issues running tests as mentioned in: https://github.com/facebook/react-native/issues/19859\r\n\r\nI followed the suggestions but ran into another error:\r\n```\r\n  ● Test suite failed to run\r\n\r\n    /Users/umair/projects/my-project/node_modules/react-native/jest/preprocessor.js:49\r\n              {sourceType: 'script', ...nodeOptions, ast: false},\r\n                                     ^^^\r\n\r\n    SyntaxError: Unexpected token ...\r\n```\r\n\r\nThe `preprocessor.js` code in question is:\r\n```\r\n      // node specific transforms only\r\n      return babelTransformSync(\r\n        src,\r\n        Object.assign(\r\n          {filename: file},\r\n          {sourceType: 'script', ...nodeOptions, ast: false},\r\n        ),\r\n      ).code;\r\n```\r\n\r\nSpecifically line 46: `{sourceType: 'script', ...nodeOptions, ast: false},` is an invalid use of object destructuring and since this object is part of an `Object.assign` statement I simply broke the constituents up into arguments as follows:\r\n```\r\n        Object.assign(\r\n          {filename: file},\r\n          {sourceType: 'script'},\r\n          nodeOptions, \r\n          {ast: false}\r\n        ),\r\n```\r\n\r\nRelease Notes:\r\n--------------\r\n[GENERAL][BUGFIX][jest/preprocessor.js] - fixes invalid use of object destructuring in preprocessor.js\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/404964939","html_url":"https://github.com/facebook/react-native/pull/20178#issuecomment-404964939","issue_url":"https://api.github.com/repos/facebook/react-native/issues/20178","id":404964939,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDk2NDkzOQ==","user":{"login":"umairda","id":19181092,"node_id":"MDQ6VXNlcjE5MTgxMDky","avatar_url":"https://avatars2.githubusercontent.com/u/19181092?v=4","gravatar_id":"","url":"https://api.github.com/users/umairda","html_url":"https://github.com/umairda","followers_url":"https://api.github.com/users/umairda/followers","following_url":"https://api.github.com/users/umairda/following{/other_user}","gists_url":"https://api.github.com/users/umairda/gists{/gist_id}","starred_url":"https://api.github.com/users/umairda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umairda/subscriptions","organizations_url":"https://api.github.com/users/umairda/orgs","repos_url":"https://api.github.com/users/umairda/repos","events_url":"https://api.github.com/users/umairda/events{/privacy}","received_events_url":"https://api.github.com/users/umairda/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T22:00:58Z","updated_at":"2018-07-13T22:00:58Z","author_association":"NONE","body":"You are right. I updated to node v8.3.0 and it works.\r\n\r\nI went ahead and updated the pr so that portion of the code uses destructuring only and got rid of the Object.assign. \r\n\r\nI re-ran all my tests and they work fine whereas before they were complaining about the use of the spread operator. "}}
{"actor":{"display_login":"umairda"}}