mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-11-06 12:51:54 +00:00
Merge pull request #339 from PR0M3TH3AN/feature/init-dashboard-file-config-hashtag-4189892407545080483
Generate TORCH_DASHBOARD.md and expose hashtag in config during init
This commit is contained in:
2 files changed
+52
-4
No files matched your search
@@ -8,6 +8,7 @@ import { cmdInit, cmdUpdate } from '../src/ops.mjs';
|
||||
const MOCK_CONFIG = {
|
||||
installDir: 'torch',
|
||||
namespace: 'test-namespace',
|
||||
hashtag: 'test-hashtag',
|
||||
relays: ['wss://relay.damus.io']
|
||||
};
|
||||
|
||||
@@ -32,6 +33,14 @@ test('cmdInit creates directory structure and files', async () => {
|
||||
// Check content transformation
|
||||
const metaPrompts = fs.readFileSync(path.join(torchDir, 'META_PROMPTS.md'), 'utf8');
|
||||
assert.ok(metaPrompts.includes('torch/prompts/daily/'), 'paths replaced in META_PROMPTS');
|
||||
|
||||
// Check Dashboard file
|
||||
const dashboardPath = path.join(torchDir, 'TORCH_DASHBOARD.md');
|
||||
assert.ok(fs.existsSync(dashboardPath), 'TORCH_DASHBOARD.md created');
|
||||
const dashboardContent = fs.readFileSync(dashboardPath, 'utf8');
|
||||
assert.ok(dashboardContent.includes('test-hashtag'), 'Dashboard content contains hashtag');
|
||||
assert.ok(dashboardContent.includes('test-namespace'), 'Dashboard content contains namespace');
|
||||
assert.ok(dashboardContent.includes('https://torch.thepr0m3th3an.net/dashboard/'), 'Dashboard content contains link');
|
||||
});
|
||||
|
||||
test('cmdInit fails if directory exists without force', async () => {
|
||||
@@ -152,4 +161,5 @@ test('cmdInit creates torch-config.json with random namespace', async () => {
|
||||
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||||
assert.strictEqual(config.nostrLock.namespace, 'test-namespace', 'Namespace should match mock');
|
||||
assert.strictEqual(config.dashboard.hashtag, 'test-hashtag', 'Hashtag should match mock');
|
||||
});
|
||||
Reference in new issue
Block a user