Files
moeka-project/packages/server-runtime/src/server-ws/airi/liveness.test.ts
T
nanakura dc26878386
CI / Lint (push) Canceled after 0s
CI / Build Test (stage-web) (push) Canceled after 0s
CI / Build Test (ui-loading-screens) (push) Canceled after 0s
CI / Build Test (ui-transitions) (push) Canceled after 0s
CI / Unit Test (push) Canceled after 0s
CI / Type Check (push) Canceled after 0s
CI / Check Provenance (push) Canceled after 0s
Sync Labels / sync-labels (push) Successful in 1m43s
chore: prune unused apps and services for the moeka fork
- Remove stage-tamagotchi, stage-pocket, server, and engine workspaces with their workflows, addons, and docs
- Switch the toolchain from pnpm to bun, replace lockfiles with bun.lock
- Rewrite remaining product references to Moeka
2026-09-14 16:40:49 +07:00

22 lines
840 B
TypeScript

import { describe, expect, it } from 'vitest'
import {
resolveHealthCheckIntervalMs,
serverWsDefaultHeartbeatTtlMs,
serverWsMinimumHealthCheckIntervalMs,
} from './liveness'
describe('airi websocket liveness policy', () => {
it('uses the Moeka default heartbeat TTL', () => {
expect(serverWsDefaultHeartbeatTtlMs).toBe(60_000)
expect(resolveHealthCheckIntervalMs(serverWsDefaultHeartbeatTtlMs)).toBe(12_000)
})
it('keeps health checks at least five seconds apart', () => {
expect(serverWsMinimumHealthCheckIntervalMs).toBe(5_000)
expect(resolveHealthCheckIntervalMs(1_000)).toBe(serverWsMinimumHealthCheckIntervalMs)
expect(resolveHealthCheckIntervalMs(24_999)).toBe(serverWsMinimumHealthCheckIntervalMs)
expect(resolveHealthCheckIntervalMs(25_000)).toBe(serverWsMinimumHealthCheckIntervalMs)
})
})