Hydrogen Testing framework #806
Replies: 2 comments
-
Leaning into an existing testing framework that best fits our principles (like Vitest, as we've previously mentioned) would be my preferred route. Let's minimize maintenance here to maximize quality. |
Beta Was this translation helpful? Give feedback.
-
The ability to inspect and mock both Storefront requests and requests made via If mocking/spying on cache keys is a feasible approach to support at a framework level, I could see that working very well for us! I'll list out a few test cases we'd want to be able to cover:
|
Beta Was this translation helpful? Give feedback.
-
Goal: Create an opinionated testing framework for testing hydrogen apps and react server components. Make testing hydrogen apps easy and save our users from the overhead of choosing and setting up a testing framework —which is tedious.
Some initial ideas and points for discussion:
expect(page).toDirectToCheckout()
it
,describe
, etc..., if we find we need more fine-grained control.expect(...).toHavePerformedStorefrontRequest()
and tailored to specific commerce interactionstoHaveAddedItemsToCart([...lineItems])
app
development.Alternately we could provide an easy way for apps to extend an existing testing framework.
cc @pepicrft @benjaminsehl pulling our thread here to get more 👀 and comments.
Related issues/Prs
#670
#669
#698
#800
Beta Was this translation helpful? Give feedback.
All reactions