Skip to content

Commit 60bb0c8

Browse files
committed
fix: using env.ensureConf prevent tests break
1 parent 0ff07d0 commit 60bb0c8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/api.tests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as t from 'lib0/testing'
33
import * as api from '../src/api.js'
44
import * as encoding from 'lib0/encoding'
55
import * as promise from 'lib0/promise'
6+
import * as env from 'lib0/environment'
67
import * as redis from 'redis'
78
import { prevClients, store } from './utils.js'
89

@@ -14,7 +15,7 @@ const redisPrefix = 'ytests'
1415
const createTestCase = async tc => {
1516
await promise.all(prevClients.map(c => c.destroy()))
1617
prevClients.length = 0
17-
const redisClient = redis.createClient({ url: api.redisUrl })
18+
const redisClient = redis.createClient({ url: env.ensureConf('ysr-redis') })
1819
await redisClient.connect()
1920
// flush existing content
2021
const keysToDelete = await redisClient.keys(redisPrefix + ':*')

tests/socketio.tests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as array from 'lib0/array'
77
import * as redis from 'redis'
88
import * as time from 'lib0/time'
99
import * as jwt from 'lib0/crypto/jwt'
10+
import * as env from 'lib0/environment'
1011
import * as utils from './utils.js'
1112
import { SocketIOProvider } from '../src/y-socket-io/client.js'
1213

@@ -66,7 +67,7 @@ const createApiClient = async () => {
6667
const createTestCase = async (tc) => {
6768
await promise.all(utils.prevClients.map((c) => c.destroy()))
6869
utils.prevClients.length = 0
69-
const redisClient = redis.createClient({ url: api.redisUrl })
70+
const redisClient = redis.createClient({ url: env.ensureConf('ysr-redis') })
7071
await redisClient.connect()
7172
// flush existing content
7273
const keysToDelete = await redisClient.keys(utils.redisPrefix + ':*')

0 commit comments

Comments
 (0)