From 0403f129aea92fa67de33d33c83d3034a30f5d37 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Tue, 4 Dec 2018 20:01:20 +0100 Subject: [PATCH] Fix jest failing on transpilation --- babel.config.js | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index 044c191..7119f5d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -4,6 +4,7 @@ module.exports = { '@babel/preset-env', { loose: true, + modules: process.env.BABEL_ENV === 'test' ? 'commonjs' : 'auto', targets: { node: 'current', }, diff --git a/package.json b/package.json index 597fb01..ae930b8 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "prepare": "npm run -s build", "prepare:babel": "babel src/*.js -d dist && npm t", "lint": "eslint src", - "test": "npm run -s lint && npm run -s build && jest", + "test": "npm run -s lint && npm run -s build && BABEL_ENV=test jest", "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" }, "repository": "developit/microbundle",