Skip to content

Commit 0403f12

Browse files
Fix jest failing on transpilation
1 parent 1f23940 commit 0403f12

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = {
44
'@babel/preset-env',
55
{
66
loose: true,
7+
modules: process.env.BABEL_ENV === 'test' ? 'commonjs' : 'auto',
78
targets: {
89
node: 'current',
910
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"prepare": "npm run -s build",
1313
"prepare:babel": "babel src/*.js -d dist && npm t",
1414
"lint": "eslint src",
15-
"test": "npm run -s lint && npm run -s build && jest",
15+
"test": "npm run -s lint && npm run -s build && BABEL_ENV=test jest",
1616
"release": "npm run -s prepare && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
1717
},
1818
"repository": "developit/microbundle",

0 commit comments

Comments
 (0)