Skip to content

Commit

Permalink
fix(iomethods.ts added hmset): added hmset in iomethods.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
isimisi committed Sep 12, 2023
1 parent fc0b931 commit 7963001
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ioMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const ioMethods = [
'hget',
'hgetBuffer',
'hmget',
'hmset',
'hincrby',
'hincrbyfloat',
'hdel',
Expand Down
28 changes: 28 additions & 0 deletions test/redis.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,32 @@ test.group('Redis Manager', () => {

await redis.quit('primary')
})

test('hmset and hmget', async ({ assert }) => {
const app = new Application(__dirname, 'web', {})
const redis = new RedisManager(
app,
{
connection: 'primary',
connections: {
primary: {
host: process.env.REDIS_HOST,
port: Number(process.env.REDIS_PORT),
},
cluster: {
clusters: clusterNodes,
},
},
},
new Emitter(app)
) as unknown as RedisManagerContract

await redis.hmset('greeting', { hello: 'world' })
const greeting = await redis.hmget('greeting', 'hello')

assert.equal(greeting, 'world')

await redis.del('greeting')
await redis.quit('primary')
})
})

0 comments on commit 7963001

Please sign in to comment.