Skip to content

Consolidate the test suite into a single unit runner - #478

Merged
hta218 merged 1 commit into
mainfrom
cleanup/test-suite-consolidation
Sep 3, 2026
Merged

Consolidate the test suite into a single unit runner#478
hta218 merged 1 commit into
mainfrom
cleanup/test-suite-consolidation

Conversation

@hta218

@hta218 hta218 commented Sep 3, 2026

Copy link
Copy Markdown
Member

What changed

Three test runners collapsed into one, and one dead suite removed.

Removed the end-to-end cart test

tests/cart.test.ts could not pass. It drives data-test hooks that no longer exist in the app — collection-grid, product-grid, price, subtotal, close-cart (only add-to-cart and item-quantity survive). It also asserts a checkout URL on Shopify's demo store (checkout.hydrogen.shop), and its webServer serves on port 3000 while dev runs on 3456.

Deleted with it: tests/utils.ts (its only caller was that test) and playwright.config.ts (existed only to run it — and its testDir: "./tests" would also have swept the 20 unit files through Chromium). The e2e and e2e:ui scripts are gone. @playwright/test stays, since it is the unit runner.

Merged the cart-correctness suite into the unit tests

tests/cart-correctness.node.mjs ran 17 tests of exactly the same kind as tests/unit/* but under node:test with its own script, so half of cart coverage was easy to miss. Ported to tests/unit/cart-note.test.ts (node:assert to Playwright's expect, project root moved one level). The test:cart-correctness script is gone.

npm test now works

test:unit renamed to test. Previously no script was named test, so npm test returned nothing.

Verification

  • npm test193 passed (176 existing + the 17 ported), 10.0s
  • npm run biome — clean
  • npm run typecheck — clean

Typecheck first reported three Cannot find module './app/routes/api/countries.ts' errors. Pre-existing and unrelated: stale generated route types in the gitignored .react-router/, left over from when /api/countries was removed. npx react-router typegen clears them.

Note

Spec work-logs under .weaverse/specs/ reference npm run test:unit and npm run test:cart-correctness, which no longer exist. Left as-is — those files are append-only historical records.

🤖 Generated with Claude Code

The end-to-end cart test could no longer pass: it drives data-test hooks (collection-grid, product-grid, price, subtotal, close-cart) that no longer exist in the app, asserts a checkout URL on Shopify's demo store, and serves on port 3000 while dev runs on 3456. Remove it along with its price helper and the root Playwright config that only existed to run it.

Port the cart-correctness suite from node:test to the Playwright unit runner so cart coverage lives with the rest of the unit tests instead of behind a second script. Rename test:unit to test, so plain npm test runs everything: 193 tests, formerly 176 plus 17.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@hta218
hta218 merged commit f450a3d into main Sep 3, 2026
5 checks passed
@hta218
hta218 deleted the cleanup/test-suite-consolidation branch September 3, 2026 04:46
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.

1 participant