Skip to content

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

Merged
kody-bot merged 9 commits into
mainfrom
cursor/fix-to-have-redirect-ci-2edf
Oct 25, 2026
Merged

kody-bot merged 9 commits into
mainfrom
cursor/fix-to-have-redirect-ci-2edf

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #46 by @Davien21 (Chidiebere Ekennia). This branch keeps their matcher commits and adds CI + learner-note follow-ups so we can ship.

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. 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"

Also:

  • Short learner-facing comment next to the fixed ternary (videos show the swapped order).
  • CI: Setup now checks out the PR head and runs epicshop setup (fork branches are not on epicweb-dev, so epicshop add repo#branch failed on fix: correct toHaveRedirect failure message in 11.test-db #46).
  • CI: Test job pinned to ubuntu-24.04 because Playwright 1.56.1 does not support chromium on ubuntu26.04 (ubuntu-latest).

Unable to push onto the fork PR branch (no write access to Davien21/full-stack-testing despite maintainer_can_modify), so this PR supersedes #46 while preserving contributor commits.

Test plan

Open in Web Open in Cursor 

Note

Low Risk
Matcher changes only affect test failure text; CI changes target fork PRs and test runner stability without touching deploy or production paths.

Reviewed by Cursor Bugbot for commit 6ef797d. Bugbot is set up for automated code reviews on this repo. Configure here.

Davien21 and others added 9 commits October 25, 2026 04:42
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]>
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]>
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]>
@kody-bot
kody-bot merged commit 4bfd412 into main Oct 25, 2026
6 checks passed
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.

4 participants