mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 11:36:58 +03:00
21 lines
633 B
TypeScript
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();
|
|
});
|
|
});
|
|
}); |