Open ChrisKitching opened 3 years ago
Standalone testcase to reproduce the problem (tested with version 5.2.2 of ioredis-mock):
5.2.2
ioredis-mock
describe("Creation of global variables with lua", () => { test("works with ioredis-mock (shouldn't)", async() => { const IORedis = require('ioredis-mock'); const redis = new IORedis('localhost'); await redis.eval('foo = 3', 0); }); test("Fails with real redis", async() => { const IORedis = require('ioredis'); const redis = new IORedis('localhost'); // ReplyError: ERR Error running script (call to f_4501040002bbe2b1855b07f138595e980f445a6f): @enable_strict_lua:8: user_script:1: Script attempted to create global variable 'foo' await redis.eval('foo = 3', 0); }); });
ioredis-mock allows the creation of global variables in lua scripts, but real redis does not.
PRs welcome <3
Standalone testcase to reproduce the problem (tested with version
5.2.2
ofioredis-mock
):ioredis-mock
allows the creation of global variables in lua scripts, but real redis does not.