tests
This commit is contained in:
parent
54f37f9521
commit
3a7254708e
19 changed files with 1560 additions and 1237 deletions
|
|
@ -58,12 +58,16 @@ describe('Queue Utils', () => {
|
|||
|
||||
const connection = getRedisConnection(config);
|
||||
|
||||
expect(connection).toEqual(config);
|
||||
expect(connection.host).toBe('production.redis.com');
|
||||
expect(connection.port).toBe(6380);
|
||||
expect(connection.password).toBe('secret');
|
||||
expect(connection.db).toBe(1);
|
||||
expect(connection.username).toBe('user');
|
||||
expect(connection.maxRetriesPerRequest).toBe(null);
|
||||
expect(connection.enableReadyCheck).toBe(false);
|
||||
expect(connection.connectTimeout).toBe(3000);
|
||||
expect(connection.lazyConnect).toBe(false);
|
||||
expect(connection.keepAlive).toBe(true);
|
||||
expect(typeof connection.retryStrategy).toBe('function');
|
||||
});
|
||||
|
||||
it('should handle minimal config', () => {
|
||||
|
|
@ -100,7 +104,15 @@ describe('Queue Utils', () => {
|
|||
|
||||
const connection = getRedisConnection(config);
|
||||
|
||||
expect(connection).toEqual(config);
|
||||
// Check that all original properties are preserved
|
||||
expect(connection.host).toBe('redis.example.com');
|
||||
expect(connection.port).toBe(6379);
|
||||
expect(connection.password).toBe('pass123');
|
||||
expect(connection.db).toBe(2);
|
||||
expect(connection.maxRetriesPerRequest).toBe(null); // Our override
|
||||
expect(connection.enableReadyCheck).toBe(false); // Our override
|
||||
expect(connection.enableOfflineQueue).toBe(false); // Preserved from original
|
||||
expect(connection.username).toBe('admin'); // Preserved from original
|
||||
});
|
||||
});
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue