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

View File

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

View File

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