Bright ideas and techniques for building with Convex.

Testing

Testing for peace of mind
Learn about best practices for testing your full-stack apps - running on Convex or elsewhere!
Ian Macartney's Profile image
Ian Macartney
8 days ago
Running tests using a local open-source backend
Convex recently released an open source version of the backend. We can use this to unit test Convex functions by running them with a local backend. These tests will work by running a backend locally, pushing your code, and using the `ConvexClient` to execute queries and mutations from your favorite testing framework and asserting on the results.
Sarah Shader's Profile image
Sarah Shader
a month ago
Seeding Data for Preview Deployments
Now that we've launched Preview Deployments on Convex, you can test out backend changes easier than ever. But you may want to seed your project with data first, so let's go over how to do that.
Ian Macartney's Profile image
Ian Macartney
5 months ago
Testing Your App: How to Generate Fake Data
Learn how to generate fake data for your dev deployments using the Faker library
Nicolas Ettlin's Profile image
Nicolas Ettlin
9 months ago
Testing React Components with Convex
Oftentimes during testing we want to mock out our backend so we can unit test our UI components without talking to our actual server code. In this article, we’ll explore options for testing React components that call Convex React hooks using mocking and dependency injection. To do this, I’ve written a sample TypeScript React app using the Vitest testing framework. The patterns presented in this post are also applicable to other JavaScript apps and frameworks.