Add sunrise Threads automation and improve capture and character interactions

This commit is contained in:
2026-11-02 03:28:58 +09:00
parent ff86bdb5b5
commit 850ac84ef7
34 changed files with 900 additions and 34 deletions
+16
View File
@@ -0,0 +1,16 @@
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { loadThreadsConfig } from '../server/threads/config.ts';
test('Threads JSON sample loads with relative paths and no embedded token', () => {
const config = loadThreadsConfig(new URL('../.env.threads.sample.json', import.meta.url));
assert.equal(config.accessToken, '');
assert.equal(config.siteUrl, 'https://sunrise.horoli.kr');
assert.equal(config.imageDir, 'dist/threads-captures');
});
test('missing configuration is permitted only for capture preview', () => {
const missing = new URL('../.tmp/threads-config-does-not-exist.json', import.meta.url);
assert.throws(() => loadThreadsConfig(missing), /copy .env.threads.sample.json/);
assert.equal(loadThreadsConfig(missing, true).accessToken, '');
});