Files
cc-1c-skills/tests/common/git-step.mjs
T
Nick ShirokovandClaude Opus 5.5 ce7238792e 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
2026-09-24 18:08:20 +03:00

15 lines
748 B
JavaScript

// Шаг 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' });
}