Skip to content

BabelConfig with rootMode: "upward" not loading babel config files #1341

@arvigeus

Description

@arvigeus

A simple monorepo with the following config:

// package/ui/jest.config.js

{
  globals: {
    "ts-jest": {
      babelConfig: {
        rootMode: "upward"
    }
  },
  preset: "ts-jest",
  transform: {
    "^.+\\.jsx?$": ["babel-jest", { rootMode: "upward" }]
  }
}

When I run yarn test it works as expected. When I run yarn lerna run test, ts-jest fails to load babel configs. If I use babel-jest instead of ts-jest, it works fine. The only way to make it work is to manually pass the entire babel config to globals[ts-jest].babelConfig.

Maybe something like globals[ts-jest].babelConfig.babelrc: true would be nice in such case to allow loading configs. It didn't worked with globals[ts-jest].babelConfig: true

Minimal repo

https://github.com/arvigeus/monotest

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions