mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-06 11:40:20 +03:00
chore(tests): --help в runner и verify-snapshots, синхронизация README
Чтобы --help/-h/? не запускали полный прогон тестов. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
76800fc92b
commit
fc19df604b
@@ -23,11 +23,30 @@ const REPORT_DIR = resolve(REPO_ROOT, 'debug/snapshot-verify');
|
||||
|
||||
// ─── CLI args ───────────────────────────────────────────────────────────────
|
||||
|
||||
function printHelp() {
|
||||
console.log(`verify-snapshots — Platform verification of skill test snapshots
|
||||
|
||||
Reruns skill scripts from test-case DSL, then loads results into 1C platform.
|
||||
|
||||
Usage:
|
||||
node tests/skills/verify-snapshots.mjs [options]
|
||||
|
||||
Options:
|
||||
--skill <name> Run only cases for the given skill (e.g. form-compile)
|
||||
--case <name> Run only the case with this name
|
||||
--runtime <ps|python> Which script port to run (default: powershell)
|
||||
--keep Keep generated work directories on disk after run
|
||||
-v, --verbose Verbose output
|
||||
-h, --help, /? Show this help and exit
|
||||
`);
|
||||
}
|
||||
|
||||
function parseArgs(argv) {
|
||||
const args = { skill: null, caseName: null, runtime: 'powershell', keep: false, verbose: false };
|
||||
const args = { skill: null, caseName: null, runtime: 'powershell', keep: false, verbose: false, help: false };
|
||||
const rest = argv.slice(2);
|
||||
for (let i = 0; i < rest.length; i++) {
|
||||
const a = rest[i];
|
||||
if (a === '-h' || a === '--help' || a === '/?' || a === '/help' || a === '?') { args.help = true; continue; }
|
||||
if (a === '--skill' && rest[i + 1]) { args.skill = rest[++i]; continue; }
|
||||
if (a === '--case' && rest[i + 1]) { args.caseName = rest[++i]; continue; }
|
||||
if (a === '--runtime' && rest[i + 1]) { args.runtime = rest[++i]; continue; }
|
||||
@@ -1034,6 +1053,7 @@ function writeReport(results) {
|
||||
|
||||
async function main() {
|
||||
const opts = parseArgs(process.argv);
|
||||
if (opts.help) { printHelp(); return; }
|
||||
|
||||
const v8ctx = loadV8Context();
|
||||
if (!v8ctx) {
|
||||
|
||||
Reference in New Issue
Block a user