agenthub/tests/paths.test.ts
2026-06-24 23:30:15 +02:00

18 lines
611 B
TypeScript

import { describe, it, expect } from 'vitest';
import { tmpdir } from 'os';
import { join } from 'path';
import { getAgentHubDir, getEntityDir, getCounterPath, getConfigPath, getIndexPath } from '../src/core/paths.js';
describe('paths', () => {
const cwd = tmpdir();
it('returns .agenthub directory relative to cwd', () => {
expect(getAgentHubDir(cwd)).toBe(join(cwd, '.agenthub'));
});
it('returns entity directories', () => {
expect(getEntityDir(cwd, 'tasks')).toBe(join(cwd, '.agenthub', 'tasks'));
expect(getEntityDir(cwd, 'memory')).toBe(join(cwd, '.agenthub', 'memory'));
});
});