{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/jest/issues/5775","repository_url":"https://api.github.com/repos/facebook/jest","labels_url":"https://api.github.com/repos/facebook/jest/issues/5775/labels{/name}","comments_url":"https://api.github.com/repos/facebook/jest/issues/5775/comments","events_url":"https://api.github.com/repos/facebook/jest/issues/5775/events","html_url":"https://github.com/facebook/jest/issues/5775","id":304121973,"number":5775,"title":"Cannot read property 'some' of undefined when running coverage","user":{"login":"micronaut","id":1538325,"avatar_url":"https://avatars1.githubusercontent.com/u/1538325?v=4","gravatar_id":"","url":"https://api.github.com/users/micronaut","html_url":"https://github.com/micronaut","followers_url":"https://api.github.com/users/micronaut/followers","following_url":"https://api.github.com/users/micronaut/following{/other_user}","gists_url":"https://api.github.com/users/micronaut/gists{/gist_id}","starred_url":"https://api.github.com/users/micronaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micronaut/subscriptions","organizations_url":"https://api.github.com/users/micronaut/orgs","repos_url":"https://api.github.com/users/micronaut/repos","events_url":"https://api.github.com/users/micronaut/events{/privacy}","received_events_url":"https://api.github.com/users/micronaut/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-11T01:39:25Z","updated_at":"2018-03-11T21:08:36Z","closed_at":null,"author_association":"NONE","body":"I can run the tests successfully without coverage. When I try to run coverage on a React component, I am getting this error:\r\n\r\n`TypeError: /common/workspaces/omni-design-system/src/components/LinkItem/LinkItem.jsx: Cannot read property 'some' of undefined`\r\n\r\n      `at VisitState.onEnter (node_modules/istanbul-lib-instrument/dist/visitor.js:147:64)\r\n      at VisitState.wrappedEntry (node_modules/istanbul-lib-instrument/dist/visitor.js:336:14)\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      at TraversalContext.visitMultiple (node_modules/babel-traverse/lib/context.js:103:17)\r\n      at TraversalContext.visit (node_modules/babel-traverse/lib/context.js:190:19)\r\n      at Function.traverse.node (node_modules/babel-traverse/lib/index.js:114:17)\r\n      at NodePath.visit (node_modules/babel-traverse/lib/path/context.js:115:19)`\r\n\r\nHere are my devDeps from package.json:\r\n```javascript\r\n\"devDependencies\": {\r\n    \"@storybook/addon-actions\": \"^3.3.14\",\r\n    \"@storybook/addon-info\": \"^3.3.14\",\r\n    \"@storybook/cli\": \"^3.3.14\",\r\n    \"@storybook/react\": \"^3.3.14\",\r\n    \"babel-core\": \"^6.26.0\",\r\n    \"babel-jest\": \"^22.4.1\",\r\n    \"babel-plugin-transform-es2015-modules-commonjs\": \"^6.26.0\",\r\n    \"babel-preset-env\": \"^1.6.1\",\r\n    \"babel-preset-es2015\": \"^6.24.1\",\r\n    \"babel-preset-react\": \"^6.24.1\",\r\n    \"css-loader\": \"^0.28.10\",\r\n    \"enzyme\": \"^3.3.0\",\r\n    \"enzyme-adapter-react-16\": \"^1.1.1\",\r\n    \"expect\": \"^22.4.0\",\r\n    \"identity-obj-proxy\": \"^3.0.0\",\r\n    \"jest\": \"^22.4.2\",\r\n    \"jest-css-modules\": \"^1.1.0\",\r\n    \"less\": \"^3.0.1\",\r\n    \"less-loader\": \"^4.0.6\",\r\n    \"react-css-modules\": \"^4.7.1\",\r\n    \"react-styleguidist\": \"^6.2.6\",\r\n    \"react-test-renderer\": \"^16.2.0\",\r\n    \"shortid\": \"^2.2.8\",\r\n    \"storybook-addon-specifications\": \"^2.1.1\",\r\n    \"style-loader\": \"^0.20.2\",\r\n    \"v8\": \"^0.1.0\"\r\n  },\r\n```\r\n\r\nand my jest.config.js\r\n```javascript\r\nmodule.exports = {\r\n    \"verbose\": true,\r\n    \"automock\": false,\r\n    \"transform\": {\r\n        \"^.+\\\\.jsx?$\": \"babel-jest\",\r\n        \"^.+\\\\.*ss?$\": \"<rootDir>/node_modules/jest-css-modules\"\r\n    },\r\n    \"roots\": [\r\n        \"<rootDir>/src\"\r\n    ],\r\n    \"moduleFileExtensions\": [\r\n        \"js\",\r\n        \"jsx\",\r\n        \"json\"\r\n    ],\r\n    \"moduleNameMapper\": {\r\n        \"\\\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$\": \"<rootDir>/__mocks__/fileMock.js\",\r\n        \"\\\\.(css|less)$\": \"identity-obj-proxy\"\r\n    },\r\n    \"collectCoverageFrom\": [\r\n        \"src/components/**/LinkItem.jsx\"\r\n    ],\r\n    \"coverageReporters\": [\r\n        \"text\"\r\n    ]\r\n\r\n};\r\n```\r\n\r\n\r\nand the React component\r\n```javascript\r\nimport React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport CSSModules from 'react-css-modules';\r\nimport styles from './linkItem.less'\r\n\r\nexport class LinkItem extends Component {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst { url, image, text=' ' } = this.props.item;\r\n\t\treturn (\r\n\t\t\t<a href={url}>{image ? <img styleName='item-image' src={image} alt={text}/> : text}</a>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nLinkItem.propTypes = {\r\n\t/** Item for link */\r\n\titem: PropTypes.object.isRequired\r\n};\r\n\r\n\r\nLinkItem.defaultProps = {\r\n\titem: null\r\n};\r\n\r\nexport default CSSModules(LinkItem, styles);\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/jest/issues/comments/372149355","html_url":"https://github.com/facebook/jest/issues/5775#issuecomment-372149355","issue_url":"https://api.github.com/repos/facebook/jest/issues/5775","id":372149355,"user":{"login":"micronaut","id":1538325,"avatar_url":"https://avatars1.githubusercontent.com/u/1538325?v=4","gravatar_id":"","url":"https://api.github.com/users/micronaut","html_url":"https://github.com/micronaut","followers_url":"https://api.github.com/users/micronaut/followers","following_url":"https://api.github.com/users/micronaut/following{/other_user}","gists_url":"https://api.github.com/users/micronaut/gists{/gist_id}","starred_url":"https://api.github.com/users/micronaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micronaut/subscriptions","organizations_url":"https://api.github.com/users/micronaut/orgs","repos_url":"https://api.github.com/users/micronaut/repos","events_url":"https://api.github.com/users/micronaut/events{/privacy}","received_events_url":"https://api.github.com/users/micronaut/received_events","type":"User","site_admin":false},"created_at":"2018-03-11T21:08:36Z","updated_at":"2018-03-11T21:08:36Z","author_association":"NONE","body":"I didn't find this earlier, but it looks like there is a bug already logged: https://github.com/istanbuljs/istanbuljs/issues/145"}}
{"actor":{"display_login":"micronaut"}}