feat: replace browser login with imported Reddit sessions

This commit is contained in:
jjbrunton committed 2026-08-08 16:48:59 +01:00
1 parent 2b0545afcf
commit c483c7b8be
76 files changed
+2048 -2828

No files matched your search

+1 -21
View File
@@ -210,7 +210,6 @@ describe('ConfigSchema', () => {
expect(result.success).toBe(true);
if (result.success) {
expect(result.data.browser.sessionDir).toBe('./data/browser-session');
expect(result.data.browser.headless).toBe(false);
expect(result.data.browser.dryRun).toBe(false);
}
});
@@ -294,7 +293,7 @@ describe('ConfigSchema', () => {
describe('loadConfig', () => {
const originalCwd = process.cwd;
const savedEnv: Record<string, string | undefined> = {};
const trackedEnvKeys = ['OPENROUTER_API_KEY', 'REDDIT_USERNAME', 'REDDIT_PASSWORD', 'BROWSER_HEADLESS', 'WEB_DASHBOARD_TOKEN'];
const trackedEnvKeys = ['OPENROUTER_API_KEY', 'WEB_DASHBOARD_TOKEN'];
beforeEach(() => {
// Snapshot then clear any env vars that loadConfig consults — these may be
@@ -366,25 +365,6 @@ const config = loadConfig();
expect(config.openrouter.apiKey).toBe('env-key');
});
it('overrides browser headless from BROWSER_HEADLESS env var', () => {
process.env.BROWSER_HEADLESS = 'true';
const configPath = path.join(process.cwd(), 'config.yaml');
fs.writeFileSync(configPath, `
reddit:
subreddits:
- test
openrouter:
apiKey: key
imageAnalysisPrompt: analyze this
messageGenerationPrompt: write message
browser:
headless: false
`);
const config = loadConfig();
expect(config.browser.headless).toBe(true);
});
it('rejects config with invalid values', () => {
const configPath = path.join(process.cwd(), 'config.yaml');
fs.writeFileSync(configPath, `