add a mastodon test command

This commit is contained in:
kitt 2022-12-30 23:00:12 -05:00
parent ef6e8c1b0d
commit cef8551a35
No known key found for this signature in database
3 changed files with 7 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import cron from './cron.mjs';
import { sendStatuses, testStatuses } from './social/index.mjs'; import { sendStatuses, testStatuses } from './social/index.mjs';
import { updateAll } from './data/index.mjs'; import { updateAll } from './data/index.mjs';
import { warmCaches } from "./splatnet/index.mjs"; import { warmCaches } from "./splatnet/index.mjs";
import MastodonClient from './social/clients/MastodonClient.mjs';
consoleStamp(console); consoleStamp(console);
dotenv.config(); dotenv.config();
@ -12,6 +13,7 @@ const actions = {
cron, cron,
social: sendStatuses, social: sendStatuses,
socialTest: testStatuses, socialTest: testStatuses,
socialTestMastodon: () => testStatuses([new MastodonClient]),
splatnet: updateAll, splatnet: updateAll,
warmCaches, warmCaches,
} }

View File

@ -34,10 +34,10 @@ export function defaultStatusGeneratorManager() {
); );
} }
export function testStatusGeneratorManager() { export function testStatusGeneratorManager(additionalClients) {
return new StatusGeneratorManager( return new StatusGeneratorManager(
defaultStatusGenerators(), defaultStatusGenerators(),
[new FileWriter], [new FileWriter, ...additionalClients],
); );
} }
@ -45,6 +45,6 @@ export function sendStatuses() {
return defaultStatusGeneratorManager().sendStatuses(); return defaultStatusGeneratorManager().sendStatuses();
} }
export function testStatuses() { export function testStatuses(additionalClients = []) {
return testStatusGeneratorManager().sendStatuses(true); return testStatusGeneratorManager(additionalClients).sendStatuses(true);
} }

View File

@ -9,6 +9,7 @@
"cron": "node app/index.mjs cron", "cron": "node app/index.mjs cron",
"social": "node app/index.mjs social", "social": "node app/index.mjs social",
"social:test": "node app/index.mjs socialTest", "social:test": "node app/index.mjs socialTest",
"social:test:mastodon": "node app/index.mjs socialTestMastodon",
"splatnet": "node app/index.mjs splatnet", "splatnet": "node app/index.mjs splatnet",
"warmCaches": "node app/index.mjs warmCaches" "warmCaches": "node app/index.mjs warmCaches"
}, },