Skip to content

fix(core): classify module.test-utils files as test support - #4353

Merged
RaghavChamadiya merged 1 commit into
repowise-dev:mainfrom
ShryukGrandhi:fix/issue-3269-files-named-test-support-ts-are-not-clas
Oct 24, 2026
Merged

RaghavChamadiya merged 1 commit into
repowise-dev:mainfrom
ShryukGrandhi:fix/issue-3269-files-named-test-support-ts-are-not-clas

Conversation

@ShryukGrandhi

Copy link
Copy Markdown
Contributor

Summary

  • src/foo.test-utils.ts (and the .js/.mjs forms) is now classified as test support. Before this change it was scored as production code.
  • utils counts as a scaffolding word only when a dot ties the name to a module (<module>.test-utils.*). Bare test-utils.js, which React and Preact publish as a package entry, is still production code.
  • Added the issue's names to the corpus as regression rows, plus src/test-supporter.ts as a negative row.

On current main, foo.test-support.ts and foo.test-helpers.ts were already classified as support by _is_support_compound. Only foo.test-utils.ts was still unclassified, because utils is deliberately left out of _SUPPORT_NAME_WORDS. I kept these names out of test_infixes, so they are support and not tests. That matches how .test-harness. and .test-setup. are handled today.

Related Issues

Fixes #3269

Test Plan

  • Tests pass (pytest): uv run pytest tests/unit/test_test_paths.py (the new foo.test-utils rows fail before the change and pass after it), plus every unit test module that references the test-path classifier (1725 passed)
  • Lint passes (ruff check .) on the touched files

Checklist

  • My code follows the project's code style
  • I have added tests for new functionality
  • All existing tests still pass
  • I have updated documentation if needed

@RaghavChamadiya RaghavChamadiya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requiring the dot that ties test-utils to a module keeps a bare test-utils.js counted as production. Thanks @ShryukGrandhi, and welcome.

@RaghavChamadiya
RaghavChamadiya merged commit f7d5363 into repowise-dev:main Oct 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files named *.test-support.ts are not classified as test material

2 participants