Consolidate the test suite into a single unit runner - #478
Merged
Conversation
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>
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.
What changed
Three test runners collapsed into one, and one dead suite removed.
Removed the end-to-end cart test
tests/cart.test.tscould not pass. It drivesdata-testhooks that no longer exist in the app —collection-grid,product-grid,price,subtotal,close-cart(onlyadd-to-cartanditem-quantitysurvive). It also asserts a checkout URL on Shopify's demo store (checkout.hydrogen.shop), and itswebServerserves on port 3000 while dev runs on 3456.Deleted with it:
tests/utils.ts(its only caller was that test) andplaywright.config.ts(existed only to run it — and itstestDir: "./tests"would also have swept the 20 unit files through Chromium). Thee2eande2e:uiscripts are gone.@playwright/teststays, since it is the unit runner.Merged the cart-correctness suite into the unit tests
tests/cart-correctness.node.mjsran 17 tests of exactly the same kind astests/unit/*but undernode:testwith its own script, so half of cart coverage was easy to miss. Ported totests/unit/cart-note.test.ts(node:assertto Playwright'sexpect, project root moved one level). Thetest:cart-correctnessscript is gone.npm testnow workstest:unitrenamed totest. Previously no script was namedtest, sonpm testreturned nothing.Verification
npm test— 193 passed (176 existing + the 17 ported), 10.0snpm run biome— cleannpm run typecheck— cleanTypecheck 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/countrieswas removed.npx react-router typegenclears them.Note
Spec work-logs under
.weaverse/specs/referencenpm run test:unitandnpm run test:cart-correctness, which no longer exist. Left as-is — those files are append-only historical records.🤖 Generated with Claude Code