import { afterEach, describe, expect, test, vi } from 'vitest'; const load = async () => { vi.resetModules(); process.env.SPOON_WORKER_TOKEN = 'test-worker-token'; process.env.GITHUB_APP_ID = '123'; process.env.GITHUB_APP_PRIVATE_KEY = '-----BEGIN PRIVATE KEY-----\ntest\n-----END PRIVATE KEY-----'; process.env.SPOON_AGENT_WORKDIR = '/work'; return await import('../../src/box'); }; describe('boxHomePaths', () => { afterEach(() => vi.resetModules()); test('derives the per-user home dir and container home', async () => { const { boxHomePaths } = await load(); const paths = boxHomePaths('gib'); expect(paths.homeDir.endsWith('homes/gib')).toBe(true); expect(paths.containerHome).toBe('/home/gib'); }); test('distinct usernames produce distinct home dirs', async () => { const { boxHomePaths } = await load(); expect(boxHomePaths('gib').homeDir).not.toBe( boxHomePaths('other').homeDir, ); }); });