fix(cli): auto-install runtime during setup (#116)

* fix(cli): auto-install runtime during setup

* test: align docs smoke with readme
This commit is contained in:
Andrey Avtomonov 2026-05-16 11:39:43 +02:00 committed by GitHub
parent 42b688e934
commit a72fca2b32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 131 additions and 23 deletions

View file

@ -11,7 +11,7 @@ import {
} from '@ktx/context/ingest';
import { initKtxProject, ktxLocalStateDbPath, loadKtxProject } from '@ktx/context/project';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { type KtxIngestArgs, runKtxIngest } from './ingest.js';
import { type KtxIngestArgs, type KtxIngestDeps, runKtxIngest } from './ingest.js';
import type { KtxCliLocalIngestAdaptersOptions } from './local-adapters.js';
import {
CliLookerSlWritingAgentRunner,
@ -1108,6 +1108,7 @@ describe('runKtxIngest', () => {
completedLocalBundleRun(input, input.jobId ?? 'local-job-1'),
);
const io = makeIo();
const runtimeIo = makeIo({ isTTY: true });
await expect(
runKtxIngest(
@ -1125,6 +1126,9 @@ describe('runKtxIngest', () => {
createAdapters,
runLocalIngest: runLocal,
jobIdFactory: () => 'local-job-1',
runtimeIo: runtimeIo.io,
} as KtxIngestDeps & {
runtimeIo: typeof runtimeIo.io;
},
),
).resolves.toBe(0);
@ -1133,7 +1137,7 @@ describe('runKtxIngest', () => {
cliVersion: '0.2.0',
projectDir,
installPolicy: 'auto',
io: io.io,
io: runtimeIo.io,
};
expect(createAdapters).toHaveBeenCalledWith(
expect.objectContaining({ projectDir }),