[mirotalksfu] - add timestamp to stats, fix api doc

هذا الالتزام موجود في:
Miroslav Pejic
2024-12-21 11:23:21 +01:00
الأصل 3e2708c21b
التزام 0f451901c4
7 ملفات معدلة مع 27 إضافات و24 حذوفات

عرض الملف

@@ -16,6 +16,7 @@ describe('test-ServerAPI', () => {
const host = 'example.com';
const authorization = 'secret-key';
const apiKeySecret = 'secret-key';
const timestamp = new Date().toISOString();
beforeEach(() => {
// Mocking config values
@@ -58,9 +59,10 @@ describe('test-ServerAPI', () => {
],
]);
const result = serverApi.getStats(roomList);
const result = serverApi.getStats(roomList, timestamp);
result.should.deepEqual({
timestamp: timestamp,
totalRooms: 2,
totalUsers: 3,
});
@@ -72,9 +74,10 @@ describe('test-ServerAPI', () => {
['room2', { peers: new Map() }],
]);
const result = serverApi.getStats(roomList);
const result = serverApi.getStats(roomList, timestamp);
result.should.deepEqual({
timestamp: timestamp,
totalRooms: 2,
totalUsers: 0,
});
@@ -83,9 +86,10 @@ describe('test-ServerAPI', () => {
it('should return 0 rooms when roomList is empty', () => {
const roomList = new Map();
const result = serverApi.getStats(roomList);
const result = serverApi.getStats(roomList, timestamp);
result.should.deepEqual({
timestamp: timestamp,
totalRooms: 0,
totalUsers: 0,
});