Skip to content

🚀 Feature: ESM configuration file #5049

@thescientist13

Description

@thescientist13

Is your feature request related to a problem or a nice-to-have?? Please describe.
To continue the journey in supporting ESM in Mocha, it would be nice to have support for ESM based configuration files. Currently this is documented as a known limitation

Configuration file can only be a CommonJS file (.mocharc.js or .mocharc.cjs)

Describe the solution you'd like
Allow ESM based configuration files in projects, either with (.mocharc.js) or without (.mocharc.mjs) a type="module" field in package.json

export default {
  timeout: 30000
}

Describe alternatives you've considered
Only other current alternative in Node is CJS.

Additional context
N / A

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