Skip to content

transformIgnorePatterns option is not used when specified in global config of multi-project setup #5260

@smolyakoff

Description

@smolyakoff

I'm running jest in a multi-project mode with several projects in subdirectories. The global configuration file in the root directory is as follows

module.exports = {
  rootDir: 'src',
  coverageDirectory: '<rootDir>/../coverage',
  collectCoverageFrom: [
    '**/*.js',
    '!**/index.js',
    '!**/jest.config.js',
  ],
  projects: [
    '<rootDir>/server',
    '<rootDir>/client',
    '<rootDir>/common',
  ],
  transformIgnorePatterns: [
    '/node_modules/(?!lodash-es)',
  ],
};

Project configurations are relatively simple and only differ by testEnvironment (node and jsdom) as for now. I expect jest to use transformIgnorePatterns options for all projects when I run it from the root directory with npm test. But it does work only if I move the mentioned option to the jest configuration in the subdirectory, such as src/client/jest.config.js

Is this an intended behavior or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions