feat(ops): add setup operator pack, heartbeat alert cooldown, and doctor strict mode
This commit is contained in:
+17
-1
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user