// 已读取AGENTS.md import * as fs from 'fs'; import * as path from 'path'; /** * 第五十批回归闸门:大神收益统计不得跨大神串算 */ describe('第五十批大神收益统计范围闸门', () => { const rootDir = path.resolve(__dirname, '../../'); const repoCode = fs.readFileSync(path.join(rootDir, 'server/src/db/repository.ts'), 'utf-8'); it('不得再用 companion_name LIKE 匹配聚合作弊式占位名', () => { expect(repoCode).not.toContain("'%我%'"); expect(repoCode).not.toContain('OR companion_name LIKE ?'); }); it('收益汇总与走势只按 expert_id 统计', () => { const stats = repoCode.slice(repoCode.indexOf('async getExpertStats('), repoCode.indexOf('async getExpertStats(') + 600); expect(stats).toContain('WHERE expert_id = ?'); const trends = repoCode.slice(repoCode.indexOf('async getExpertRevenueTrends(')); expect(trends.slice(0, 4000)).toContain('WHERE expert_id = ?'); }); });