mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-21 07:21:54 +03:00
refactor: move broken fixtures into skill directory, remove global fixtures/
fixture: paths now resolve relative to skill's cases/ dir, not global. Each validate skill keeps its broken fixtures locally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
671be7c6b5
commit
74b3f76a32
@@ -15,7 +15,6 @@ const REPO_ROOT = resolve(ROOT, '../..');
|
||||
const SKILLS = resolve(REPO_ROOT, '.claude/skills');
|
||||
const CASES = resolve(ROOT, 'cases');
|
||||
const CACHE = resolve(ROOT, '.cache');
|
||||
const FIXTURES = resolve(ROOT, 'fixtures');
|
||||
|
||||
// ─── CLI args ───────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -80,11 +79,12 @@ function discoverCases(filter) {
|
||||
|
||||
// ─── Setup / Fixtures ───────────────────────────────────────────────────────
|
||||
|
||||
function ensureSetup(setupName, runtime) {
|
||||
function ensureSetup(setupName, runtime, skillCasesDir) {
|
||||
if (setupName === 'none' || !setupName) return null;
|
||||
|
||||
if (setupName.startsWith('fixture:')) {
|
||||
const fixturePath = join(FIXTURES, setupName.slice('fixture:'.length));
|
||||
// Resolve relative to skill's cases directory (e.g. cases/meta-validate/fixtures/...)
|
||||
const fixturePath = join(skillCasesDir, 'fixtures', setupName.slice('fixture:'.length));
|
||||
if (!existsSync(fixturePath)) throw new Error(`Fixture not found: ${fixturePath}`);
|
||||
return fixturePath;
|
||||
}
|
||||
@@ -331,7 +331,8 @@ function runCase(testCase, opts) {
|
||||
|
||||
try {
|
||||
// 1. Setup workspace
|
||||
const fixturePath = ensureSetup(setupName, opts.runtime);
|
||||
const skillCasesDir = join(CASES, testCase.skillDir);
|
||||
const fixturePath = ensureSetup(setupName, opts.runtime, skillCasesDir);
|
||||
workDir = createWorkspace(fixturePath);
|
||||
|
||||
// 2. Pre-run steps (setup prerequisites like creating objects)
|
||||
|
||||
Reference in New Issue
Block a user