Skip to content

Commit

Permalink
CI: fix jest issue with latest node 12.17
Browse files Browse the repository at this point in the history
  • Loading branch information
jchip committed May 29, 2020
1 parent e437011 commit 898bc6b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [10.x, 12.16.x]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js
node_js:
- v10
- v12
- v12.16
dist: trusty # needs Ubuntu Trusty
sudo: required # no need for virtualization.
addons:
Expand Down
8 changes: 6 additions & 2 deletions packages/xarc-app-dev/config/babel/babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const archetype = require("@xarc/app/config/archetype")();
const optionalRequire = require("optional-require")(require);
const optFlow = optionalRequire("electrode-archetype-opt-flow");

const isJest = Boolean(process.env.JEST_WORKER_ID);

const {
enableTypeScript,
flowRequireDirective,
Expand All @@ -34,7 +36,7 @@ const fileId = "xarc-app-dev:babelrc.js";

const checkEnv = names => {
names = names.filter(x => !process.env.hasOwnProperty(x));
if (names.length > 0) {
if (!isJest && names.length > 0) {
console.error(
ck`\n<red>Notice:</> ${fileId}: env ${names.join(", ")} not defined - default to 'false'\n`
);
Expand Down Expand Up @@ -140,7 +142,9 @@ const plugins = basePlugins.concat(
const target = isNodeTarget ? "node" : archetype.babel.target;

const targets = archetype.babel.envTargets[target];
console.log(ck`<orange>Babel preset-env compile targets: </><cyan>${JSON.stringify(targets)}</>`);
if (!isJest) {
console.log(ck`<orange>Babel preset-env compile targets: </><cyan>${JSON.stringify(targets)}</>`);
}

const useBuiltIns =
!isNodeTarget && archetype.babel.hasMultiTargets
Expand Down

0 comments on commit 898bc6b

Please sign in to comment.