test: catch projects that lose their test files - #337
Merged
Merged
Conversation
Two gaps let #288 delete all three `the-typeinator` test files without any check going red, leaving the project broken on `main` for months (#322, #323, #324). The `Test`, `Solutions`, and `Tsc` workflows pick which projects to run from `changed-files`'s `all_changed_files` output, which is ACMR and so excludes deletions. The typeinator's only change in that PR was three deletions, so the project never ran. Switches all three workflows to `all_modified_files` (ACMRD), which includes them. `files.test.ts` runs on every PR with no changed-files filtering, but only validated `_category_.json`, `README.md`, `tsconfig.json`, and `package.json` -- a step directory with no test file passed. Adds an assertion that every step (or `src`) of a project contains a test file. A project's `test` script is the discriminator: `tsc` projects are type-checking exercises and legitimately ship no tests, while all 18 `jest` projects currently have a test file in every step, so the new assertion adds no false positives. Verified by re-deleting the three typeinator test files, which now fails `files.test.ts` with one error per step. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JoshuaKGoldberg
force-pushed
the
test-guard-missing-project-tests
branch
from
September 22, 2026 12:57
ba86975 to
3b8afe0
Compare
JoshuaKGoldberg
marked this pull request as ready for review
September 22, 2026 13:01
4 tasks done
JoshuaKGoldberg
force-pushed
the
test-guard-missing-project-tests
branch
from
September 22, 2026 13:11
18d6218 to
3b8afe0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Overview
Follow-up to #335, closing the two gaps that let those deletions through CI:
Test,Solutions, andTscselected projects fromall_changed_files(ACMR), so a delete-only change never ran the affected project. Switched toall_modified_files(ACMRD).files.test.tsnow asserts each step — orsrc— contains a*.test.*file, gated on the project'stestscript beingjest. The 12tscprojects legitimately ship none, so this adds no false positives.Verified: 187 pass on
main, including 24 new assertions; re-deleting the typeinator test files fails 3, one per step. The workflow change needs a real delete-only PR to confirm end to end.🤖 Generated with Claude Code