1
0
mirror of https://github.com/seejohnrun/haste-server.git synced 2025-12-16 02:25:56 +00:00

fix types and build

This commit is contained in:
Yusuf Yilmaz
2022-06-07 10:50:51 +02:00
parent b920c1f7ad
commit 6c1a1277ff
10 changed files with 783 additions and 76 deletions

View File

@@ -1,4 +1,5 @@
import RedisDocumentStore from 'src/lib/document-stores/redis'
import { StoreNames } from 'src/types/store-names'
describe('Redis document store', () => {
let store: RedisDocumentStore
@@ -13,7 +14,7 @@ describe('Redis document store', () => {
it('should be able to set a key and have an expiration set', async () => {
store = new RedisDocumentStore({
expire: 10,
type: 'redis',
type: StoreNames.redis
})
return store.set('hello1', 'world', async () => {
const res = await store.client?.ttl('hello1')
@@ -24,7 +25,7 @@ describe('Redis document store', () => {
it('should not set an expiration when told not to', async () => {
store = new RedisDocumentStore({
expire: 10,
type: 'redis',
type: StoreNames.redis
})
store.set(
@@ -34,13 +35,13 @@ describe('Redis document store', () => {
const res = await store.client?.ttl('hello2')
expect(res).toEqual(-1)
},
true,
true
)
})
it('should not set an expiration when expiration is off', async () => {
store = new RedisDocumentStore({
type: 'redis',
type: StoreNames.redis
})
store.set('hello3', 'world', async () => {