Skip to content

Commit c275e9a

Browse files
authored
test(functional): monitor result compare lowercase more changes - related to issue #1671 (#1675)
Signed-off-by: Boaz Sade <[email protected]>
1 parent 0add883 commit c275e9a

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

test/functional/monitor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("monitor", () => {
1515
return;
1616
}
1717
monitor.on("monitor", function (time, args) {
18-
expect(args[0]).to.eql("get");
18+
expect(args[0]).to.match(/get/i);
1919
expect(args[1]).to.eql("foo");
2020
redis.disconnect();
2121
monitor.disconnect();
@@ -61,7 +61,7 @@ describe("monitor", () => {
6161
return;
6262
}
6363
monitor.on("monitor", (_time, args) => {
64-
if (args[0] === "set") {
64+
if (args[0] === "set" || args[0] === "SET") {
6565
redis.disconnect();
6666
monitor.disconnect();
6767
done();

test/functional/pipeline.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ describe("pipeline", () => {
323323
redis.disconnect();
324324

325325
expectedCommands.forEach((expectedCommand, j) => {
326-
expectedCommand.forEach((arg, i) => expect(arg).to.eql(commands[j][i]));
326+
expectedCommand.forEach((arg, i) => expect(arg).to.eql(commands[j][i].toLowerCase()));
327327
});
328328
});
329329

@@ -388,9 +388,7 @@ describe("pipeline", () => {
388388
redis2.disconnect();
389389

390390
const expected = ["set", "eval", "get"];
391-
commands.forEach((c, i) => {
392-
expect(c[0]).to.equal(expected[i]);
393-
});
391+
expect(commands.map((c) => c[0].toLowerCase())).to.have.members(expected);
394392
});
395393
});
396394

test/functional/scripting.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ describe("scripting", () => {
204204
});
205205

206206
const expectedComands = ["evalsha", "eval", "get", "evalsha", "get"];
207-
expect(commands.map((c) => c[0])).to.eql(expectedComands);
207+
expect(commands.map((c) => c[0].toLowerCase())).to.have.members(expectedComands);
208208
});
209209

210210
it("should load scripts first before execution of pipeline", async () => {
@@ -230,7 +230,7 @@ describe("scripting", () => {
230230

231231
const expectedComands = ["evalsha", "get", "eval", "set", "get"];
232232

233-
expect(commands.map((c) => c[0])).to.eql(expectedComands);
233+
expect(commands.map((c) => c[0].toLowerCase())).to.have.members(expectedComands);
234234
});
235235

236236
it("does not fallback to EVAL in regular transaction", async () => {
@@ -260,7 +260,7 @@ describe("scripting", () => {
260260
spy.restore();
261261
expect(spy.callCount).to.equal(4);
262262
const expectedComands = ["multi", "evalsha", "evalsha", "exec"];
263-
expect(commands.map((c) => c[0])).to.eql(expectedComands);
263+
expect(commands.map((c) => c[0].toLowerCase())).to.have.members(expectedComands);
264264
});
265265

266266
it("does not fallback to EVAL in manual transaction", async () => {
@@ -284,7 +284,7 @@ describe("scripting", () => {
284284
spy.restore();
285285
expect(spy.callCount).to.equal(4);
286286
const expectedComands = ["multi", "evalsha", "evalsha", "exec"];
287-
expect(commands.map((c) => c[0])).to.eql(expectedComands);
287+
expect(commands.map((c) => c[0].toLowerCase())).to.have.members(expectedComands);
288288
});
289289

290290
it("should support key prefixing", (done) => {

0 commit comments

Comments
 (0)