Files
claude-code/src/utils/__tests__/remoteControlStatus.test.ts
unraid fb41513b32 feat: 添加工具类增强与状态管理改进
- 新增 workflowRuns、remoteTriggerAudit、pipeStatus 等工具
- 增强 permissionSetup: auto mode 和 bypass permissions 始终可用
- 新增多组测试覆盖 (modifiers, teamDiscovery, deepLink 等)
- 修复 parseInt 缺少 radix 参数
- 移除多余 biome-ignore 注释

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-22 22:38:10 +08:00

38 lines
1.2 KiB
TypeScript

import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
import { formatRemoteControlLocalStatus } from '../remoteControlStatus'
let previousBaseUrl: string | undefined
let previousToken: string | undefined
beforeEach(() => {
previousBaseUrl = process.env.CLAUDE_BRIDGE_BASE_URL
previousToken = process.env.CLAUDE_BRIDGE_OAUTH_TOKEN
})
afterEach(() => {
if (previousBaseUrl === undefined) {
delete process.env.CLAUDE_BRIDGE_BASE_URL
} else {
process.env.CLAUDE_BRIDGE_BASE_URL = previousBaseUrl
}
if (previousToken === undefined) {
delete process.env.CLAUDE_BRIDGE_OAUTH_TOKEN
} else {
process.env.CLAUDE_BRIDGE_OAUTH_TOKEN = previousToken
}
})
describe('remote control status', () => {
test('formats self-hosted bridge local config without remote calls', () => {
process.env.CLAUDE_BRIDGE_BASE_URL = 'http://127.0.0.1:8787'
process.env.CLAUDE_BRIDGE_OAUTH_TOKEN = 'token'
const status = formatRemoteControlLocalStatus()
expect(status).toContain('Remote Control: self-hosted')
expect(status).toContain('base_url=http://127.0.0.1:8787')
expect(status).toContain('token=present')
expect(status).toContain('entitlement=checked at remote-control startup')
})
})