🧪✨:test the glob helper, and run tests at all - #1809
Merged
Conversation
DerekNonGeneric
force-pushed
the
fix/glob-skips-dotfiles
branch
from
August 13, 2026 00:49
e225678 to
53120f6
Compare
DerekNonGeneric
force-pushed
the
test/unit-tests-for-glob
branch
from
August 13, 2026 00:49
79ca308 to
3c2b074
Compare
DerekNonGeneric
force-pushed
the
fix/glob-skips-dotfiles
branch
from
August 13, 2026 01:20
53120f6 to
0fc7a98
Compare
DerekNonGeneric
force-pushed
the
test/unit-tests-for-glob
branch
from
August 13, 2026 01:20
3c2b074 to
e7f33b6
Compare
DerekNonGeneric
force-pushed
the
fix/glob-skips-dotfiles
branch
from
August 13, 2026 02:35
0fc7a98 to
efff2f3
Compare
DerekNonGeneric
force-pushed
the
test/unit-tests-for-glob
branch
2 times, most recently
from
August 13, 2026 03:10
9487f49 to
bf48347
Compare
DerekNonGeneric
force-pushed
the
fix/glob-skips-dotfiles
branch
from
August 13, 2026 03:23
4682b48 to
6663a82
Compare
The first tests in this repository, aimed at the function that has produced two real bugs: directory entries reaching shell commands, and wildcards never matching a dot name. Both are three lines to pin down. Node's own test runner, so nothing is added to install. The fixture is a temporary tree the suite becomes the working directory of, since every pattern a task writes is relative to where the task runs. Assisted-by: Claude-Code:claude-opus-5
`nps test` has run thirteen linters and no tests, while the workflow that calls it is named "lint and test". Registering the runner under verify puts it in `verify.all`, and so in CI, without touching the workflow. `node --test` given a pattern that matches nothing exits 0, so the task counts the files it found rather than forwarding the pattern and trusting the exit code. Assisted-by: Claude-Code:claude-opus-5
The test named for covering a whole subtree had no dot file in its fixture, so it passed while never exercising the thing this branch is about -- and it went on passing when the bug it should have caught was put back. It fails now without the fix. Assisted-by: Claude-Code:claude-opus-5
DerekNonGeneric
force-pushed
the
test/unit-tests-for-glob
branch
from
August 13, 2026 03:26
bf48347 to
1837a6e
Compare
✅ Deploy Preview for gh-pages-openinf ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
There are no tests in this repository.
nps testruns thirteen linters and nothing else, in a workflow named "lint and test".Stacked on #1804, because three of these tests assert the dot-matching behaviour that PR introduces — on
livethey fail, which is the point.Where to start
glob()inbuild/utils.mtshas produced two real bugs in the last few days:*and**never matching a dot name, which left eighteen files unchecked across five tasksBoth are three lines to pin down. Ten tests cover exclusions, trailing-slash expansion, extension discrimination, the string-or-array parameter, dot files, dot directories, the standing
.gitexclusion, and pruning dot entries out of an excluded directory.Node's own runner, so nothing is added to install. The fixture is a temporary tree that the suite makes its working directory, since every pattern a task writes is relative to where the task runs.
Proof they bite
Each past bug reintroduced deliberately, in the manner of the rest of the pipeline:
.filter((entry) => entry.isFile())expandDotPatternfrom the include pathliveThe runner counts before it trusts
node --testhanded a pattern matching nothing exits 0:A task that only forwarded the pattern would report success having run no tests — the exact failure this session has been full of. So
verify-unit.mtsresolves the file list first and fails if it is empty. Probed by moving the test file aside:There is a mild circularity in using
glob()to find the tests forglob(). The count guard is what makes it safe: a helper that finds nothing fails loudly rather than passing quietly, and a helper that finds the wrong things fails in the tests themselves.Registered under verify, deliberately
verify.alliteratesbuild/tasks/verify/*.mts, so adding the task there puts the tests in CI without touching the workflow, andnps testbecomes true to its name.nps verify.unitruns them alone.Verification
nps test— 14/14 tasks, 10/10 testsnps buildunchangedexec; it is a two-line wrapper over@yarnpkg/shelland testing it means running shell commands for little return. The tests it would need are integration tests of the tasks themselves, which is a larger question than this PR.Note
Same trivial conflict as #1808: this reworks the
verify.allcomment to stop counting the tasks, with identical wording, so the two merge cleanly together. #1274 changes that line to "fourteen" and wants the reworded version kept instead.