Files
SponsorBlockServer/test/cases/redisTest.ts
2021-12-19 02:03:50 -05:00

21 lines
633 B
TypeScript

import { config } from "../../src/config";
import redis from "../../src/utils/redis";
import crypto from "crypto";
import assert from "assert";
const randomID = crypto.pseudoRandomBytes(8).toString("hex");
describe("redis test", function() {
before(async function() {
if (!config.redis) this.skip();
await redis.setAsync(randomID, "test");
});
it("Should get stored value", (done) => {
redis.getAsync(randomID)
.then(res => {
if (res.err) assert.fail(res.err);
assert.strictEqual(res.reply, "test");
done();
});
});
});