wishforge-ide/apps/worker/test/providers.test.ts
eust-w 4e5ab1719c ✨ Enable local Claude delivery to Gitea and POC
Add authenticated LAN access, native Claude execution, checkpoint and budget recovery, and signed POC build/deploy/rollback contracts. Include local service management, regression coverage, and evidence from the completed POC delivery.
2026-10-22 16:21:33 +08:00

26 lines
952 B
TypeScript

import { describe, expect, it } from 'vitest';
import { claudeLocalAuthHome } from '../src/providers.js';
describe('local Claude worker configuration', () => {
const env = {
WF_CLAUDE_LOCAL_AUTH_HOME: '/home/operator',
WF_DEPLOYMENT_MODE: 'development',
WF_SANDBOX_MODE: 'host',
WF_WORKER_ROLE: 'executor',
};
it('accepts only an explicitly configured development host executor', () => {
expect(claudeLocalAuthHome(env)).toBe('/home/operator');
expect(claudeLocalAuthHome({})).toBeUndefined();
for (const change of [
{ WF_DEPLOYMENT_MODE: 'production' },
{ WF_DEPLOYMENT_MODE: undefined },
{ NODE_ENV: 'production' },
{ WF_SANDBOX_MODE: 'kata' },
{ WF_WORKER_ROLE: 'verifier' },
{ WF_WORKER_ROLE: 'coordinator' },
{ WF_CLAUDE_LOCAL_AUTH_HOME: 'relative' },
])
expect(() => claudeLocalAuthHome({ ...env, ...change })).toThrow('development host executor');
});
});