mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
[misc] do not access potentially undefined opts
This commit is contained in:
parent
e34f17a352
commit
6452959482
2 changed files with 5 additions and 1 deletions
|
@ -33,7 +33,7 @@ function createClient(opts) {
|
|||
}
|
||||
|
||||
let client
|
||||
if (opts.cluster) {
|
||||
if (standardOpts.cluster) {
|
||||
delete standardOpts.cluster
|
||||
client = new Redis.Cluster(opts.cluster, standardOpts)
|
||||
} else {
|
||||
|
|
|
@ -78,6 +78,10 @@ describe('index', function () {
|
|||
})
|
||||
})
|
||||
|
||||
it('should work without opts', function () {
|
||||
this.redis.createClient()
|
||||
})
|
||||
|
||||
it('should use the ioredis driver in single-instance mode if a non array is passed', function () {
|
||||
const client = this.redis.createClient(this.standardOpts)
|
||||
return assert.equal(client.constructor, this.ioredis)
|
||||
|
|
Loading…
Reference in a new issue