Skip to content

exclude option excludes all files from type checking #2634

@drrnkin

Description

@drrnkin

🐛 Bug Report

Compiler errors are not detected in any typescript file if an exclude option is present. The exclude option appears to exclude all files no matter what is specified. Eg. exclude: ['NOTHING'] causes all source files to be excluded from type-checking.

To Reproduce

Steps to reproduce the behavior:

  • Unzip the attached tsJestExclude.zip
  • yarn
  • yarn test

Note that the compiler errors in thing.test.ts are not detected. If you remove the exclude from jest.config.js, then they'll be detected. You can also add similar errors to thing.ts and it also won't be detected.

tsJestExclude.zip

Expected behavior

Errors should be reported in files that don't match the entries in the exclude option.

envinfo

System:
    OS: Windows
    Node version: v14.16.1
    Yarn version: 1.22.5

Npm packages:
    jest:
    ts-jest:
    typescript:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions