feat(cli): route runtime commands and add bd diagnostics to status
This commit is contained in:
parent
654c8eb4c8
commit
34c2b7f4eb
5 changed files with 78 additions and 3 deletions
20
tests/cli/beadboard-bin-routing.test.ts
Normal file
20
tests/cli/beadboard-bin-routing.test.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import path from 'node:path';
|
||||
import { execFile } from 'node:child_process';
|
||||
import { promisify } from 'node:util';
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
const binPath = path.resolve('bin/beadboard.js');
|
||||
|
||||
test('bin routes status --json to launcher runtime command', async () => {
|
||||
try {
|
||||
const { stdout } = await execFileAsync(process.execPath, [binPath, 'status', '--json']);
|
||||
const payload = JSON.parse(stdout);
|
||||
assert.equal(payload.command, 'status');
|
||||
} catch (error) {
|
||||
const stdout = (error as { stdout?: string }).stdout || '';
|
||||
const payload = stdout ? JSON.parse(stdout) : null;
|
||||
assert.equal(payload?.command, 'status');
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue