ipal-doctor: never write first-seen dates when CI is set
The CLI ignored CI (writeSeen was only !sites && !json); docs and comments already said "not in CI". shouldWriteSeen() + test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
36f8f69f82
commit
5cd0224ebd
+10
-1
@@ -6,7 +6,7 @@ import { afterAll, afterEach, beforeAll, describe, expect, test, vi } from 'vite
|
||||
|
||||
import type { DoctorConfig, DoctorReport } from '../src/modules/doctor/types.js'
|
||||
|
||||
import { expandSites, parseDoctorArgs, runDoctorCli } from '../src/modules/doctor/cli.js'
|
||||
import { expandSites, parseDoctorArgs, runDoctorCli, shouldWriteSeen } from '../src/modules/doctor/cli.js'
|
||||
import { formatDriftTable, formatReport } from '../src/modules/doctor/format.js'
|
||||
import { bareHost, parseEnvFile, readAuditSkips } from '../src/modules/doctor/project.js'
|
||||
import { planSkills } from '../src/modules/doctor/rules/agents.js'
|
||||
@@ -452,3 +452,12 @@ describe('the reference site', () => {
|
||||
for (const setting of Object.values(config.rules ?? {})) {expect(setting.reason?.trim()).toBeTruthy()}
|
||||
})
|
||||
})
|
||||
|
||||
describe('ipal-doctor: first-seen dates', () => {
|
||||
test('are written only outside CI, and never with --json or --sites', () => {
|
||||
expect(shouldWriteSeen({}, {})).toBe(true)
|
||||
expect(shouldWriteSeen({}, { CI: 'true' })).toBe(false)
|
||||
expect(shouldWriteSeen({ json: true }, {})).toBe(false)
|
||||
expect(shouldWriteSeen({ sites: 'clients/*' }, {})).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user