Files
waggle-os/packages/server/tests/behavioral-spec-active.test.ts
shumeiko.it 6573f817b0 test(server): stop seeding a legacy personal mind (P1.5)
The server no longer opens personal.mind, so tests build it on an empty
data directory. The /memory command test seeds its two memories through
server.memory and now checks that the seeded text is found.
2026-10-24 17:43:11 +02:00

31 lines
1017 B
TypeScript

import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { BEHAVIORAL_SPEC } from '@waggle/agent';
import { buildLocalServer } from '../src/local/index.js';
import type { FastifyInstance } from 'fastify';
describe('activeBehavioralSpec integration', () => {
let tmpDir: string;
beforeAll(() => {
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'waggle-active-spec-'));
});
afterAll(() => {
try { fs.rmSync(tmpDir, { recursive: true, force: true }); } catch { /* ignore */ }
});
it('serves the compiled behavioral spec baseline', async () => {
const server = await buildLocalServer({ dataDir: tmpDir });
try {
expect(server.activeBehavioralSpec).toBeDefined();
expect(server.activeBehavioralSpec.rules).toBe(BEHAVIORAL_SPEC.rules);
expect(server.activeBehavioralSpec.coreLoop).toBe(BEHAVIORAL_SPEC.coreLoop);
} finally {
await server.close();
}
});
});