mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-03 05:08:53 +00:00
test: check-docs mutant guard judges docs, not screenshot freshness
Run 2793 (changed_mutants 2/3): the clean run of `resource-docs-flatten-current-yaml` was red before any mutation because the screenshot fingerprint is stale after #490 — strict mode, which #479 reserves for the beta candidate. The guard now runs `--screenshots=warn`; a test keeps every check-docs guard in that mode. Issue: #496 User-Visible: no
This commit is contained in:
@@ -559,7 +559,10 @@ const MUTANT_DEFINITIONS = [
|
||||
},
|
||||
{
|
||||
id: 'resource-docs-flatten-current-yaml',
|
||||
guard: 'node scripts/check-docs.mjs',
|
||||
// Свежесть скриншотов — предупреждение (#479): мутант проверяет YAML-сниппет
|
||||
// README, а не отпечаток кадров; строгий режим красил чистый прогон на любом
|
||||
// src-диффе без пересъёмки (run 2793, #496).
|
||||
guard: 'node scripts/check-docs.mjs --screenshots=warn',
|
||||
because: 'the supported HA 2026.2+ resource snippet must stay nested under lovelace; '
|
||||
+ 'a plausible-looking top-level resources block is the user-facing defect from #462 AC1',
|
||||
patches: [{
|
||||
|
||||
@@ -551,3 +551,12 @@ test('#492 §6.4: реестр базы читается из git без поб
|
||||
const leftovers = (await import('node:fs')).readdirSync(join(repoRoot, 'scripts')).filter((f) => f.startsWith('.mutation-gate.base-'));
|
||||
assert.deepEqual(leftovers, [], 'временный модуль удалён');
|
||||
});
|
||||
|
||||
// #496 (run 2793): гвард на check-docs в строгом режиме красил ЧИСТЫЙ прогон на
|
||||
// любом src-диффе без пересъёмки скриншотов — свежесть кадров с #479 судится на
|
||||
// кандидате, а мутант проверяет содержимое документации.
|
||||
test('#496: гварды check-docs не требуют свежих скриншотов', () => {
|
||||
const strict = MUTANTS.filter((m) => /check-docs\.mjs/.test(m.guard) && !/--screenshots=warn/.test(m.guard));
|
||||
assert.deepEqual(strict.map((m) => m.id), []);
|
||||
assert.ok(MUTANTS.some((m) => /check-docs\.mjs --screenshots=warn/.test(m.guard)), 'хотя бы один гвард check-docs есть');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user