-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for clustered Redis caches (#31185)
- Loading branch information
1 parent
a9fa518
commit faa0902
Showing
3 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { normalizeRedisUrl } from './redis'; | ||
|
||
describe('util/cache/package/redis', () => { | ||
describe('normalizeRedisUrl', () => { | ||
it('leaves standard Redis URL alone', () => { | ||
const url = 'redis://user:password@localhost:6379'; | ||
expect(normalizeRedisUrl(url)).toBe(url); | ||
}); | ||
|
||
it('leaves secure Redis URL alone', () => { | ||
const url = 'rediss://user:password@localhost:6379'; | ||
expect(normalizeRedisUrl(url)).toBe(url); | ||
}); | ||
|
||
it('rewrites standard Redis Cluster URL', () => { | ||
const url = 'redis+cluster://user:password@localhost:6379'; | ||
expect(normalizeRedisUrl(url)).toBe( | ||
'redis://user:password@localhost:6379', | ||
); | ||
}); | ||
|
||
it('rewrites secure Redis Cluster URL', () => { | ||
const url = 'rediss+cluster://user:password@localhost:6379'; | ||
expect(normalizeRedisUrl(url)).toBe( | ||
'rediss://user:password@localhost:6379', | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters