Files
makelore/tests/unit/asset-agent-prompt.test.ts
2026-07-29 17:22:35 +08:00

17 lines
701 B
TypeScript

import { readFile } from 'node:fs/promises';
import path from 'node:path';
import { describe, expect, it } from 'vitest';
describe('bundled game asset Agent prompt', () => {
it('searches Works Square before external asset sites with Agent-controlled paging', async () => {
const prompt = await readFile(path.resolve('.opencode/agent/assets.md'), 'utf8');
const worksSquareIndex = prompt.indexOf('https://square.nianxx.cn/api/assets');
const kenneyIndex = prompt.indexOf('Kenney');
expect(worksSquareIndex).toBeGreaterThanOrEqual(0);
expect(kenneyIndex).toBeGreaterThan(worksSquareIndex);
expect(prompt).toContain('limit');
expect(prompt).toContain('offset');
});
});