This commit is contained in:
Oleg Maslov
2026-09-02 10:14:22 +02:00
parent 0c3e2ead3b
commit b20b138fe4
771 changed files with 161561 additions and 9027 deletions

View File

@@ -171,6 +171,18 @@ describe('cli dispatch', () => {
expect(parsed.entitiesCreated + 0).toBeGreaterThan(0);
});
it.each([
['since', 'bogus'],
['limit', 'also-bogus'],
])('cognify rejects an invalid --%s value', async (key, value) => {
await expect(dispatch({
subcommand: 'cognify',
values: { [key]: value },
positionals: [],
env,
})).rejects.toThrow(new RegExp(`${key}.*safe integer`, 'i'));
});
it('compile-wiki runs against the real core + wiki-compiler (echo synthesizer)', async () => {
// No ANTHROPIC_API_KEY / OLLAMA_URL in the test env → echo fallback.
delete process.env.ANTHROPIC_API_KEY;
@@ -212,6 +224,15 @@ describe('cli dispatch', () => {
expect(parsed.durationMs).toBeGreaterThanOrEqual(0);
});
it('rejects a malformed supplied consolidate limit instead of using the default', async () => {
await expect(dispatch({
subcommand: 'maintenance',
values: { consolidate: true, 'consolidate-limit': 'abc' },
positionals: [],
env,
})).rejects.toThrow(/consolidate-limit.*1.*400/i);
});
it('dispatches a scoped WaggleDance message with the run credential header', async () => {
process.env.WAGGLE_DANCE_URL = 'http://127.0.0.1:3333';
process.env.WAGGLE_RUN_TOKEN = 'run-token-with-enough-entropy-123456789';