{"action":"opened","issue":{"url":"https://api.github.com/repos/reactioncommerce/reaction/issues/4781","repository_url":"https://api.github.com/repos/reactioncommerce/reaction","labels_url":"https://api.github.com/repos/reactioncommerce/reaction/issues/4781/labels{/name}","comments_url":"https://api.github.com/repos/reactioncommerce/reaction/issues/4781/comments","events_url":"https://api.github.com/repos/reactioncommerce/reaction/issues/4781/events","html_url":"https://github.com/reactioncommerce/reaction/issues/4781","id":374100512,"node_id":"MDU6SXNzdWUzNzQxMDA1MTI=","number":4781,"title":"Babel doesn't transpile Jest tests files in custom plugins that have a package.json","user":{"login":"dancastellon","id":849570,"node_id":"MDQ6VXNlcjg0OTU3MA==","avatar_url":"https://avatars3.githubusercontent.com/u/849570?v=4","gravatar_id":"","url":"https://api.github.com/users/dancastellon","html_url":"https://github.com/dancastellon","followers_url":"https://api.github.com/users/dancastellon/followers","following_url":"https://api.github.com/users/dancastellon/following{/other_user}","gists_url":"https://api.github.com/users/dancastellon/gists{/gist_id}","starred_url":"https://api.github.com/users/dancastellon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dancastellon/subscriptions","organizations_url":"https://api.github.com/users/dancastellon/orgs","repos_url":"https://api.github.com/users/dancastellon/repos","events_url":"https://api.github.com/users/dancastellon/events{/privacy}","received_events_url":"https://api.github.com/users/dancastellon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-25T19:37:35Z","updated_at":"2018-10-25T19:37:35Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Prerequisites\r\n* [x] Are you running the latest version? 2.0.0-rc.6\r\n* [x] Are you able to consistently reproduce the issue?\r\n* [x] Did you search the issue queue for existing issue?\r\n\r\n## Issue Description\r\nBabel 7 doesn't transpile files in sub-directories that have a package.json when Babel is configured through package.json or .babelrc. This causes Jest test failures in custom plugins that have a package.json. It isn't an issue with non-test files because those are imported through the main Reaction app (see /server/plugins.js and client/plugins.js). Babel does transpile these files when it is configured through the new babel.config.js. Meteor currently only loads Babel config through .babelrc or package.json, though. \r\n\r\n## Steps to Reproduce\r\n1. Create a folder inside `imports/plugins/custom`\r\n2. In the folder, run `npm init` and create an empty package.json\r\n3. Create a file named log.js with `console.log(\"test\");` in it\r\n3. Create a log.test.js file with the following content:\r\n```\r\nimport \"log\";\r\ntest(\"Simple test\"), () => { expect(true).toBe(true); });\r\n```\r\n4. Back in the reaction root dir, run `meteor npm run test:unit`\r\n5. Observe `Unexpected token import...` error coming from log.test.js\r\n\r\n## Possible Solution\r\nCreate a `babel.config.js` in the root dir that loads package.json->babel and exports it."}}
{"actor":{"display_login":"dancastellon"}}