mirror of
https://github.com/openclaw/lobster.git
synced 2026-08-14 00:48:09 +00:00
27 lines
852 B
TypeScript
27 lines
852 B
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { createDefaultRegistry } from '../src/commands/registry.js';
|
|
|
|
function streamOf(items) {
|
|
return (async function* () {
|
|
for (const item of items) yield item;
|
|
})();
|
|
}
|
|
|
|
test('workflows.list returns known workflows', async () => {
|
|
const registry = createDefaultRegistry();
|
|
const cmd = registry.get('workflows.list');
|
|
|
|
const res = await cmd.run({
|
|
input: streamOf([]),
|
|
args: { _: [] },
|
|
ctx: { stdin: process.stdin, stdout: process.stdout, stderr: process.stderr, env: process.env, registry, mode: 'tool', render: { json() {}, lines() {} } },
|
|
});
|
|
|
|
const items = [];
|
|
for await (const it of res.output) items.push(it);
|
|
|
|
const names = items.map((x) => x.name).sort();
|
|
assert.deepEqual(names, ['github.pr.monitor', 'github.pr.monitor.notify']);
|
|
});
|