import { describe, it, expect } from 'vitest';
import { parseFullSysCheckMessage } from './syscheck';

describe('parseFullSysCheckMessage', () => {
  it('parses JSON embedded in command output', () => {
    const msg = 'ok prefix {"generated_at":"2026-01-01T00:00:00Z","platform":"windows","network":{"external_ip":"1.2.3.4"}}';
    const r = parseFullSysCheckMessage(msg);
    expect(r?.platform).toBe('windows');
    expect(r?.network?.external_ip).toBe('1.2.3.4');
  });
});
