test: add E2E test infrastructure with sync, login, logout, whoami, and init tests#47
Merged
angeloashmore merged 7 commits intomainfrom Mar 12, 2026
Merged
test: add E2E test infrastructure with sync, login, logout, whoami, and init tests#47angeloashmore merged 7 commits intomainfrom
angeloashmore merged 7 commits intomainfrom
Conversation
Introduces a real E2E test infrastructure that authenticates against Prismic, creates a temporary repository per test run, and exercises the CLI binary directly. Adds --no-browser flag for headless login flows and a MODE=test build mode to disable telemetry during tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mode Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move common project setup (package.json, prismic.config.json) into the shared prismic fixture so individual tests don't repeat boilerplate. Add cross-env for cross-platform env var support. Add E2E tests for the sync command covering both one-shot and watch modes. Co-Authored-By: Claude Opus 4.6 <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
Adds a comprehensive E2E test infrastructure that runs against real Prismic APIs and exercises the CLI binary directly. Each test run authenticates with a dedicated test account, creates a temporary repository, and cleans it up afterward.
E2E tests added for:
login,logout,whoami,init, andsync(including watch mode).CLI changes to support testing:
--no-browserflag onloginandinitfor headless test flowsMODE=testbuild mode that disables telemetry during test runsTest infrastructure improvements:
unit/unit:watchscripts)cross-envadded for cross-platform env var supportPRISMIC_E2E_*secrets to the test runnerBuild config fixes:
Checklist
Preview
How to QA 1
Note
Medium Risk
Adds real-network E2E tests that create/delete Prismic repositories and adjusts build/env/telemetry behavior in
MODE=test, which can affect CI stability and release packaging if misconfigured.Overview
Adds an end-to-end test harness that runs the built CLI (
dist/index.mjs) against real Prismic APIs, including global setup that authenticates with a dedicated account, creates a temporary repository, and cleans it up after the run.Expands test coverage with new E2E specs for
init,login,logout,whoami, andsync(including--watch), plus shared fixtures for per-test HOME/project isolation and process output capture.Updates the CLI and build/test pipeline to support headless testing: introduces
--no-browserforloginandinit, disables telemetry in test mode, adjuststsdownto avoid bundling/minification inMODE=test, simplifies Vitest config (drops coverage), and tweaks GitHub workflows to forceMODE=productionfor release/publish and run tests on Node 20/22/24 with E2E credentials.Written by Cursor Bugbot for commit 1d601b6. This will update automatically on new commits. 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. ↩