Skip to content

fix: correct toHaveRedirect failure message in 11.test-db - #46

Closed
Davien21 wants to merge 6 commits into
epicweb-dev:mainfrom
Davien21:pr/fix-to-have-redirect-message
Closed

Davien21 wants to merge 6 commits into
epicweb-dev:mainfrom
Davien21:pr/fix-to-have-redirect-message

Conversation

@Davien21

Copy link
Copy Markdown
Contributor

Same inverted ternary as the Epic Stack (epicweb-dev/epic-stack#1104): in tests/setup/custom-matchers.ts, a missing redirect reports but got null, and a failing .not.toHaveRedirect() reports but got no redirect instead of the location.

This fixes it in all six step apps in exercises/11.test-db that share the matcher. It's a one-line swap per file; the matcher's pass/fail logic is unchanged.

Case Before After
toHaveRedirect('/login') on a 200 but got null but got no redirect
.not.toHaveRedirect() on a 302 to /dashboard but got no redirect but got "/dashboard"

@Davien21

Copy link
Copy Markdown
Contributor Author

CI fails at epicshop add because the workflow clones epicweb-dev/full-stack-testing and checks out pr/fix-to-have-redirect-message, which only exists on my fork. The change itself is the same one-line swap in six files.

kody-bot pushed a commit that referenced this pull request Oct 25, 2026
* fix: correct toHaveRedirect failure message in 11.test-db

* fix: correct toHaveRedirect failure message in 11.test-db

* fix: correct toHaveRedirect failure message in 11.test-db

* fix: correct toHaveRedirect failure message in 11.test-db

* fix: correct toHaveRedirect failure message in 11.test-db

* fix: correct toHaveRedirect failure message in 11.test-db

* fix: green CI for fork PRs and note corrected redirect matcher

Checkout the PR head and run epicshop setup so Setup works for forks
instead of cloning epicweb-dev and missing fork-only branches. Pin the
Test job to ubuntu-24.04 because Playwright 1.56.1 does not support
ubuntu26.04. Add a short learner note next to the corrected
toHaveRedirect failure message ternary.

Supersedes the follow-up needed on #46 (maintainer could not push to the
fork). Keeps Davien21's matcher fix commits.

Co-authored-by: Kent C. Dodds <[email protected]>

* fix: skip Playwright install in solution Test CI

Solution apps use vitest for npm run test; epicshop/test.js never runs
test:e2e. The with-deps Chromium install has been hanging after download
on GitHub Actions (cancelled on this PR and on recent main), so drop it.

Co-authored-by: Kent C. Dodds <[email protected]>

* fix: restore solution Test CI from #45 after epicshop overwrite

Epicshop workflow updates dropped the Node 22 Test runner, setup:custom
prep, and the completed-Vitest-only app filter from #45. Without those,
solution CI fails on Playwright-collected e2e suites and Node 26
AbortSignal/MSW issues. Restore that Test job shape; keep fork-safe Setup
and skip hung Playwright browser install.

Co-authored-by: Kent C. Dodds <[email protected]>

---------

Co-authored-by: Chidiebere Ekennia <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
@kody-bot kody-bot closed this in #47 Oct 25, 2026
@kentcdodds kentcdodds reopened this Oct 25, 2026
@kentcdodds

Copy link
Copy Markdown
Member

Thanks for this!

@kentcdodds kentcdodds closed this Oct 25, 2026
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.

2 participants