Files
lindyson-ai/apps/api/tests/migrationRunner.test.ts
Juno ChowandClaude Fable 5.1 f665082dad chore: 建立产品仓库,完成开源前的敏感信息清理
前端(Vite + React)、API/worker(Fastify + BullMQ)、api-contracts 契约包、
迁移脚本、测试与自托管 docker-compose 示例。

开源准备:运维脚本与机器信息已拆到私有仓库;公司名、备案号、隐私邮箱改读
publicCompliance.local.json(仓库只保留占位模板);站点地址与客服二维码改为
VITE_ 环境变量;fixtures 中的真实用户标识已匿名化;三个 package.json 标注
Apache-2.0。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-16 02:10:46 +08:00

21 lines
722 B
TypeScript

import { readFile } from 'node:fs/promises';
import { describe, expect, it } from 'vitest';
describe('数据库迁移执行器', () => {
it('只接收标准编号迁移文件并排除 AppleDouble 元数据', async () => {
const source = await readFile(
new URL('../src/db/migrate.ts', import.meta.url),
'utf8',
);
const dockerignore = await readFile(
new URL('../../../.dockerignore', import.meta.url),
'utf8',
);
expect(source).toContain(".filter(file => /^\\d{3}_[a-z0-9_]+\\.sql$/.test(file))");
expect(source).not.toContain(".filter(file => file.endsWith('.sql'))");
expect(dockerignore).toContain('._*');
expect(dockerignore).toContain('**/._*');
});
});