Skip to content

fix(e2e): run Basic Auth tests against Vite preview - #8056

Open
zfaustk wants to merge 2 commits into
TanStack:mainfrom
zfaustk:fix/basic-auth-e2e-server
Open

fix(e2e): run Basic Auth tests against Vite preview#8056
zfaustk wants to merge 2 commits into
TanStack:mainfrom
zfaustk:fix/basic-auth-e2e-server

Conversation

@zfaustk

@zfaustk zfaustk commented Aug 12, 2026

Copy link
Copy Markdown

Fixes #7798

The Basic Auth E2E package now starts its built application through the current TanStack Start Vite preview adapter on Playwright's assigned port. The issue originally suggested executing dist/server/server.js directly, but that artifact now exports a Fetch handler and exits without listening; vite preview is the project-native adapter that serves the same production build.

This also removes the leading exit 0 so the E2E script actually invokes Playwright.

Validation:

  • playwright test tests/app.spec.ts --project=chromium --grep "Posts redirects to login when not authenticated" — passed (1/1)
  • CI=1 NX_DAEMON=false pnpm nx run tanstack-react-start-e2e-basic-auth:build --outputStyle=stream --skipRemoteCache — passed with 19 dependency tasks
  • prettier --check e2e/react-start/basic-auth/package.json — passed
  • git diff --check — passed
  • pnpm test:eslint, pnpm test:types, and pnpm test:unit — no tasks apply to this private E2E package

The full Basic Auth suite is currently blocked before test execution by existing Prisma 7 setup/teardown files importing PrismaClient from the @prisma/client CommonJS stub. I reproduced the same discovery failure on the clean base with this script change removed, so it is outside this focused fix.

No changeset is included because this only repairs scripts in a private E2E package and does not change a published package.

I used Codex to help inspect the repository and run the validation. I reviewed and adapted the final change; no separate human review was performed.

Summary by CodeRabbit

  • Bug Fixes
    • Enabled end-to-end testing for the React starter example.
    • Updated the preview server to run on the configured port and local address.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d588d678-ef75-4019-8ad6-60996ebe2651

📥 Commits

Reviewing files that changed from the base of the PR and between 158fe6a and 117bb95.

📒 Files selected for processing (1)
  • e2e/react-start/basic-auth/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • e2e/react-start/basic-auth/package.json

📝 Walkthrough

Walkthrough

The Basic Auth E2E package now serves the Vite build through vite preview on loopback using $PORT. Its test:e2e script now runs cleanup, Prisma generation, and Playwright tests.

Changes

Basic Auth E2E execution

Layer / File(s) Summary
Configure server startup and E2E execution
e2e/react-start/basic-auth/package.json
The start script uses vite preview on 127.0.0.1 with $PORT. The test:e2e script runs cleanup, Prisma generation, and Playwright test steps.

Estimated code review effort: 2 (Simple) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Basic Auth E2E fix and the use of the Vite preview.
Linked Issues check ✅ Passed The changes start the Vite-built server with vite preview and allow Playwright tests to run, meeting issue #7798.
Out of Scope Changes check ✅ Passed The changes are limited to the Basic Auth E2E package scripts and directly support issue #7798.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/react-start/basic-auth/package.json`:
- Line 11: Update the "start" script to add Vite’s --strictPort option to the
vite preview command, ensuring it exits when the assigned $PORT is unavailable
instead of selecting another port.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f5ca99b0-f591-4c9e-9efa-b5c61443a8ab

📥 Commits

Reviewing files that changed from the base of the PR and between 3848503 and 158fe6a.

📒 Files selected for processing (1)
  • e2e/react-start/basic-auth/package.json

Comment thread e2e/react-start/basic-auth/package.json Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(e2e): start Basic Auth tests from the Vite build output

1 participant