mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 21:53:43 +01:00
Add vitest check when initialising redis
This is similar to the Mocha checks and will error if a connection is attempted. GitOrigin-RevId: 35e73cb56dc7c72393c55f40b6c18e9aaf74ab50
This commit is contained in:
@@ -3,8 +3,9 @@ const redis = require('@overleaf/redis-wrapper')
|
||||
const { addConnectionDrainer } = require('./GracefulShutdown')
|
||||
|
||||
if (
|
||||
typeof global.beforeEach === 'function' &&
|
||||
process.argv.join(' ').match(/unit/)
|
||||
(typeof global.beforeEach === 'function' &&
|
||||
process.argv.join(' ').match(/unit/)) ||
|
||||
process.env.VITEST
|
||||
) {
|
||||
throw new Error(
|
||||
'It looks like unit tests are running, but you are connecting to Redis. Missing a stub?'
|
||||
|
||||
Reference in New Issue
Block a user