forked from Lilly-Protocol/lily-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetrics.test.ts
More file actions
27 lines (23 loc) · 834 Bytes
/
Copy pathmetrics.test.ts
File metadata and controls
27 lines (23 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import request from "supertest";
import { describe, expect, it } from "vitest";
import { createApp } from "../src/app";
describe("metrics endpoints", () => {
const app = createApp();
it("returns process metrics and telemetry data", async () => {
const response = await request(app).get("/api/v1/metrics");
expect(response.status).toBe(200);
expect(response.body.success).toBe(true);
expect(response.body.data).toMatchObject({
uptimeSeconds: expect.any(Number),
memoryUsage: {
rssBytes: expect.any(Number),
heapTotalBytes: expect.any(Number),
heapUsedBytes: expect.any(Number),
externalBytes: expect.any(Number),
},
nodeVersion: expect.stringMatching(/^v\d+/),
environment: expect.any(String),
timestamp: expect.any(String),
});
});
});