feat(skill): wire bd mail delegate via bb shim
This commit is contained in:
parent
dcca324bfb
commit
d1b81250b2
4 changed files with 147 additions and 1 deletions
27
tests/skills/beadboard-driver/bb-mail-shim.test.ts
Normal file
27
tests/skills/beadboard-driver/bb-mail-shim.test.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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 shimPath = path.resolve('skills/beadboard-driver/scripts/bb-mail-shim.mjs');
|
||||
|
||||
test('bb-mail-shim fails with helpful error when bb is unavailable', async () => {
|
||||
await assert.rejects(
|
||||
async () => {
|
||||
await execFileAsync(process.execPath, [shimPath, 'inbox'], {
|
||||
env: {
|
||||
...process.env,
|
||||
PATH: '',
|
||||
BB_AGENT: 'silver-scribe',
|
||||
},
|
||||
});
|
||||
},
|
||||
(error: any) => {
|
||||
const stderr = String(error.stderr || '');
|
||||
assert.match(stderr, /bb command not found/i);
|
||||
return true;
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
@ -58,7 +58,7 @@ test('session-preflight succeeds with fake bd and BB_REPO', async () => {
|
|||
}
|
||||
|
||||
const result = await runPreflight({
|
||||
PATH: toolsDir,
|
||||
PATH: `${toolsDir}${path.delimiter}${process.env.PATH || ''}`,
|
||||
BB_REPO: repo,
|
||||
BB_SKILL_HOME: path.join(root, 'home'),
|
||||
BB_SKIP_PROBE: '1',
|
||||
|
|
@ -68,5 +68,7 @@ test('session-preflight succeeds with fake bd and BB_REPO', async () => {
|
|||
assert.equal(result.bb.ok, true);
|
||||
assert.equal(result.bb.source, 'env');
|
||||
assert.equal(result.tools.bd.available, true);
|
||||
assert.equal(result.mail.configured, true, JSON.stringify(result));
|
||||
assert.match(String(result.mail.delegate), /node .*bb-mail-shim\.mjs/);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue