mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 22:05:50 +00:00
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>
This commit is contained in:
37
src/utils/__tests__/remoteControlStatus.test.ts
Normal file
37
src/utils/__tests__/remoteControlStatus.test.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
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')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user