test: tighten relay assertions and repair benchmark checks (#33573)

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-10-25 09:26:07 -07:00
committed by GitHub
co-authored by OrcaWin
parent c074ec50da
commit 7bbdc47ec0
5 changed files with 56 additions and 46 deletions
@@ -11,6 +11,13 @@ describe('relay phone outer protocol', () => {
leaseExpiresAt: 1
}).success
).toBe(true)
expect(
RelayPhoneHelloSchema.safeParse({
type: 'relay-hello',
ok: false,
code: 4404
}).success
).toBe(true)
expect(
RelayPhoneHelloSchema.safeParse({
type: 'relay-hello',
@@ -5,8 +5,14 @@ import { parseServerShareAddress } from './server-share-address'
describe('parseServerShareAddress', () => {
it('accepts a bare hostname or IP', () => {
expect(parseServerShareAddress('my-host')).toEqual({ ok: true, value: 'my-host' })
expect(parseServerShareAddress('my-mac.tail-abcd.ts.net').ok).toBe(true)
expect(parseServerShareAddress('192.168.1.50').ok).toBe(true)
expect(parseServerShareAddress('my-mac.tail-abcd.ts.net')).toEqual({
ok: true,
value: 'my-mac.tail-abcd.ts.net'
})
expect(parseServerShareAddress('192.168.1.50')).toEqual({
ok: true,
value: '192.168.1.50'
})
})
it('rejects empty, whitespace-containing, and malformed input', () => {
-4
View File
@@ -2,10 +2,6 @@ import { describe, expect, it } from 'vitest'
import { tabHasLivePty } from './tab-has-live-pty'
describe('tabHasLivePty', () => {
it('returns false for an empty map', () => {
expect(tabHasLivePty({}, 'tab-1')).toBe(false)
})
it('returns false for a missing tab id', () => {
expect(tabHasLivePty({ 'other-tab': ['pty-1'] }, 'tab-1')).toBe(false)
})