mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-16 02:43:14 +03:00
65ea06ab6e
Внутренности move в cli/:
- util.mjs — out/die/json/readBody/readStdin/elapsed/elapsed2/slugify/formatDuration/xmlEscape/interpolate/printSteps/usage
- session.mjs — SESSION_FILE, loadSession, cleanup
- exec-context.mjs — buildContext, buildScopedContext, executeScript
- server.mjs — handleRequest (HTTP сервер в процессе start)
- commands/{start,run,exec,shot,stop,status,test}.mjs — по одной команде на файл
- test-runner/assertions.mjs — createAssertions (ctx.assert API)
- test-runner/severity.mjs — SEVERITY_RANK/LEVELS, buildSeverityIndex, resolveSeverity
- test-runner/reporters.mjs — writeAllure, allureStep, syncAllureExtras, buildJUnit
- test-runner/discover.mjs — discoverTests, resetState
run.mjs остался публичным entry-point с CLI-парсингом и dispatcher'ом.
Регресс tests/web-test/ зелёный (19/19, 9m 28s).
18 lines
555 B
JavaScript
18 lines
555 B
JavaScript
// web-test cli/commands/stop v1.0 — send stop to server
|
|
// Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
|
import { out } from '../util.mjs';
|
|
import { loadSession, cleanup } from '../session.mjs';
|
|
|
|
export async function cmdStop() {
|
|
const sess = loadSession();
|
|
try {
|
|
const resp = await fetch(`http://127.0.0.1:${sess.port}/stop`, { method: 'POST' });
|
|
const result = await resp.json();
|
|
out(result);
|
|
} catch {
|
|
// Server may have already exited before responding
|
|
out({ ok: true, message: 'Stopped' });
|
|
}
|
|
cleanup();
|
|
}
|