Skip to content

support jest.config.mjs and jest.config.cjs #9225

Closed
@xiaoxiangmoe

Description

@xiaoxiangmoe

🚀 Feature Proposal

jest.config.js is using commonjs. Can we use jest.config.mjs and jest.config.cjs for config file in node 13.2?

Motivation

esm support for config file

Example

// jest.config.mjs
export default {
  // [...]
  // Replace `ts-jest` with the preset you want to use
  // from the above list
  preset: 'ts-jest/presets/js-with-ts',
};

Pitch

Why does this feature belong in the Jest core platform?

Common feature proposals that do not typically make it to core:

  • New matchers (see jest-extended)
  • Changes to the default reporter (use custom reporters instead)
  • Changes to node/jsdom test environments (use custom environments instead)

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