add redis status/min

This commit is contained in:
Michael C
2021-12-30 16:47:11 -05:00
parent ceabeefe21
commit b9a620fc3b
3 changed files with 38 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import assert from "assert";
import { db } from "../../src/databases/databases";
import { client } from "../utils/httpClient";
import { config } from "../../src/config";
let dbVersion: number;
describe("getStatus", () => {
@@ -86,4 +87,27 @@ describe("getStatus", () => {
})
.catch(err => done(err));
});
it("Should be able to get statusRequests only", function (done) {
if (!config.redis) this.skip();
client.get(`${endpoint}/statusRequests`)
.then(res => {
assert.strictEqual(res.status, 200);
assert.ok(Number(res.data) > 1);
done();
})
.catch(err => done(err));
});
it("Should be able to get status with statusRequests", function (done) {
if (!config.redis) this.skip();
client.get(endpoint)
.then(res => {
assert.strictEqual(res.status, 200);
const data = res.data;
assert.ok(data.statusRequests > 2);
done();
})
.catch(err => done(err));
});
});