test(runner): шаг preRun git для кейсов с репозиторием

Кейсы навыков, читающих изменения из git, строят репозиторий шагом
{ "git": [...] }. Общая реализация для runner.mjs и verify-snapshots.mjs
в tests/common/git-step.mjs — настройки машины на фикстуру не влияют.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ANXwbMUhuRFSCsq2RgmTTm
This commit is contained in:
Nick Shirokov
2026-09-24 18:08:20 +03:00
co-authored by Claude Opus 5.5
parent bd10ec08b6
commit ce7238792e
4 changed files with 31 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
// Шаг preRun `git` — общий для runner.mjs и verify-snapshots.mjs, чтобы оба раннера строили
// одинаковый репозиторий. Настройки машины не влияют: автор коммита задан, перевод строк и
// подпись коммитов выключены.
import { execFileSync } from 'child_process';
const GIT_STEP_CONFIG = [
'-c', 'user.name=test', '-c', 'user.email=test@example.com',
'-c', 'core.autocrlf=false', '-c', 'core.safecrlf=false',
'-c', 'commit.gpgsign=false', '-c', 'init.defaultBranch=main',
];
export function runGitStep(workDir, args) {
execFileSync('git', [...GIT_STEP_CONFIG, ...args], { cwd: workDir, stdio: 'pipe' });
}