Redis = require('ioredis-mock'); redis = new Redis()
redis.defineCommand('scanWrapper', { lua: `local res = redis.call('SCAN', '0') for idx, member in ipairs(res[2]) do print(idx, member) end return res[2]` })
await redis.mset('a', '1', 'b', '2'); await redis.scanWrapper()
prints
1 b
at index 0 (wrong) a
instead of expected
1 a
2 b
at index 0 (wrong) nil
and returns
['b']
instead of
['a', 'b']
Patch (dirty)
for bundled v8.9.0 (with npx patch-package ioredis-mock)
Reproduce
From the REPL (
> node
)prints
instead of expected
and returns
instead of
Patch (dirty)
for bundled v8.9.0 (with
npx patch-package ioredis-mock
)