Skip to content

🐛 Wildcards in Jest projects #1709

@joshkel

Description

@joshkel

Prerequisites

Reproduction url

https://github.com/joshkel/knip-jest-monorepo

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

Jest in a monorepo setup allows a root-level Jest config to refer to per-project configs. This can be done via directory or file path.

module.exports = {
  projects: [
    '<rootDir>/packages/*',
  ],
};
module.exports = {
  projects: [
    '<rootDir>/packages/*/jest.config.js',
  ],
};

Knip's Jest plugin doesn't recognize this, resulting in errors similar to the following:

Unresolved imports (1)
/Users/josh/src/test-cases/knip-jest-monorepo/packages/* jest.config.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions