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.
This commit is contained in:
@@ -2,7 +2,6 @@ import { describe, it, expect, beforeAll, afterAll } from 'vitest';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import os from 'node:os';
|
||||
import { MindDB, FrameStore, SessionStore } from '@waggle/core';
|
||||
import { buildLocalServer } from '../src/local/index.js';
|
||||
import type { FastifyInstance } from 'fastify';
|
||||
|
||||
@@ -14,16 +13,7 @@ import type { FastifyInstance } from 'fastify';
|
||||
*/
|
||||
|
||||
function createTmpDataDir(): string {
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'waggle-plugin-autoload-'));
|
||||
// Create personal.mind so the server can boot
|
||||
const personalPath = path.join(tmpDir, 'personal.mind');
|
||||
const mind = new MindDB(personalPath);
|
||||
const sessions = new SessionStore(mind);
|
||||
const frames = new FrameStore(mind);
|
||||
const s = sessions.create('boot-test');
|
||||
frames.createIFrame(s.gop_id, 'boot test', 'normal');
|
||||
mind.close();
|
||||
return tmpDir;
|
||||
return fs.mkdtempSync(path.join(os.tmpdir(), 'waggle-plugin-autoload-'));
|
||||
}
|
||||
|
||||
const SERVER_BOOT_TIMEOUT_MS = 30_000;
|
||||
|
||||
Reference in New Issue
Block a user