test: simplify how the CLI is built for tests#232
Merged
Conversation
Tests now run against the regular development build. The test-only poll-interval override moves from a build-time TEST define to a PRISMIC_SYNC_POLL_MS environment variable, which removes the cross-env and concurrently dependencies and the MODE=test build step. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Tests always run against a fresh build: global setup builds once on startup and again before each watch-mode rerun, triggered by src changes instead of dist writes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
angeloashmore
marked this pull request as ready for review
July 22, 2026 20:13
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit aa27235. Configure here.
…tions to the test setup tsdown.config.ts now always emits a bundled, minified artifact, matching what CI publishes. The unbundled, unminified build used by tests is set directly in test/setup.global.ts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lihbr
approved these changes
Jul 22, 2026
angeloashmore
added a commit
that referenced
this pull request
Jul 22, 2026
Take main's test-build infra from #232 (CLI built in test global setup, always-minified tsdown config) and keep the evals project config on top. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Resolves:
Description
We now more efficiently build the CLI before running tests.
cross-envandconcurrentlyare replaced by a Vitest hook, where we call tsdown'sbuildfunction instead.We also remove a test-specific ternary from the code, ensuring we are testing the real public CLI.
Checklist
Preview
How to QA 1
Run
node --run unit— the suite builds the CLI itself and all 288 tests pass in ~80s. For watch mode, runnode --run unit:watch, edit a file insrc/, and confirm the CLI rebuilds and tests rerun.🤖 Generated with Claude Code
Note
Low Risk
Changes are limited to dev/test tooling and a documented env override for sync poll interval; no auth or production behavior changes beyond removing unused env flags.
Overview
Test runs now build the CLI inside Vitest instead of pre-building via
unitscripts withcross-envandconcurrently. Global setup callstsdownwith an unminified, unbundled test config, rebuilds on reruns (watch), andforceRerunTriggerswatchsrc/**rather thandist/index.mjs.unit/unit:watchare plainvitest run/vitest watch;concurrentlyandcross-envare removed from devDependencies.Production build config is simplified:
tsdownalways minifies and no longer injectsMODE/DEV/TEST—onlyPRODremains. Matching fields are dropped fromenvparsing.prismic syncpolling no longer branches on a compile-time test flag. It uses optionalPRISMIC_SYNC_POLL_MS(default 5000); E2E harness sets500for faster sync tests.Reviewed by Cursor Bugbot for commit 6e308ec. Bugbot is set up for automated code reviews on this repo. Configure here.
Footnotes
Please use these labels when submitting a review:
⚠️ #issue: Strongly suggest a change.
❓ #ask: Ask a question.
💡 #idea: Suggest an idea.
🎉 #nice: Share a compliment. ↩