mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-21 09:33:10 -07:00
fix types and build
This commit is contained in:
parent
b920c1f7ad
commit
6c1a1277ff
10 changed files with 783 additions and 76 deletions
|
@ -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 () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue