Personal Telegram developer console for GitHub

test(cloudflare): require runtime plugin registration

davoodmehraban89 committed Oct 4, 2026 at 23:29 UTC 6f3b2f585aa1cadcb61b11508fee8627c757f8ac
1 file changed +15
test/bot.test.js
+15
@@ -44,6 +44,21 @@ function makeBot() {
44 return bot;
45 }
46
47 +describe('Nexa Dev Bot - Cloudflare plugin registration', () => {
48 + it('registers the Cloudflare READ plugin and fails closed when provider config is absent', async () => {
49 + const bot = new NexaDevBot();
50 + assert.ok(bot.registry.getPlugin('cloudflare'), 'cloudflare plugin must be registered');
51 + assert.deepEqual(bot.registry.getAction('cloudflare.worker.status'), {
52 + pluginId: 'cloudflare',
53 + actionId: 'cloudflare.worker.status',
54 + risk: 'READ'
55 + });
56 +
57 + const view = await bot.router.dispatchCallback('cf:status', { isOwner: true, ownerId: '123' });
58 + assert.match(view.text, /پیکربندی نشده|not configured/i);
59 + });
60 +});
61 +
62 describe('Nexa Dev Bot - Webhook Dispatcher & In-Place Editing', () => {
63 it('/start installs the bottom quick menu and sends the inline Main Menu', async () => {
64 const sentMessages = [];