fix types and build

This commit is contained in:
Yusuf Yilmaz 2022-06-07 10:50:51 +02:00
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 () => {