22 lines
640 B
TypeScript
22 lines
640 B
TypeScript
import type { AppConfig } from "../src/config.js";
|
|
|
|
export function testConfig(overrides: Partial<AppConfig> = {}): AppConfig {
|
|
return {
|
|
webhookSecret: "test-secret",
|
|
wecomWebhookUrl: "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=test-key",
|
|
maxMessageLength: 1800,
|
|
deliveryTtlSeconds: 600,
|
|
...overrides
|
|
};
|
|
}
|
|
|
|
export function testEnv(overrides: Record<string, unknown> = {}) {
|
|
return {
|
|
WEBHOOK_SECRET: "test-secret",
|
|
WECOM_WEBHOOK_URL: "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=test-key",
|
|
MAX_MESSAGE_LENGTH: "1800",
|
|
DELIVERY_TTL_SECONDS: "600",
|
|
...overrides
|
|
} as never;
|
|
}
|