{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/19120","repository_url":"https://api.github.com/repos/facebook/react-native","labels_url":"https://api.github.com/repos/facebook/react-native/issues/19120/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/19120/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/19120/events","html_url":"https://github.com/facebook/react-native/issues/19120","id":320097506,"node_id":"MDU6SXNzdWUzMjAwOTc1MDY=","number":19120,"title":"The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables.","user":{"login":"sirjmkitavi","id":17447937,"node_id":"MDQ6VXNlcjE3NDQ3OTM3","avatar_url":"https://avatars2.githubusercontent.com/u/17447937?v=4","gravatar_id":"","url":"https://api.github.com/users/sirjmkitavi","html_url":"https://github.com/sirjmkitavi","followers_url":"https://api.github.com/users/sirjmkitavi/followers","following_url":"https://api.github.com/users/sirjmkitavi/following{/other_user}","gists_url":"https://api.github.com/users/sirjmkitavi/gists{/gist_id}","starred_url":"https://api.github.com/users/sirjmkitavi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirjmkitavi/subscriptions","organizations_url":"https://api.github.com/users/sirjmkitavi/orgs","repos_url":"https://api.github.com/users/sirjmkitavi/repos","events_url":"https://api.github.com/users/sirjmkitavi/events{/privacy}","received_events_url":"https://api.github.com/users/sirjmkitavi/received_events","type":"User","site_admin":false},"labels":[{"id":257498156,"node_id":"MDU6TGFiZWwyNTc0OTgxNTY=","url":"https://api.github.com/repos/facebook/react-native/labels/:large_blue_diamond:JavaScript","name":":large_blue_diamond:JavaScript","color":"bfd4f2","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":23,"created_at":"2018-05-03T22:10:15Z","updated_at":"2018-06-20T18:05:18Z","closed_at":"2018-06-20T18:05:18Z","author_association":"NONE","body":"<!--\r\n  We use GitHub Issues exclusively for tracking bugs in React Native.\r\n  Questions? Visit http://facebook.github.io/react-native/help.html\r\n  If this issue is about documentation or the website, please file it at:\r\n  https://github.com/facebook/react-native-website/issues/new\r\n-->\r\n\r\n- [x] I have reviewed the [documentation](https://facebook.github.io/react-native)\r\n- [x] I have searched [existing issues](https://github.com/facebook/react-native/issues)\r\n- [x] I am using the [latest React Native version](https://github.com/facebook/react-native/releases)\r\n\r\n<!-- Describe your issue in detail. -->\r\n\r\n## Environment\r\n<!-- Required. Run `react-native info` in your terminal and paste its contents here. -->\r\nMy Environment is as below.\r\n```\r\nScanning folders for symlinks in /Users/sirjmkitavi/Andela/playground/react-native/ball-animation/node_modules (25ms)\r\n\r\nEnvironment:\r\n  OS: macOS High Sierra 10.13.2\r\n  Node: 10.0.0\r\n  Yarn: 1.6.0\r\n  npm: 5.6.0\r\n  Watchman: 4.9.0\r\n  Xcode: Xcode 9.2 Build version 9C40b\r\n  Android Studio: Not Found\r\n\r\nPackages: (wanted => installed)\r\n  react: ^16.3.2 => 16.3.2\r\n  react-native: ^0.55.3 => 0.55.3\r\n```\r\n\r\n\r\n## Steps to Reproduce\r\n<!-- \r\n  Required. Let us know how to reproduce the issue. Include a code sample, share a project, \r\n  or share an app that reproduces the issue using [Snack](https://snack.expo.io/).\r\n-->\r\n- Initialise `react-native` application. Preferably using `react-native-clie`\r\n   > i.e `react-native init SampleProj`\r\n\r\n- Ensure you have atleast one test.\r\n- Run `yarn test`\r\n\r\n## Expected Behavior\r\n<!-- Write what you thought would happen. -->\r\nThe expected behaviour is for the tests to run successfully. To either fail or pass.\r\n\r\n## Actual Behavior\r\n<!-- Write what happened. Include screenshots if needed. If this is a regression, let us know. -->\r\nAll test suites fail throwing the error below\r\n```\r\n /Users/{user}/pulse/pulse-mobile-app/node_modules/react-native/jest/setup.js:\r\nbabel-plugin-jest-hoist: The module factory of `jest.mock()` is not allowed to reference any out-of-scope variables.\r\n    Invalid variable access: console\r\n...\r\n```\r\nThe error message continues to say\r\n```\r\nWhitelisted objects: Array, ArrayBuffer, Boolean, DataView, Date, Error, EvalError, Float32Array,\r\nFloat64Array, Function, Generator, GeneratorFunction, Infinity, Int16Array, Int32Array, Int8Array,\r\nInternalError, Intl, JSON, Map, Math, NaN, Number, Object, Promise, Proxy, RangeError,\r\nReferenceError, Reflect, RegExp, Set, String, Symbol, SyntaxError, TypeError, URIError, Uint16Array,\r\nUint32Array, Uint8Array, Uint8ClampedArray, WeakMap, WeakSet, arguments, expect, jest, require,\r\nundefined, DTRACE_NET_SERVER_CONNECTION, DTRACE_NET_STREAM_END,\r\nDTRACE_HTTP_SERVER_REQUEST, DTRACE_HTTP_SERVER_RESPONSE,\r\nDTRACE_HTTP_CLIENT_REQUEST, DTRACE_HTTP_CLIENT_RESPONSE, global, process, Buffer,\r\nclearImmediate, clearInterval, clearTimeout, setImmediate, setInterval, setTimeout.\r\n    Note: This is a precaution to guard against uninitialized mock variables.\r\nIf it is ensured that the mock is required lazily, variable names prefixed with `mock` are permitted.\r\n\r\n      at invariant (node_modules/babel-plugin-jest-hoist/build/index.js:14:11)\r\n      at newFn (node_modules/babel-traverse/lib/visitors.js:276:21)\r\n      at NodePath._call (node_modules/babel-traverse/lib/path/context.js:76:18)\r\n      at NodePath.call (node_modules/babel-traverse/lib/path/context.js:48:17)\r\n      at NodePath.visit (node_modules/babel-traverse/lib/path/context.js:105:12)\r\n      at TraversalContext.visitQueue (node_modules/babel-traverse/lib/context.js:150:16)\r\n```\r\n"}}
{"actor":{"display_login":"cpojer"}}