{"action":"created","issue":{"url":"https://api.github.com/repos/react-community/create-react-native-app/issues/568","repository_url":"https://api.github.com/repos/react-community/create-react-native-app","labels_url":"https://api.github.com/repos/react-community/create-react-native-app/issues/568/labels{/name}","comments_url":"https://api.github.com/repos/react-community/create-react-native-app/issues/568/comments","events_url":"https://api.github.com/repos/react-community/create-react-native-app/issues/568/events","html_url":"https://github.com/react-community/create-react-native-app/issues/568","id":299518955,"number":568,"title":"yarn test fails","user":{"login":"watadarkstar","id":3059371,"avatar_url":"https://avatars3.githubusercontent.com/u/3059371?v=4","gravatar_id":"","url":"https://api.github.com/users/watadarkstar","html_url":"https://github.com/watadarkstar","followers_url":"https://api.github.com/users/watadarkstar/followers","following_url":"https://api.github.com/users/watadarkstar/following{/other_user}","gists_url":"https://api.github.com/users/watadarkstar/gists{/gist_id}","starred_url":"https://api.github.com/users/watadarkstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watadarkstar/subscriptions","organizations_url":"https://api.github.com/users/watadarkstar/orgs","repos_url":"https://api.github.com/users/watadarkstar/repos","events_url":"https://api.github.com/users/watadarkstar/events{/privacy}","received_events_url":"https://api.github.com/users/watadarkstar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-22T21:42:54Z","updated_at":"2018-02-23T19:52:23Z","closed_at":null,"author_association":"NONE","body":"## Description\r\n\r\nI want to run tests. Might be related to: https://github.com/react-community/create-react-native-app/issues/199\r\n\r\n## Expected Behavior\r\n\r\nTests succeed.\r\n\r\n## Observed Behavior\r\n\r\nTests always fail. With a variety of syntax errors.\r\n\r\n## Environment\r\n\r\nPlease run these commands in the project folder and fill in their results:\r\n\r\n* `npm ls react-native-scripts`: 1.11.1\r\n* `npm ls react-native`: 0.52.0\r\n* `npm ls expo`: 25.0.0\r\n* `node -v`: v8.1.1\r\n* `npm -v`: 5.0.3\r\n* `yarn --version`: 1.3.2\r\n* `watchman version`: 4.7.0\r\n\r\nAlso specify:\r\n\r\n1. Operating system: Mac OSX High Sierra\r\n2. Phone/emulator/simulator & version: N/A\r\n\r\n## Reproducible Demo\r\n\r\nI got only one test, it's the default test CRNA creates. \r\n\r\nI have created a minimal example of what makes CRNA to fail when running `yarn test`.\r\n\r\nIt is after this commit where `yarn test` starts to fail https://github.com/watadarkstar/minimal-failing-crna-yarn-test/commit/94fdee722f773196f80b349f0d8ae970e4ed3d04\r\n\r\nThe minimal example can be found here: https://github.com/watadarkstar/minimal-failing-crna-yarn-test\r\n\r\nI try to run it with `yarn test`\r\n\r\nI get `SyntaxError: Unexpected token import` in many source files. I get this with the default `package.json`:\r\n\r\n```\r\nnode_modules/native-base-shoutem-theme/index.js:1\r\n    ({\"Object.<anonymous>\":function(module,exports,require,__dirname,__filename,global,jest){import connectStyle from \"./src/connectStyle\";\r\n                                                                                             ^^^^^^\r\n\r\n    SyntaxError: Unexpected token import\r\n\r\n      1 | import React from 'react';\r\n    > 2 | import { Text, View } from 'native-base';\r\n      3 | import { StackNavigator } from 'react-navigation';\r\n      4 | import { Home, Quiz, Results } from './components/screens';\r\n      5 |\r\n```\r\n\r\nMy `.babelrc`:\r\n\r\n```\r\n{\r\n  \"presets\": [\"babel-preset-expo\"],\r\n  \"env\": {\r\n    \"development\": {\r\n      \"plugins\": [\"transform-react-jsx-source\"]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nMy `package.json`:\r\n\r\n```\r\n\"test\": \"node node_modules/jest/bin/jest.js\"\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/react-community/create-react-native-app/issues/comments/368120692","html_url":"https://github.com/react-community/create-react-native-app/issues/568#issuecomment-368120692","issue_url":"https://api.github.com/repos/react-community/create-react-native-app/issues/568","id":368120692,"user":{"login":"ide","id":379606,"avatar_url":"https://avatars0.githubusercontent.com/u/379606?v=4","gravatar_id":"","url":"https://api.github.com/users/ide","html_url":"https://github.com/ide","followers_url":"https://api.github.com/users/ide/followers","following_url":"https://api.github.com/users/ide/following{/other_user}","gists_url":"https://api.github.com/users/ide/gists{/gist_id}","starred_url":"https://api.github.com/users/ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ide/subscriptions","organizations_url":"https://api.github.com/users/ide/orgs","repos_url":"https://api.github.com/users/ide/repos","events_url":"https://api.github.com/users/ide/events{/privacy}","received_events_url":"https://api.github.com/users/ide/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T19:52:23Z","updated_at":"2018-02-23T19:52:23Z","author_association":"OWNER","body":"It sounds like this is kind of working as expected. The default config doesn't whitelist the transformer for `native-base-shoutem-theme`. I think your solution is correct -- you must whitelist each package as needed.\r\n\r\nOne alternative for us is to whitelist all packages but we'd need to profile Jest on a large codebase to see how much longer it would take to run tests. In the meantime I think your approach is a good one."}}
{"actor":{"display_login":"ide"}}