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)}))})