Skip to content

test(cli): pin tasks watch monorepo discovery shape#61

Merged
fyodoriv merged 1 commit into
mainfrom
test/cli-watch-monorepo-coverage
May 3, 2026
Merged

test(cli): pin tasks watch monorepo discovery shape#61
fyodoriv merged 1 commit into
mainfrom
test/cli-watch-monorepo-coverage

Conversation

@fyodoriv
Copy link
Copy Markdown
Collaborator

@fyodoriv fyodoriv commented May 3, 2026

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:

  • `finds nested TASKS.md files` only created one nested package and asserted `>= 2` files (so a regression dropping back to 2 would still pass).
  • `excludes node_modules and .git` was its own test, separate from the multi-package case.

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

  • `npm run build` — clean
  • `npm test` — 403 tests pass (+1 new)
  • `npm run lint` — 0 errors
  • `npx -y @tasks-md/lint TASKS.md` — 0 errors

🤖 Written by an agent, not Fyodor. Ping me if this looks off.

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._
@fyodoriv fyodoriv merged commit 76b7e69 into main May 3, 2026
4 checks passed
@fyodoriv fyodoriv deleted the test/cli-watch-monorepo-coverage branch May 3, 2026 16:41
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.

1 participant