test(skill): add bb mail lifecycle and preflight coverage
This commit is contained in:
parent
a9566059ba
commit
003aba3179
58 changed files with 402 additions and 2142 deletions
|
|
@ -12,12 +12,25 @@ const __filename = fileURLToPath(import.meta.url);
|
|||
const __dirname = path.dirname(__filename);
|
||||
const scriptPath = path.resolve(__dirname, '..', 'scripts', 'resolve-bb.mjs');
|
||||
|
||||
async function createRepoEntrypoint(repo) {
|
||||
await fs.mkdir(path.join(repo, 'tools'), { recursive: true });
|
||||
if (process.platform === 'win32') {
|
||||
const bbPath = path.join(repo, 'bb.ps1');
|
||||
await fs.writeFile(bbPath, 'echo ok', 'utf8');
|
||||
return bbPath;
|
||||
}
|
||||
const bbPath = path.join(repo, 'bin', 'beadboard.js');
|
||||
await fs.mkdir(path.dirname(bbPath), { recursive: true });
|
||||
await fs.writeFile(bbPath, '#!/usr/bin/env node\nconsole.log("ok");\n', 'utf8');
|
||||
await fs.chmod(bbPath, 0o755);
|
||||
return bbPath;
|
||||
}
|
||||
|
||||
test('resolve-bb contract: BB_REPO source', async () => {
|
||||
const root = await fs.mkdtemp(path.join(os.tmpdir(), 'bb-skill-contract-resolve-'));
|
||||
try {
|
||||
const repo = path.join(root, 'beadboard');
|
||||
await fs.mkdir(path.join(repo, 'tools'), { recursive: true });
|
||||
await fs.writeFile(path.join(repo, 'bb.ps1'), 'echo ok', 'utf8');
|
||||
await createRepoEntrypoint(repo);
|
||||
|
||||
const { stdout } = await execFileAsync(process.execPath, [scriptPath], {
|
||||
env: { ...process.env, BB_REPO: repo, BB_SKILL_HOME: path.join(root, 'home'), PATH: '' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue