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
feat(tests): add case-insensitive env Proxy for Windows compatibility
Implement createEnvProxy() helper that provides:
1. **Live environment in tests**: In VITEST mode, constants.processEnv
is a Proxy that always reads from process.env (not a snapshot)
2. **Case-insensitive access**: Handles PATH, TEMP, HOME, etc. with
any casing (PATH vs Path vs path) to match Windows behavior
3. **Smart priority**:
- Overrides (spawnEnv) take precedence
- Exact key matches in base env
- Case-insensitive fallback for known Windows vars
4. **Proper Proxy handlers**:
- get: Handles lookups with case fallback
- ownKeys: Merges all keys from base + overrides
- getOwnPropertyDescriptor: Returns proper descriptors
- has: Case-insensitive membership checks
- set: Allows setting overrides
Benefits:
- No more snapshot vs live env issues
- Windows case-sensitivity handled properly
- Works seamlessly with socket-lib@1.3.5 fix
- Tests stay consistent across platforms
0 commit comments