Skip to content

[Bug]: Use .mts file extension with ts-jest #3702

@michaelwittwer

Description

@michaelwittwer

Version

28.0.7

Steps to reproduce

Steps:

  1. clone my repo at https://github.com/shiftcode/ts-jest-issue
  2. npm install
  3. npm run test

Expected behavior

Test should run successfully without any complains.

Actual behavior

I am seeing the following WARN message from ts-jest:

ts-jest[ts-jest-transformer] (WARN) Got a unknown file type to compile (file: /Users/michaelwittwer/dev/shiftcode/esm-ts-jest/src/util.spec.mts). To fix this, in your Jest config change the transform key which value is ts-jest so that it does not match this kind of files anymore.

Which prevents the tsc compiler to compile the source to mjs.

Debug log

to long to be pasted here, you can execute npm run test:debug to see the log after checking out the repo

Additional context

No response

Environment

System:
    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Max
Binaries:
    Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
npmPackages:
    jest: ^28.1.3 => 28.1.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions