Files
cindy/apps/host/src/plugins-installed.test.mjs
CHEYAN 7d6d5d2e4c feat(host): list installed plugins through the shared GhostManager
The host constructs the desktop's own GhostManager with owner-scoped roots
instead of maintaining a second plugin registry, serves it at /api/ghosts, feeds
the web client's synchronous list channel from a boot prefetch, and replays it
for Electron client mode. Host suite: 43/43.

Signed-off-by: CHEYAN <me@iamcheyan.com>
2026-11-05 14:56:06 +09:00

18 lines
580 B
JavaScript

import { test } from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { listInstalledGhosts } from './plugins-installed.ts';
test('an owner without plugins lists nothing instead of failing', async () => {
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'host-ghosts-'));
try {
const ghosts = await listInstalledGhosts({ userDataDir: root, ownerId: 'owner-a' });
assert.deepEqual(ghosts, []);
} finally {
fs.rmSync(root, { recursive: true, force: true });
}
});