-
-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathtest_redis.ts
More file actions
33 lines (28 loc) · 918 Bytes
/
Copy pathtest_redis.ts
File metadata and controls
33 lines (28 loc) · 918 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
28
29
30
31
32
33
import { assert } from "chai";
import { v4 } from "uuid";
import RedisBackend from "../../src/backends/redis";
const redisUrl = "redis://";
describe("redis backend", () => {
describe("storeResult", () => {
it("just store", done => {
const taskId = v4();
const backend = new RedisBackend(redisUrl, {});
backend.storeResult(taskId, 3, "SUCCESS").then(result => {
assert.deepEqual(result, [ "OK", 0 ]);
backend.disconnect().then(() => done());
});
});
});
describe("getTaskMeta", () => {
it("getTaskMeta with store", done => {
const taskId = v4();
const backend = new RedisBackend(redisUrl, {});
backend.storeResult(taskId, 3, "SUCCESS").then(result => {
backend.getTaskMeta(taskId).then(data => {
assert.equal(data["result"], 3);
backend.disconnect().then(() => done());
});
});
});
});
});