-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhermesProfile.test.ts
More file actions
63 lines (53 loc) · 2.22 KB
/
Copy pathhermesProfile.test.ts
File metadata and controls
63 lines (53 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { describe, expect, test } from 'bun:test';
import os from 'os';
import path from 'path';
import {
getGlobalHermesHome,
getHermesProfileHome,
getHermesProfileConfigPath,
getHermesSoulMdPath,
buildHermesConfigYaml,
} from './hermesProfile';
describe('hermesProfile — path helpers', () => {
test('getGlobalHermesHome returns ~/.hermes', () => {
const result = getGlobalHermesHome();
expect(result).toBe(path.join(os.homedir(), '.hermes'));
});
test('getHermesProfileHome returns ~/.hermes/profiles/{id}', () => {
const result = getHermesProfileHome('hermes-analyst');
expect(result).toBe(path.join(os.homedir(), '.hermes', 'profiles', 'hermes-analyst'));
});
test('getHermesProfileHome sanitizes unsafe chars in id', () => {
const result = getHermesProfileHome('MY AGENT!');
expect(result).not.toContain(' ');
expect(result).not.toContain('!');
});
test('getHermesProfileConfigPath', () => {
const result = getHermesProfileConfigPath('hermes-qa');
expect(result).toBe(path.join(os.homedir(), '.hermes', 'profiles', 'hermes-qa', 'config.yaml'));
});
test('getHermesSoulMdPath', () => {
const result = getHermesSoulMdPath('hermes-qa');
expect(result).toBe(path.join(os.homedir(), '.hermes', 'profiles', 'hermes-qa', 'SOUL.md'));
});
});
describe('hermesProfile — buildHermesConfigYaml', () => {
test('bare model id produces model block without provider line', () => {
const yaml = buildHermesConfigYaml('gpt-5.4-mini');
expect(yaml).toBe('model:\n default: gpt-5.4-mini\n');
});
test('provider:model syntax sets provider and default', () => {
const yaml = buildHermesConfigYaml('copilot-acp:gpt-5.4-mini');
expect(yaml).toBe('model:\n provider: copilot-acp\n default: gpt-5.4-mini\n');
});
test('openrouter:anthropic/claude-sonnet-4', () => {
const yaml = buildHermesConfigYaml('openrouter:anthropic/claude-sonnet-4');
expect(yaml).toBe('model:\n provider: openrouter\n default: anthropic/claude-sonnet-4\n');
});
test('undefined model returns empty string', () => {
expect(buildHermesConfigYaml(undefined)).toBe('');
});
test('empty string model returns empty string', () => {
expect(buildHermesConfigYaml('')).toBe('');
});
});