Skip to content

Commit

Permalink
test: replaced localhost for proper connection
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Nov 6, 2023
1 parent 02a2010 commit 0147056
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions tests/test_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('connection', () => {

beforeEach(async function () {
queueName = `test-${v4()}`;
queue = new Queue(queueName, { connection: { host: 'localhost' }, prefix });
queue = new Queue(queueName, { connection, prefix });
});

afterEach(async function () {
Expand Down Expand Up @@ -68,11 +68,10 @@ describe('connection', () => {

describe('blocking', () => {
it('should override maxRetriesPerRequest: null as redis options', async () => {
connection = new IORedis(redisHost, { maxRetriesPerRequest: 20 });

const queue = new QueueBase(queueName, {
connection: {
host: 'localhost',
maxRetriesPerRequest: 20,
},
connection,
});

const options = <RedisOptions>(await queue.client).options;
Expand All @@ -83,11 +82,10 @@ describe('connection', () => {

describe('non-blocking', () => {
it('should not override any redis options', async () => {
connection = new IORedis(redisHost, { maxRetriesPerRequest: 20 });

const queue = new QueueBase(queueName, {
connection: {
host: 'localhost',
maxRetriesPerRequest: 20,
},
connection,
blockingConnection: false,
});

Expand Down
2 changes: 1 addition & 1 deletion tests/test_rate_limiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('Rate Limiter', function () {
it('should quickly close a worker even with slow rate-limit', async function () {
const limiter = { max: 1, duration: 60 * 1000 };
const worker = new Worker(queueName, async () => {}, {
connection: { host: 'localhost' },
connection,
prefix,
limiter,
});
Expand Down

0 comments on commit 0147056

Please sign in to comment.