fix(test): update consult tests to match current consult-mode behavior - #645
fix(test): update consult tests to match current consult-mode behavior#645diberry wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates consult-mode tests to match the SDK/CLI’s current behavior, removing fragile assertions that depended on the presence of the full squad.agent.md.template and correcting the expected global personal squad directory path.
Changes:
- SDK: Replace template-specific assertions in
setupConsultModetests with checks that work for both full-template and fallback agent generation. - CLI: Fix
init --globaltest expectation to validatepersonal-squad/creation instead of.squad/.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/sdk/consult.test.ts | Makes consult-mode agent file assertions portable across template vs fallback behavior. |
| test/cli/consult.test.ts | Updates the expected global personal squad path to personal-squad/. |
| expect(content).toContain('Coordinator Identity'); | ||
| expect(content).toContain('Team Mode'); | ||
| // Should reference local .squad/ context (present in both template and fallback) | ||
| expect(content).toContain('.squad/'); |
There was a problem hiding this comment.
The .squad/ assertion doesn’t actually validate “squad context references” because CONSULT_MODE_PREAMBLE already contains .squad/, so this will pass even if the rest of the agent template stops referencing the local squad copy. Consider asserting for a more specific path (e.g., .squad/decisions.md / .squad/team.md) or checking that the consult preamble is injected after the frontmatter delimiter(s).
| expect(content).toContain('.squad/'); | |
| expect(content).toContain('.squad/decisions.md'); |
|
@copilot apply changes based on the comments in this thread |
4ea133d to
3560404
Compare
- SDK test: Replace template-specific assertions (Coordinator Identity, Team Mode) with portable checks (preamble, .squad/ references, frontmatter). The agent file content varies depending on whether the full template is available, so tests should verify consult-mode behavior, not template availability. - CLI test: Update personal squad directory check from .squad/ to personal-squad/ to match the init --global output structure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3560404 to
be02218
Compare
|
Closing -- will re-open via fork-first pipeline when fully polished. |
Problem
consult.test.ts failures are pre-existing on dev and blocking upstream PRs #640 and #641.
Root cause
SDK test (test/sdk/consult.test.ts): The setupConsultMode test asserted template-specific content (Coordinator Identity, Team Mode) that is only present when the full squad.agent.md.template is found. When the template lookup falls back to the minimal agent file, those strings are absent.
CLI test (test/cli/consult.test.ts): The beforeEach checked for .squad/ after init --global, but the global init bootstraps personal-squad/ as the personal squad directory.
Fix
Verification
Unblocks: #640, #641
@bradygaster — test-only fix that unblocks the CI failures on PRs #640 and #641. The consult test assertions were fragile (template-specific) and the CLI test used the wrong personal squad path. No implementation changes.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com