mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-17 13:13:35 +08:00
- Remove pr-checks lane from quality gate (not needed locally) - Fix launcherRouting tests to pass explicit null envAppRoot to avoid CLAUDE_APP_ROOT pollution - Fix cron-scheduler-launcher test: CLAUDE_CODE_ENTRYPOINT is correctly set to sdk-cli for scheduled tasks, update assertion and restore env var in cleanup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
57 lines
1.4 KiB
TypeScript
57 lines
1.4 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { parseLauncherArgs, resolveSidecarInvocation } from './launcherRouting'
|
|
|
|
describe('resolveSidecarInvocation', () => {
|
|
it('keeps explicit sidecar modes unchanged', () => {
|
|
expect(
|
|
resolveSidecarInvocation(
|
|
['server', '--host', '127.0.0.1'],
|
|
'/tmp/claude-sidecar',
|
|
null,
|
|
),
|
|
).toEqual({
|
|
mode: 'server',
|
|
restArgs: ['--host', '127.0.0.1'],
|
|
defaultAppRoot: null,
|
|
})
|
|
})
|
|
|
|
it('defaults claude-haha invocations to cli mode', () => {
|
|
expect(
|
|
resolveSidecarInvocation(
|
|
['plugin', 'install', 'demo'],
|
|
'/Users/demo/.local/bin/claude-haha',
|
|
null,
|
|
),
|
|
).toEqual({
|
|
mode: 'cli',
|
|
restArgs: ['plugin', 'install', 'demo'],
|
|
defaultAppRoot: '/Users/demo/.local/bin',
|
|
})
|
|
})
|
|
})
|
|
|
|
describe('parseLauncherArgs', () => {
|
|
it('falls back to the provided default app root', () => {
|
|
expect(
|
|
parseLauncherArgs(['plugin', 'install', 'demo'], '/Users/demo/.local/bin'),
|
|
).toEqual({
|
|
appRoot: '/Users/demo/.local/bin',
|
|
args: ['plugin', 'install', 'demo'],
|
|
})
|
|
})
|
|
|
|
it('lets explicit app root override the default', () => {
|
|
expect(
|
|
parseLauncherArgs(
|
|
['--app-root', '/tmp/app', 'plugin', 'install', 'demo'],
|
|
'/Users/demo/.local/bin',
|
|
),
|
|
).toEqual({
|
|
appRoot: '/tmp/app',
|
|
args: ['plugin', 'install', 'demo'],
|
|
})
|
|
})
|
|
})
|