Skip to content

fix: ensure test files are ignored when type checking#92409

Open
donkeyote wants to merge 1 commit intovercel:canaryfrom
donkeyote:fix/type-check-test-files
Open

fix: ensure test files are ignored when type checking#92409
donkeyote wants to merge 1 commit intovercel:canaryfrom
donkeyote:fix/type-check-test-files

Conversation

@donkeyote
Copy link
Copy Markdown

Fixes #92408
Move test file exclusion filter to run before the TypeScript program is created, rather than filtering diagnostics after the emit.

Previously, test and mock files (tests, mocks, .spec., .test.) were still compiled as part of the program — their errors were just suppressed. Now they are excluded from rootNames upfront, so they are never type-checked at all.

Move test file exclusion filter to run before the TypeScript program is created, rather than filtering diagnostics after the emit.

Previously, test and mock files (__tests__, __mocks__, *.spec.*, *.test.*) were still compiled as part of the program — their errors were just suppressed. Now they are excluded from rootNames upfront, so they are never type-checked at all.
@nextjs-bot
Copy link
Copy Markdown
Collaborator

Allow CI Workflow Run

  • approve CI run for commit: dcb25a4

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exclude test files from TypeScript type checking

2 participants