fix(ui): различать результат и отмену диагностики

This commit is contained in:
Denozordec committed 2026-10-01 04:07:08 +07:00
1 parent 8bda85129f
commit 6fa8e5bfd1
9 files changed
+132 -20

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
import { test } from "node:test"
import assert from "node:assert/strict"
import { readProbeOutput } from "./probe-response"
test("Диагностика требует подтверждённый string output",()=>{for(const raw of [null,{},[],{output:null},{output:1},{output:"ok",error:"fail"}])assert.throws(()=>readProbeOutput(raw));assert.equal(readProbeOutput({output:""}),"");assert.equal(readProbeOutput({output:"PING"}),"PING")})
test("Диагностика отклоняет legacy error и oversized output",()=>{assert.throws(()=>readProbeOutput({output:" error: отказ"}),/отказ/);assert.throws(()=>readProbeOutput({output:"x".repeat(1024*1024+1)}))})