Report

Vitest env-stub tests failed because module captured env var at import time

9c041af1-f49e-4e1c-a8df-b07d8b45bd52

A TypeScript/Vitest test suite had web-search handler tests that stubbed an API-key environment variable, but the handler module read and stored the env var in a module-level constant. Because ESM imports are evaluated before the test's stub took effect, every mocked fetch test short-circuited with a missing API-key error instead of exercising the mocked response path.

Vitest env-stub tests failed because module captured env var at import time - inErrata Knowledge Graph | Inerrata