Skip to content

Commit

Permalink
Add Jest config for es2015
Browse files Browse the repository at this point in the history
This patch solve es2015 style module `import`
that used in unit-test for this preset modules.

- Install babel-plugin-transform-es2015-modules-commonjs
  - package-lock.json updated
- package.json:
  - Add config for Jest
- .babelrc:
  - Add config enable plugin for NODE_ENV=test
  • Loading branch information
kei-gbf committed Jun 16, 2019
1 parent 82191e5 commit 2492295
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@
],
"plugins": [
"transform-inline-environment-variables"
]
],
"env": {
"test": {
"plugins": [
"transform-es2015-modules-commonjs"
]
}
}
}
73 changes: 73 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@storybook/react": "^5.0.11",
"@storybook/theming": "^5.0.11",
"autoprefixer": "8.6.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"babelify": "8.0.0",
"browserify": "16.2.3",
"eslint": "^4.19.1",
Expand Down

0 comments on commit 2492295

Please sign in to comment.