feat(ops): add setup operator pack, heartbeat alert cooldown, and doctor strict mode

This commit is contained in:
William Valentin
2026-02-16 14:57:56 -08:00
parent 030fb13a26
commit 3210e75c94
12 changed files with 274 additions and 17 deletions
+17 -1
View File
@@ -1,5 +1,5 @@
import { describe, it, expect, afterEach } from 'vitest';
import { runChecks, type CheckResult, type DoctorContext } from './doctor.js';
import { computeDoctorExitCode, runChecks, type CheckResult, type DoctorContext } from './doctor.js';
import { writeFileSync, mkdirSync, rmSync } from 'fs';
import { join } from 'path';
import { tmpdir } from 'os';
@@ -11,6 +11,22 @@ describe('doctor checks', () => {
try { rmSync(testDir, { recursive: true }); } catch {}
});
it('computeDoctorExitCode returns 0 with warnings in non-strict mode', () => {
const results: CheckResult[] = [
{ status: 'pass', label: 'a' },
{ status: 'warn', label: 'b' },
];
expect(computeDoctorExitCode(results, false)).toBe(0);
});
it('computeDoctorExitCode returns 1 with warnings in strict mode', () => {
const results: CheckResult[] = [
{ status: 'pass', label: 'a' },
{ status: 'warn', label: 'b' },
];
expect(computeDoctorExitCode(results, true)).toBe(1);
});
it('reports PASS when config file exists and is valid', async () => {
mkdirSync(testDir, { recursive: true });
const configPath = join(testDir, 'config.yaml');