Skip to content

Regression: no typescript transformation/compilation possible for JavaScript files any more #740

@mkreidenweis

Description

@mkreidenweis

Issue :

Hi. I think #724 (v23.10.0) introduced a regression: Running a test of ours fails with a message like this:

ts-jest[jest-transformer] (WARN) Got a unknown file type to compile (file: /home/xxx/yyy/node_modules/lodash-es/_matchesStrictComparable.js). 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.

ts-jest doesn't seem to typescript-compile .js files at all any more.

Expected behavior :

ts-jest passes .js files through typescript compilation, tests finish without error. (The version we were using before (22.4.4) didn't have the issue.)

Suggested fix:

IMO the problem is here: 6c32a93#diff-969086a2836a7b1045fc24603a3b6cbeR114
Line 114 should actually read

     } else if (isTsFile || isJsFile) { 

Right now we always run in the else case, even though the condition in line 110 and the comment in line 118 makes me expect that we take the tsCompiler.compile for .js files as well.

Please let me know if you need more info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions