Skip to content

[Bug]: Support {m,c}{j,t}s file extensions for tests and modules #14149

Closed
@nickserv

Description

@nickserv

Version

29.5.0

Steps to reproduce

  1. Clone https://gist.github.com/nickmccurdy/c8f81c3f7c3587a15199ebcf151ed555
  2. npm install-test

Expected behavior

Jest runs all tests.

Actual behavior

Jest only runs tests with extensions:

  • js
  • jsx
  • ts
  • tsx

Jest doesn't run tests with extensions:

  • mjs
  • cjs
  • mts
  • cts

Additional context

  • All of these extensions are missing from testMatch and testRegex.
  • mts and mts are missing from moduleFileExtensions.
  • All of these extensions are supposed by VSCode and Vitest.

Environment

System:
    OS: macOS 12.6.5
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
  Binaries:
    Node: 20.1.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.6.6 - /usr/local/bin/npm
  npmPackages:
    jest: 29.5.0 => 29.5.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions