playground-msw-tests
Installation
SKILL.md
MSW + client-js Fixtures: Primary Testing Strategy
Core Principle
Drive the real transport, mock the network.
Tests in packages/playground and packages/playground-ui MUST be written as
Vitest tests that exercise the real @mastra/client-js SDK, the real React Query
cache, and the real component/hook code paths. The only seam we mock is the
network boundary, via MSW.
This catches contract drift between the playground and @mastra/client-js at
typecheck time and at test time — something vi.mock('@/hooks/...') style tests
cannot do.
Priority Order
When you write or refactor a test for these packages, choose in this order: