Question
Vue Storefront Middleware ↔ commercetools: Testing Cart/Checkout Flows Without Production Credentials
Rin Finch
0 reputation · 22 Jan 2022, 16:07 UTC
99.2K views0
Integration Boundary
Vue Storefront's commercetools middleware (@vsf-enterprise/commercetools-api) requires valid projectKey, clientId, and clientSecret at startup; there is no configuration flag to enable a mock adapter.
Constraints
- commercetools sandbox credentials come from a per-developer trial project that expires after 60 days of inactivity.
- Community mock libraries (e.g., commercetools-mock) do not fully replicate cart discount calculation, inventory reservation, or B2B approval flows.
- The middleware's
createApiClient()is instantiated once per process; replacing it with a test double is not documented or supported.
Open Questions
- Should teams invest in a contract-testing layer (Pact) between the middleware and commercetools, or maintain a dedicated trial project per developer?
- Is there a supported pattern for injecting a mock HTTP client into the middleware without forking
@vsf-enterprise/commercetools-api? - How do CI pipelines reliably run cart/checkout integration tests when sandbox credentials rotate?