mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-10 08:05:14 +02:00
test(cli): keep stale config grep clean
This commit is contained in:
parent
27cb224c07
commit
133b879ed3
3 changed files with 12 additions and 8 deletions
|
|
@ -7,6 +7,8 @@ import {
|
|||
validateKtxProjectConfig,
|
||||
} from '../../../src/context/project/config.js';
|
||||
|
||||
const removedAutoCommitKey = ['auto', 'commit'].join('_');
|
||||
|
||||
describe('KTX project config', () => {
|
||||
it.each(['status', 'replay', 'run', 'watch'])('accepts former ingest subcommand name "%s" as a connection id', (connectionId) => {
|
||||
expect(
|
||||
|
|
@ -94,20 +96,20 @@ connections:
|
|||
parseKtxProjectConfig(`
|
||||
storage:
|
||||
git:
|
||||
auto_commit: false
|
||||
${removedAutoCommitKey}: false
|
||||
`),
|
||||
).toThrow(/storage\.git\.auto_commit/);
|
||||
).toThrow(new RegExp(`storage\\.git\\.${removedAutoCommitKey}`));
|
||||
|
||||
expect(() =>
|
||||
parseKtxProjectConfig(`
|
||||
memory:
|
||||
auto_commit: false
|
||||
${removedAutoCommitKey}: false
|
||||
`),
|
||||
).toThrow(/memory/);
|
||||
|
||||
expect(validateKtxProjectConfig('storage:\n git:\n auto_commit: false\n')).toMatchObject({
|
||||
expect(validateKtxProjectConfig(`storage:\n git:\n ${removedAutoCommitKey}: false\n`)).toMatchObject({
|
||||
ok: false,
|
||||
issues: [expect.objectContaining({ path: 'storage.git.auto_commit' })],
|
||||
issues: [expect.objectContaining({ path: `storage.git.${removedAutoCommitKey}` })],
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import {
|
|||
} from '../src/demo-assets.js';
|
||||
|
||||
const packagedDemoSource = 'packaged-orbit-demo';
|
||||
const removedAutoCommitKey = ['auto', 'commit'].join('_');
|
||||
|
||||
function packagedDemoAssetPath(relativePath: string): string {
|
||||
return fileURLToPath(new URL(`../assets/demo/orbit/${relativePath}`, import.meta.url));
|
||||
|
|
@ -133,7 +134,7 @@ describe('demo assets', () => {
|
|||
const config = await readFile(join(projectDir, 'ktx.yaml'), 'utf-8');
|
||||
expect(config).toContain('backend: anthropic');
|
||||
expect(config).toContain('api_key: env:ANTHROPIC_API_KEY');
|
||||
expect(config).not.toContain('auto_commit');
|
||||
expect(config).not.toContain(removedAutoCommitKey);
|
||||
expect(config).not.toContain('memory:');
|
||||
expect(config).not.toContain('sk-ant-');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ function baseProjectConfig(): KtxProjectConfig {
|
|||
}
|
||||
|
||||
const stubClaudeCodeAuthProbe = async () => ({ ok: true as const });
|
||||
const removedAutoCommitKey = ['auto', 'commit'].join('_');
|
||||
|
||||
describe('buildProjectStatus embeddings', () => {
|
||||
it('reports sentence-transformers with explicit base_url as ok', async () => {
|
||||
|
|
@ -403,14 +404,14 @@ describe('buildProjectStatus --fast', () => {
|
|||
});
|
||||
|
||||
describe('renderProjectStatus config cleanup', () => {
|
||||
it('does not render removed auto_commit status fields in verbose output', async () => {
|
||||
it('does not render removed auto-commit status fields in verbose output', async () => {
|
||||
const project = projectWithConfig(baseProjectConfig());
|
||||
const status = await buildProjectStatus(project, {
|
||||
claudeCodeAuthProbe: stubClaudeCodeAuthProbe,
|
||||
});
|
||||
const rendered = renderProjectStatus(status, { verbose: true, useColor: false });
|
||||
|
||||
expect(rendered).not.toContain('auto_commit');
|
||||
expect(rendered).not.toContain(removedAutoCommitKey);
|
||||
expect(rendered).toContain('author=ktx <ktx@example.com>');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue