mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
refactor(api): emit moderation events and apply account actions (#3031)
This commit is contained in:
1 parent
c488906131
commit
364084c819
385 files changed
+8994
-22221
No files matched your search
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {createMetricsMiddleware} from '@fluxer/hono/src/middleware/Metrics';
|
||||
import {createMetricsMiddleware, registerMetricsSection} from '@fluxer/hono/src/middleware/Metrics';
|
||||
import {Hono} from 'hono';
|
||||
import {describe, expect, test} from 'vitest';
|
||||
|
||||
@@ -255,4 +255,14 @@ describe('Metrics Middleware', () => {
|
||||
expect(body).toContain('fluxer_gateway_uptime_seconds');
|
||||
});
|
||||
});
|
||||
|
||||
describe('registered sections', () => {
|
||||
test('appends registered sections until they are unregistered', async () => {
|
||||
const {app} = createTestApp();
|
||||
const unregister = registerMetricsSection(() => '# TYPE fluxer_test_extra gauge\nfluxer_test_extra 7');
|
||||
expect(await (await requestMetrics(app)).text()).toContain('fluxer_test_extra 7');
|
||||
unregister();
|
||||
expect(await (await requestMetrics(app)).text()).not.toContain('fluxer_test_extra');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user