Environment Variables Not Loading During Testing in Convex Application
My backend functions rely on environment variables (e.g., API keys, secrets, config values), and these are accessible and work fine when deployed. However, when I run tests using tools like convex-test and Vitest, it seems that the test environment doesn't automatically load or recognize the .env variables.
This is blocking me from properly testing critical parts of the application, especially those dependent on third-party services or configuration.
What I need:
A proper way to load environment variables during testing in a Convex application.
Preferably a solution that works within the Convex runtime context (not the Node.js runtime), since using Node to inject process.env breaks the Convex-specific environment expectations.
Any guidance or best practices for setting up environment-aware tests with Convex would be greatly appreciated.
