Skip to content

Commit b2943c7

Browse files
committed
fixed failing tests to include EAI_AGAIN in error message
1 parent ce607c7 commit b2943c7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/unit/redis.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as sinon from "sinon";
21
import { expect } from "chai";
2+
import * as sinon from "sinon";
33
import Redis from "../../lib/Redis";
44
import { RedisOptions } from "../../lib/redis/RedisOptions";
55

@@ -123,7 +123,10 @@ describe("Redis", () => {
123123

124124
describe(".createClient", () => {
125125
it("should redirect to constructor", () => {
126-
const redis = Redis.createClient({ name: "pass", lazyConnect: true });
126+
const redis = Redis.createClient({
127+
name: "pass",
128+
lazyConnect: true,
129+
});
127130
expect(redis.options).to.have.property("name", "pass");
128131
expect(redis.options).to.have.property("lazyConnect", true);
129132
});
@@ -198,9 +201,7 @@ describe("Redis", () => {
198201
redis.on("error", (err) => {
199202
try {
200203
expect(err).to.be.instanceOf(Error);
201-
expect(err.message).to.contain("ENOTFOUND");
202-
} catch (assertionError) {
203-
done(assertionError);
204+
expect(err.message).to.match(/(ENOTFOUND|EAI_AGAIN)/);
204205
} finally {
205206
redis.disconnect();
206207
done();

0 commit comments

Comments
 (0)