-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathstats.test.ts
25 lines (20 loc) · 1017 Bytes
/
stats.test.ts
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
import * as request from "supertest";
import { setTimeout } from "timers/promises";
import { environment } from "../../src/config";
import { localConfig } from "../../src/config";
describe("/stats", () => {
jest.setTimeout(localConfig.standardTimeout); //works unstable without timeout
//@id1515
it("Verify the response via /stats", async () => {
await setTimeout(localConfig.extendedPause); //works unstable without timeout
const apiRoute = `/stats`;
return request(environment.blockExplorerAPI)
.get(apiRoute)
.expect(200)
.expect((res) => expect(typeof res.body.lastSealedBatch).toStrictEqual("number"))
.expect((res) => expect(typeof res.body.lastVerifiedBatch).toStrictEqual("number"))
.expect((res) => expect(typeof res.body.lastSealedBlock).toStrictEqual("number"))
.expect((res) => expect(typeof res.body.lastVerifiedBlock).toStrictEqual("number"))
.expect((res) => expect(typeof res.body.totalTransactions).toStrictEqual("number"));
});
});