When using SWR my Vue component doesn't re-fetch the data.
How can I write better unit tests to prevent this from taking down my kn cluster?
4 Replies
guiz i need help pls, my boss was already on my case about bootstrap 3 breaking prod last week
I don't have the answer but are you talking about the Vercel SWR package for caching fetches or are you talking about the caching header property.
The vercel one
For what it's worth SWR is client side so your cluster should be safe.
Test your page component with SWR mocked and test your API that SWR calls. Why test SWR, IMHO Vercel should be testing SWR. If you really want full confidence run docker with an ephemeral stack and seeded data and run cypress tests.
Test your page component with SWR mocked and test your API that SWR calls. Why test SWR, IMHO Vercel should be testing SWR. If you really want full confidence run docker with an ephemeral stack and seeded data and run cypress tests.