mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-03 08:40:52 +03:00
fix(tests): verify-snapshots понимает шаг deletePath
Шаг preRun deletePath поддерживал только runner.mjs. В платформенной проверке такой шаг проваливался в ветку запуска скрипта и падал на step.script.split, то есть кейс не проверялся вовсе, а выглядел упавшим инструментом. Шаг без script/writeFile/deletePath теперь отвергается с внятным текстом, а не падает на undefined. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
aad9956e12
commit
399e02148d
@@ -633,6 +633,16 @@ function runPreSteps(preRun, workDir, runtime, log) {
|
|||||||
log(`preRun: writeFile ${step.writeFile.path}`, true);
|
log(`preRun: writeFile ${step.writeFile.path}`, true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// deletePath step — как в runner.mjs: состояние «файла нет» выражается удалением.
|
||||||
|
// Без этой ветки шаг проваливался в запуск скрипта и падал на step.script.split.
|
||||||
|
if (step.deletePath) {
|
||||||
|
rmSync(join(workDir, step.deletePath), { recursive: true, force: true });
|
||||||
|
log(`preRun: deletePath ${step.deletePath}`, true);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!step.script) {
|
||||||
|
throw new Error(`preRun: шаг без script/writeFile/deletePath — ${JSON.stringify(step).slice(0, 120)}`);
|
||||||
|
}
|
||||||
const preArgs = [];
|
const preArgs = [];
|
||||||
for (const [flag, value] of Object.entries(step.args || {})) {
|
for (const [flag, value] of Object.entries(step.args || {})) {
|
||||||
preArgs.push(flag);
|
preArgs.push(flag);
|
||||||
|
|||||||
Reference in New Issue
Block a user