Files
deepseek-harness/apps/desktop/tests/ready-port.spec.ts
T
Pine 0cdbbfbf1a feat(desktop): add Electron desktop shell over the web profile
Spawn the real dsh CLI running the web profile on loopback (OS-assigned
port), parse the printed readiness URL, and open a native window at it.
The harness and its native addons stay on the system Node ABI; the main
imports only electron and node builtins.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-14 10:23:22 +08:00

18 lines
667 B
TypeScript

import { describe, expect, it } from 'vitest'
import { parseReadyPort } from '../src/ready-port.ts'
describe('parseReadyPort', () => {
it('extracts the port from a complete readiness line', () => {
expect(parseReadyPort('dsh web: http://127.0.0.1:38291')).toBe(38291)
})
it('ignores lines without a readiness URL', () => {
expect(parseReadyPort('loading plugins…')).toBeUndefined()
expect(parseReadyPort('http://192.168.1.5:8080')).toBeUndefined()
})
it('matches the loopback URL before a LAN suffix on the same line', () => {
expect(parseReadyPort('dsh web: http://127.0.0.1:38291 (LAN: http://192.168.1.5:8080)')).toBe(38291)
})
})