feat: add WhatsApp config fields and IngestJobData type
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,4 +37,24 @@ describe('validateEnv', () => {
|
||||
validateEnv({ ...validEnv, DATABASE_URL: 'not-a-url' } as unknown as NodeJS.ProcessEnv),
|
||||
).toThrow('Invalid environment variables');
|
||||
});
|
||||
|
||||
it('applies default WHATSAPP_SESSION_PATH of ./sessions when not set', () => {
|
||||
const env = {
|
||||
DATABASE_URL: 'postgresql://user:pass@localhost:5432/db',
|
||||
REDIS_URL: 'redis://localhost:6379',
|
||||
JWT_SECRET: 'a'.repeat(32),
|
||||
};
|
||||
const result = validateEnv(env as NodeJS.ProcessEnv);
|
||||
expect(result.WHATSAPP_SESSION_PATH).toBe('./sessions');
|
||||
});
|
||||
|
||||
it('applies default TOWER_ADMIN_JIDS of empty string when not set', () => {
|
||||
const env = {
|
||||
DATABASE_URL: 'postgresql://user:pass@localhost:5432/db',
|
||||
REDIS_URL: 'redis://localhost:6379',
|
||||
JWT_SECRET: 'a'.repeat(32),
|
||||
};
|
||||
const result = validateEnv(env as NodeJS.ProcessEnv);
|
||||
expect(result.TOWER_ADMIN_JIDS).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user