flnxi-Wu/license-server/lib/__tests__/env-example.test.ts
2026-05-30 18:25:51 +08:00

17 lines
697 B
TypeScript

import * as fs from 'fs';
import * as path from 'path';
describe('license-server 首装环境示例', () => {
const envExample = fs.readFileSync(path.join(__dirname, '..', '..', '.env.example'), 'utf8');
it('应该包含许可证请求签名密钥,避免 compose 首装时缺变量失败', () => {
expect(envExample).toContain('LICENSE_REQUEST_SIGNING_SECRET=');
});
it('Compose 示例数据库地址应该使用 postgres 服务名', () => {
expect(envExample).toContain('@postgres:5432/license_db?schema=main');
expect(envExample).toContain('@postgres:5432/license_db?schema=public');
expect(envExample).not.toContain('@localhost:5432/license_db?schema=');
});
});