Skip to content

[Feature]: Support loading jest.config.ts as ESM #13118

Open
@luxaritas

Description

@luxaritas

🚀 Feature Proposal

  • If "type": "module" is set in the package.json, jest.config.ts should be treated as ESM, not CJS
  • jest.config.mts and jest.config.cts should be looked for and loaded as ESM and CJS, respectively

Motivation

  • This is currently the behavior with jest.config.js, and so ESM vs CJS handling differs between JS and TS configs
  • I would like to be able to import ESM libraries in my TS config

Example

No response

Pitch

  • Config loading is handled by core
  • Module behavior between JS and TS should match

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions