* Validate required API keys are present * Throws if TEST_INTEGRATION is set but API keys are missing
(requiredKeys)
| 70 | * Throws if TEST_INTEGRATION is set but API keys are missing |
| 71 | */ |
| 72 | function validateApiKeys(requiredKeys) { |
| 73 | if (!shouldRunIntegrationTests()) { |
| 74 | return; // Skip validation if not running integration tests |
| 75 | } |
| 76 | const missing = requiredKeys.filter((key) => !process.env[key]); |
| 77 | if (missing.length > 0) { |
| 78 | throw new Error(`Integration tests require the following environment variables: ${missing.join(", ")}\n` + |
| 79 | `Please set them or unset TEST_INTEGRATION to skip these tests.`); |
| 80 | } |
| 81 | } |
| 82 | /** |
| 83 | * Get API key from environment or throw if missing (when TEST_INTEGRATION is set) |
| 84 | */ |
no test coverage detected