(test): BT5/BT6 enumerate+concurrent; decouple 2 refactor-fragile assertions - #54
Merged
Merged
Conversation
…ile assertions BT5: extend read-session-file.test.js with a 100-session + 5-subagent-subdir large-fixture test for enumerateSessionFiles. Asserts total count and that each subagent parent contributes exactly 3 children with correct filePaths. BT6: extend session-transitions.test.js with: - concurrent monitoring test: 2 independent sessions, no cross-contamination on knownSubagents state or IPC events - rewritten completion test: drives lifecycle through observable inputs using t.mock.timers fake Date (enable with now=realNow to avoid epoch=0 falsy trap) instead of directly seeding the internal _stableStart field Decouple reconcile-cache.test.js: replace fake.indexed Set (internal bookkeeping) with folderMetaCalls assertions on setFolderMeta observable seam (which folders got stamped with non-zero indexMtimeMs). Same intent, less coupling to upsertCachedSessions implementation details. test/main-ctx-db-wiring.test.js: left entirely untouched per spec.
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.
Completes the behavior-test plan (Phase BT follow-ups + the safe coupled-test loosenings).
Added (behavior tests)
read-session-file.test.js:enumerateSessionFilesover a large folder (100 sessions + 5subagents/subdirs) — asserts total count + subagent-child discovery.session-transitions.test.js: concurrent monitoring of 2 distinct sessions — each emits its own IPC events, no cross-contamination.Decoupled (refactor-resilient, same observable intent)
session-transitions.test.js: the_stableStart-seeding test rewritten to drive the lifecycle via a fakeDateclock (t.mock.timers) instead of poking private state.reconcile-cache.test.js: assertion moved off the fake DB's internalindexedSet onto the observablesetFolderMetaseam.Untouched
main-ctx-db-wiring.test.jsleft as-is — its source-regex assertion guards a witnessed silent worker crash; not weakened.195 tests, all green; suite exits cleanly (verified in the primary checkout).
Generated with Claude Code