feat(mcp): подготовить сервер и доступ к приёмке

This commit is contained in:
Denozordec committed 2026-11-03 03:12:03 +07:00
commit bf3d50e1ff
3835 files changed
+537122

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
import assert from "node:assert/strict"
import {test} from "node:test"
import {readProbeSchedule} from "./probe-schedule-response"
export const probe={id:"probe-fixture",srcServerId:"1",dstServerId:"2",srcInterface:"",dstInterface:"",protocol:"tcp",direction:"both",durationSec:"10",enabled:true,lastRunAt:null,lastTxAvgMbps:0,lastRxAvgMbps:null,lastStatus:"done",lastError:null}
test("probe schedule keeps confirmed empty and nullable metrics distinct",()=>{assert.deepEqual(readProbeSchedule({probes:[]}),[]);assert.equal(readProbeSchedule({probes:[probe]})[0].lastRxAvgMbps,null);assert.equal(readProbeSchedule({probes:[probe]})[0].lastTxAvgMbps,0)})
test("probe schedule rejects incomplete/duplicate/malformed rows",()=>{for(const raw of [{},{probes:null},{probes:[{}]},{probes:[probe,probe]},{probes:[{...probe,enabled:"yes"}]},{probes:[{...probe,lastRxAvgMbps:-1}]},{probes:[{...probe,lastStatus:"unknown-status"}]},{probes:[{...probe,lastRunAt:"bad-date"}]}])assert.throws(()=>readProbeSchedule(raw))})