test(cli): pin tasks watch monorepo discovery shape#61
Merged
Conversation
closes cli-watch-monorepo-coverage
Story 05 ("Each Team Member Has Their Own Queue") sells nested
TASKS.md files across packages as a first-class workflow, but the
existing watch.test.ts coverage was thinner than the claim:
- "finds nested TASKS.md files" only created one nested package and
asserted >= 2 files (so a regression dropping to 2 would still pass).
- "excludes node_modules and .git" was its own test, separate from the
multi-package case.
The new "discovers a full monorepo shape" test combines both signals
into the exact shape Story 05 promises:
TASKS.md (top-level)
packages/foo/TASKS.md (package 1)
packages/bar/TASKS.md (package 2)
node_modules/baz/TASKS.md (decoy — must be excluded)
It asserts the discovered set is exactly three files (top + 2
packages), and that no entry references the decoy path. A regression
that stops recursing into siblings, or stops excluding node_modules,
fails CI immediately.
No implementation change — discoverWatchFiles already handles this
correctly. The test pins the contract so the same drift fails the
next time someone refactors watch.ts.
Verified: npm run build, npm test (403 tests, +1 new), npm run lint,
npx -y @tasks-md/lint TASKS.md — all clean.
---
_🤖 Written by an agent, not Fyodor. Ping me if this looks off._
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.
Why this is needed
Closes `cli-watch-monorepo-coverage` (P2 hardening from PR #58).
Story 05 ("Each Team Member Has Their Own Queue") sells nested `TASKS.md` files across packages as a first-class workflow, but the existing `watch.test.ts` coverage was thinner than the claim:
A regression that stopped recursing into sibling packages — or stopped excluding `node_modules/` — could pass both tests today. The new test exercises the exact shape Story 05 promises so that drift can't slip through.
Summary
New test: `discoverWatchFiles › discovers a full monorepo shape (top + two packages, excludes node_modules)`. The fixture is the canonical workflow shape:
``` TASKS.md (top-level) packages/foo/TASKS.md (package 1) packages/bar/TASKS.md (package 2) node_modules/baz/TASKS.md (decoy — must be excluded) ```
The assertion is exact: discovered set length is 3, contents are top + foo + bar in any order, and no entry references the decoy path.
No implementation change — `discoverWatchFiles` already handles this correctly today. This PR pins the contract so the same drift fails CI the next time someone refactors `watch.ts`.
Test plan
🤖 Written by an agent, not Fyodor. Ping me if this looks off.