feat(telemetry): show first-run notice before command output

This commit is contained in:
Andrey Avtomonov 2026-05-22 16:52:01 +02:00
parent 1953466c78
commit 91772e5bce
3 changed files with 14 additions and 0 deletions

View file

@ -80,6 +80,11 @@ describe('runCommanderKtxCli telemetry', () => {
expect(statusIo.stderr()).toContain('"event":"project_stack_snapshot"');
expect(statusIo.stderr()).toContain('"connectionCount"');
expect(statusIo.stderr()).not.toContain(tempDir);
const noticeIndex = statusIo.stderr().indexOf('ktx collects anonymous usage data');
const firstTelemetryIndex = statusIo.stderr().indexOf('[telemetry]');
expect(noticeIndex).toBeGreaterThanOrEqual(0);
expect(firstTelemetryIndex).toBeGreaterThan(noticeIndex);
});
it('emits aborted telemetry when project validation aborts after preAction starts', async () => {