# TESTS — F-004 Typed config and feature flags

## Unit — src/infrastructure/config/tests/config.test.ts
1. Valid full env -> typed AppConfig (port number, nodeEnv enum, flags parsed)
2. Missing DATABASE_URL -> ConfigError naming DATABASE_URL
3. Invalid PORT (non-numeric / out of range) -> ConfigError naming PORT
4. Invalid NODE_ENV -> ConfigError
5. FLAG_* true/false parsed; unknown flag value -> ConfigError naming the var
6. Multiple problems -> single ConfigError listing all of them

## Unit — src/modules/flags/tests/feature-flag-store.test.ts
1. Known flag on -> isEnabled true; known flag off -> false
2. Unknown flag -> false (fail-safe)
3. setEnabled flips state at runtime (no new store / no redeploy)
4. createFlagStore seeds initial state

## Composition
5. buildApp with flags dep: guarded path skipped when flag off, runs when on

## Manual / QA
- Start server without DATABASE_URL -> clear error naming the var, non-zero exit.
- verify.sh green.
