test: adopt @doist/cli-core/testing shared helpers#6
Merged
Conversation
Replace per-file test scaffolding with the published cli-core helpers (cli-core#49): createTestProgram(register) collapses the 19 identical local createProgram() definitions to a one-line wrapper, and captureConsole(method?) replaces ~200 inline vi.spyOn(console, ...) spies plus their manual mockRestore() calls (it auto-restores via onTestFinished). Test-only change across 21 files; no runtime behaviour affected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
doistbot
reviewed
May 25, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
This PR cleanly adopts the @doist/cli-core/testing shared helpers to replace repetitive test scaffolding across the test suite. Consolidating the program creation and automating console spy cleanup significantly reduces boilerplate and improves the maintainability of the tests. No issues were flagged during the review, making this a solid improvement to the testing infrastructure!
Contributor
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
Ports the test-scaffolding dedupe from twist-cli into comms-cli. Goes straight to the published-helper end state (skipping the local-helper intermediate twist took).
Upstream PRs ported here:
test: dedupe shared test setuptest: adopt@doist/cli-core/testingshared helpersReplaces per-file scaffolding with the published cli-core helpers (cli-core#49):
createTestProgram(register)collapses the 19 identical localcreateProgram()definitions to a one-line wrapper (call sites unchanged).captureConsole(method?)replaces ~200 inlinevi.spyOn(console, …).mockImplementation(() => {})spies plus their manualmockRestore()calls — it auto-restores viaonTestFinished.Test-only change across 21 files; no runtime behaviour affected.
Test plan
npm run type-checknpm run lint:check(oxlint + oxfmt) — 0 warnings/errorsnpm test— 635 tests pass (37 files)🤖 Generated with Claude Code