fix(cli): clarify skill scope and stabilize Node 22 tests
Require the bootstrap agent to ask whether the skill should be installed locally or globally, and suppress only SQLite’s ExperimentalWarning in CLI test processes.
This commit is contained in:
@@ -21,6 +21,10 @@ test('root SKILL.md bootstraps the CLI before installing the official skill', ()
|
||||
assert.match(source, /install\.sh/);
|
||||
assert.match(source, /obelisk --version/);
|
||||
assert.match(source, /obelisk install/);
|
||||
assert.match(source, /defaults to the current project/i);
|
||||
assert.match(source, /ask whether .*should be\s+installed/is);
|
||||
assert.match(source, /obelisk install --global/);
|
||||
assert.match(source, /Do not silently choose the current-project default/);
|
||||
assert.doesNotMatch(source, /obelisk --query/);
|
||||
});
|
||||
|
||||
|
||||
@@ -30,6 +30,24 @@ test('obelisk --version reports the installed CLI package version', () => {
|
||||
assert.equal(result.stderr, '');
|
||||
});
|
||||
|
||||
test('CLI test process suppresses only Node ExperimentalWarning output', () => {
|
||||
const home = mkdtempSync(join(tmpdir(), 'obelisk-cli-warning-'));
|
||||
const preload = join(home, 'warnings.cjs');
|
||||
writeFileSync(preload, `
|
||||
process.emitWarning('simulated SQLite warning', 'ExperimentalWarning');
|
||||
process.emitWarning('ordinary warning stays visible', 'ObeliskTestWarning');
|
||||
`);
|
||||
|
||||
const result = runCli(['--version'], {
|
||||
home,
|
||||
env: { NODE_OPTIONS: `--require=${preload}` },
|
||||
});
|
||||
|
||||
assert.equal(result.status, 0, result.stderr || result.stdout);
|
||||
assert.doesNotMatch(result.stderr, /simulated SQLite warning/);
|
||||
assert.match(result.stderr, /ordinary warning stays visible/);
|
||||
});
|
||||
|
||||
test('obelisk install delegates official skill installation to the skills CLI', () => {
|
||||
const home = mkdtempSync(join(tmpdir(), 'obelisk-cli-install-'));
|
||||
const fakeBin = join(home, 'bin');
|
||||
|
||||
@@ -6,7 +6,11 @@ export const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
export const cliEntry = join(repoRoot, 'packages', 'cli', 'dist', 'cli', 'src', 'obelisk.js');
|
||||
|
||||
export function runCli(args, { home, env = {}, cwd = repoRoot } = {}) {
|
||||
return spawnSync(process.execPath, [cliEntry, ...args], {
|
||||
return spawnSync(process.execPath, [
|
||||
'--disable-warning=ExperimentalWarning',
|
||||
cliEntry,
|
||||
...args,
|
||||
], {
|
||||
cwd,
|
||||
env: {
|
||||
...process.env,
|
||||
|
||||
Reference in New Issue
Block a user