You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cloudinary.ts calls dotenv.config() when it loads. The services setup imports every model, user.model.ts imports cloudinary.ts, and so local test runs load backend/.env.
With the Upstash values from .env, cache.ts builds a real client. unit.service.test.ts calls fetchMostReviewed, which reads the units:popular key and, on a miss, writes the test database's units to it for a week.
If .env holds the production credentials, a local test run can put test data in the live site's popular units list. CI has no .env, so it never hits this.
The model imports run before the setup file's body, so dotenv has already loaded .env by then. Assign the empty values in the body: they overwrite the loaded ones before any test file imports cache.ts. No model imports cache.ts.
Cloudinary and Gemini keys load the same way. Blank those too unless a test needs them.
What
Why
dotenv.config()when it loads. The services setup imports every model, user.model.ts imports cloudinary.ts, and so local test runs load backend/.env.fetchMostReviewed, which reads theunits:popularkey and, on a miss, writes the test database's units to it for a week.Area
backend
Notes or constraints