question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Jest fails in CI with Node 6. Using Babel 7.

See original GitHub issue

šŸ› Bug Report

Jest or Babel-Jest doesnā€™t seem to work under CI environment (be it Travis or AppVeyor) when using Node 6. With Node 8 it works fine in both CIs.

Iā€™m using Babel 7. When tested locally with the same Node 6 version it works.

To Reproduce

I canā€™t reproduce it locally. See link of travis build run below.

The only difference between the CI builds and my local environment is the operating system. Travis CI is using Linux (Trusty), and AppVeyor is using Windows, whereas Iā€™m using macOS High Sierra 10.13.4.

But Iā€™m guessing itā€™s not a problem with the operating system, as both work fine when using Node 8.

Relevant packages:

"@babel/cli": "7.0.0",
"@babel/core": "7.0.0",
"@babel/preset-env": "7.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "23.4.2",
"babel-loader": "8.0.2",
"jest": "23.5.0",

babel.config.js (which doesnā€™t seem to be running when under Node 6 in the CI):

module.exports = api => {
  const env = api.env();

  let presets = [];
  let plugins = [];

  switch (env) {
    case "test": {
      presets = ["@babel/preset-env"];
      break;
    }
  }

  return {
    presets,
    plugins
  };
};

Expected behavior

The behaviour should yield the same result as the local run with the same Node and npm version, where it passes.

Link to repl or repo (highly encouraged)

See travis build at: https://github.com/scarlettgamestudio/scarlett-framework-2/runs/16865592 for a simple use case with both Node 6 and Node 8 (this one works fine). See appveyor build (using Node 6) at: https://ci.appveyor.com/project/Apidcloud/scarlett-framework-2/build/0.0.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
milesjcommented, Sep 12, 2018

@Apidcloud Can you try 23.6? babel.config.js support was added in that version.

0reactions
github-actions[bot]commented, May 12, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Babel 7 + Jest results in timeout - Running Tests
I'm upgrading a React project from Babel 6 to Babel 7 (and bumping the Jest in the process). My build is failing with...
Read more >
Issue with babel-jest dependency when running npm start in a ...
This problem can occur if there is node_modules in a parent directory of the folder where you run the application. I solved the...
Read more >
babel-jest - npm
Start using babel-jest in your project by running `npm i babel-jest`. There are 7377 other projects in the npm registry using babel-jest.
Read more >
Troubleshooting - Jest
Tests are Failing and You Don't Know Whyā€‹. Try using the debugging support built into Node. Place a debugger; statement in any of...
Read more >
babel-preset-jest | Yarn - Package Manager
babel -preset-jest. Babel preset for all Jest plugins. This preset is automatically included when using babel-jest. Install. $ npm installĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found