From 0403f129aea92fa67de33d33c83d3034a30f5d37 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Tue, 4 Dec 2018 20:01:20 +0100 Subject: [PATCH 1/2] 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", From d640552828904e0462f613372c2c6db8bc1f8072 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Tue, 4 Dec 2018 19:53:13 +0100 Subject: [PATCH 2/2] Update snapshots --- test/__snapshots__/index.test.js.snap | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 0541ad4..91a3818 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -77,12 +77,12 @@ basic-json Build \\"basicJson\\" to dist: -146 B: basic-json.js.gz -97 B: basic-json.js.br -145 B: basic-json.mjs.gz -98 B: basic-json.mjs.br -225 B: basic-json.umd.js.gz -161 B: basic-json.umd.js.br" +130 B: basic-json.js.gz +81 B: basic-json.js.br +129 B: basic-json.mjs.gz +81 B: basic-json.mjs.br +209 B: basic-json.umd.js.gz +149 B: basic-json.umd.js.br" `; exports[`fixtures basic-ts 1`] = `