mirror of
https://github.com/stablyai/orca.git
synced 2026-11-04 11:07:42 +00:00
test: tighten relay assertions and repair benchmark checks (#33573)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user