← gitpulse
Merged
Size
S
Change Breakdown
New Feature50%
Configuration30%
Documentation20%
#53feat(cli): auto-load .env.local for integration tests

Integration tests now run without manual env exports

Running the Vercel Blob integration test locally now works out of the box — no need to export credentials every shell session.

The CLI's integration test suite previously required developers to manually export two environment variables — BLOB_READ_WRITE_TOKEN and GITPULSE_TEST_STORE_ID — on every shell session. This was a small but recurring friction point that slowed down local development.

A new vitest setup file handles this automatically. When a .env.local file exists in the repo root, it gets loaded before integration tests run. The path is resolved relative to the setup file itself, so working directory doesn't matter. Node 22's built-in process.loadEnvFile is used, meaning no new dependencies are added.

Importantly, environment variables that are already set — such as those injected by CI — take precedence and are not overwritten. This preserves existing CI behavior. Unit tests are unaffected since the setup file is only wired into the integration test configuration.

An .env.example file documents the required variables and provides the exact Vercel CLI commands to provision a dedicated gitpulse-local Blob store, keeping local experiments isolated from the CI store.